Drecrease life

Get help using Construct 2

Post » Sat Nov 03, 2012 3:04 pm

I intend to decrease life, removing little sprites that represent players life. How to implemt it?

Thanks
B
65
S
13
G
2
Posts: 969
Reputation: 6,732

Post » Sat Nov 03, 2012 5:57 pm

you can make the amount of max lives, and set all the lives whivh are not in the starting to invisible, add a variable for lives, then add as many events as you need,

if [health] = 2     set heart1 visible
                    set heart2 visible

if [health] = 4     set heart1 visible
                    set heart2 visible
                    set heart3 visible
                    set heart4 visible

if player is on collision with enemy     subtract 1 from [health]

it's a bit messy but i can't thank of another way

B
20
S
8
G
2
Posts: 122
Reputation: 3,202

Post » Sat Nov 03, 2012 6:12 pm

Could I use a sprite with 5 frames (one frame with 5 images, other with 4, etc)and change the animation as played lost lives, for example? or its not a good solution?
B
65
S
13
G
2
Posts: 969
Reputation: 6,732

Post » Sat Nov 03, 2012 6:24 pm

it could be a solution but you need to change frame, not the animation.

It would be :

On collision with
               set frame to [FrameNumber]

Though it think that solution provide by Ash1221 is more flexible if you need to tweak your life. Using variable is important.Goomba2012-11-03 18:26:15
Check out the demo of my first C2 Game
https://www.scirra.com/arcade/other-gam ... n-demo-482
Follow me @84Gamestudio
B
16
S
5
G
2
Posts: 24
Reputation: 2,816


Return to How do I....?

Who is online

Users browsing this forum: LeFuji and 21 guests