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
33
S
7
G
8
Posts: 312
Reputation: 8,528

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
22
S
6
G
3
Posts: 59
Reputation: 4,288

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?
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

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
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

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: grigrizljac, korbaach and 18 guests