Create 3 Lives then subtract

Get help using Construct 2

Post » Sun May 19, 2013 12:18 pm

Hi there, I built a nice shooter game but I'm having some difficulties in setting 3 lives by default, subtract one after each destroy and a game over screen. Can anyone help me please? :) Thanks in advance.

Also, how do I create a new level?
B
3
Posts: 6
Reputation: 212

Post » Sun May 19, 2013 12:31 pm

@spikegotti - have you checked out the tutorial section or the How Do I forum page yet? If not, you'll find most of your answers there.

http://www.scirra.com/forum/topic45416.html

https://www.scirra.com/tutorials/top
B
32
S
7
G
8
Posts: 312
Reputation: 8,467

Post » Sun May 19, 2013 12:54 pm

Create a global variable and set it to 3 by default. Each destroy, substract 1 to the variable.
When your variable equals zero, go to game over screen.
B
20
S
5
G
3
Posts: 58
Reputation: 4,136

Post » Sun May 19, 2013 1:45 pm

Thanks guys :)

I created the global variable > Life=3
On Destroy the player if health runs out, I set subtract 1 from life.
What Im having the challenge in is setting the image to display the lives available.
B
3
Posts: 6
Reputation: 212

Post » Sun May 19, 2013 2:15 pm

I have a health bar, it is working fine, but somehow I cant seem to get the life to be deducted by one on each layout reset. :(
B
3
Posts: 6
Reputation: 212

Post » Sun May 19, 2013 2:20 pm

@spikegotti : Did you substract the live Before restarting or just after?
https://www.scirra.com/forum/viewtopic.php?t=152506

And that is why you shall respect the bug reports guidelines, not only giving a capx is making the bug reproductible in one click in a situation they can work with (less time wasted trying to reproduce vague instructions) but also it helps filtering false positives.

Game design is all about decomposing the core of your game so it becomes simple instructions.
B
42
S
17
G
16
Posts: 2,094
Reputation: 15,355

Post » Sun May 19, 2013 2:25 pm

Hi, I set the life to 3 on start, then set life to -1 after restart layout.
B
3
Posts: 6
Reputation: 212

Post » Sun May 19, 2013 2:38 pm

I think, on your actions, you should do:

Set lives to -1
Restart Layout

in this order, or else, the layout is restarted before, so the conditions are
https://www.scirra.com/forum/viewtopic.php?t=152506

And that is why you shall respect the bug reports guidelines, not only giving a capx is making the bug reproductible in one click in a situation they can work with (less time wasted trying to reproduce vague instructions) but also it helps filtering false positives.

Game design is all about decomposing the core of your game so it becomes simple instructions.
B
42
S
17
G
16
Posts: 2,094
Reputation: 15,355

Post » Sun May 19, 2013 3:40 pm

Thank you very much... Its working, but I don't see the image for the life :( sorry for being such an annoying n00b :/
B
3
Posts: 6
Reputation: 212

Post » Sun May 19, 2013 5:10 pm

Thanks for the help guys, everything fixed :D
B
3
Posts: 6
Reputation: 212

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 19 guests