How do I draw lives

0 favourites
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • Hey,

    I have been stuck on this for a while now. I was wondering how to draw lives? Because in GameMaker I can do it with ease in a for loop but the same method doesn't work in Construct 2.

    I basically want to take a single sprite and draw it as many times as the value of a variable. But with a single command. so it can loop.

    Thank you

  • Something like this?

    [attachment=0:3a1lxuw9][/attachment:3a1lxuw9]

  • I personally like to use the sprite as a tiled background and adjust the width according to the variable.

    Here's an example .capx:

    [attachment=0:29h3psej][/attachment:29h3psej]

  • Would using a tiled backround and setting it's width to variable*(width of one life) work for you?

    Doing it with seperate sprites would be possible as well ofcourse..

    Both in one capx:

  • Wow! Thank you all of you! I never knew the possibilities were so broad!

    In your opinion which would work the best for mobile games without performance loss?

  • I'm not sure about performance, but I really find the tiledbackground method simpler... Minor and LittleStain would probably know more about performance than me, since they're more experienced...

  • Thanks for that

  • I would always go for the tiled background method if acceptable.

    It's just the easiest and the most effective when it comes to memory use..

    One of the disadvantages of the tiled background method could be not being able to use animations in it..

  • That's great!

  • At this point, i was going to implement "lives" in my C2 first game, so i'll read this.

    The idea of using tiled backgrounds adjusted to sprite width is fine, but if you have an animated sprite won't work, i see lots of possible solutions, thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • ....

  • At this point, i was going to implement "lives" in my C2 first game, so i'll read this.

    The idea of using tiled backgrounds adjusted to sprite width is fine, but if you have an animated sprite won't work, i see lots of possible solutions, thanks

    OMG why did you bump a 4 years old thread?

  • OMG why did you bump a 4 years old thread?

    Does it matter? As a newbie C2 user i search the forum for help and ideas and i guess other new users would someday arrive to this places so why not post my feelings and impressions?

    By the way i finally decided to use in my game what brunopalermo suggested, tiledbackground and it's fine.

    https://www.scirra.com/arcade/action-games/ivans-run-28130

    Other displays in my game are animated sprites, i was thinking about to make also animated lives but finally i liked the result with tiledbackgrounds. I guess if somebody wants to create animated lives could create as many objet sprites as lives and placed at a X fixed position +sprite.width*numberOfLive, i do this in most BASIC languajes using loops but not able to do in C2 yet

  • Does it matter? As a newbie C2 user i search the forum for help and ideas and i guess other new users would someday arrive to this places so why not post my feelings and impressions?

    Post your questions, feelings and impressions in a new thread, that would be more helpful for everyone. I'm not a mod, but that's just common forum etiquette.

  • >

    > Does it matter? As a newbie C2 user i search the forum for help and ideas and i guess other new users would someday arrive to this places so why not post my feelings and impressions?

    >

    Post your questions, feelings and impressions in a new thread, that would be more helpful for everyone. I'm not a mod, but that's just common forum etiquette.

    In my opinion posting in another thread is out of place if what i'm posting is related to this matter, and here is where people serching the same thing as i searched will arrive. i don't see the importance of the "older" or "newer" when the important is the keywords you search in the searchbox.

    I googled something like "construct 2 drawing lives" and this was one of the top results i found.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)