How do I hide 1 of 5 heart everytime player dies

Get help using Construct 2

Post » Mon May 04, 2015 11:54 am

Hi , i have 5 hearts(lives) on screen , and everytime my hero dies i want to hide 1 heart from the right until there is none. how can i do this plz?
B
11
S
3
G
1
Posts: 419
Reputation: 1,782

Post » Mon May 04, 2015 1:06 pm

Easiest way would probably be to use a tiledbackground object and set it's width according to the amount of hearts..

so if the image of the heart is 100x100 pixels

add a tiled background object
load the image

set the tiled background to the height of 100 and the width of 100*(amount of hearts)
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon May 04, 2015 1:07 pm

Many ways, so I will ask...
Are the heart separate objects (sprites) or instances (clones) of a single sprite? Or is it a single sprite image with 5 hearts?
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
68
S
17
G
8
Posts: 637
Reputation: 9,420

Post » Mon May 04, 2015 1:23 pm

@LittleStain

This is exactly what i needed :-) thanks
B
11
S
3
G
1
Posts: 419
Reputation: 1,782

Post » Mon May 04, 2015 1:26 pm

If you use sprite for heart then use variables. Lives = 5
player collision with enemy then
player destroy
lives -1
B
251
S
39
G
15
Posts: 1,964
Reputation: 40,721

Post » Mon May 04, 2015 1:43 pm

@Lordshiva1948 yes exactly how i done it, thank you all for your time :-)
B
11
S
3
G
1
Posts: 419
Reputation: 1,782


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, ItsAstro, kellehk and 29 guests