pls pls help

Get help using Construct 2

Post » Sun Apr 05, 2015 2:33 pm

hi i am building a tower defence game but i need a to make it so when the live are 0 the game ends . you start out with 20 lives and so i want to make it so when the lives reach 0 the game ends and takes me to another layout.

I also want to make it so when the currency is lower than 20 you cant build towers. right now if you press on anywhere where you are allowed to place a turret you can place infinte turrets. The money logic and the when i build a turret my money gets less i have alredy made and it works.

Thanks pls pls help it would be very helpful
B
5
Posts: 34
Reputation: 295

Post » Sun Apr 05, 2015 7:05 pm

Those things can be done by adding some conditions to check if lives=0 and such.

Look at this tutorial, it will help you get the concept down.
https://www.scirra.com/tutorials/37/beg ... onstruct-2
B
94
S
33
G
118
Posts: 5,394
Reputation: 75,849

Post » Sun Apr 05, 2015 8:54 pm

hi thanks for answering , i read the whole tutorial but i still cant understand what exactly to use for the game to check if lives = 0 if so take me to gameover layout so i really dont know what condition to use .hi i am building a tower defence game but i need a to make it so when the live are 0 the game ends . you start out with 20 lives and so i want to make it so when the lives reach 0 the game ends and takes me to another layout. pls help

thanks
B
5
Posts: 34
Reputation: 295

Post » Sun Apr 05, 2015 9:46 pm

You will need to create a global variable by right clicking the layout and selecting create global variable. Call it PlayerLives or whatever you like. Now on the main event sheet create an event using system icon (the gear) and choose "compare variable" selecting the variable you created above and selecting "is less than or equal to 0". Now create an action off that event that also uses system event (the gear) and select action "go to layout" and choose your end layout.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
71
S
19
G
8
Posts: 640
Reputation: 9,701

Post » Sun Apr 05, 2015 10:02 pm

Here's something I whipped up fast. Didn't have time to comment it but it's pretty obvious. Could do with a bit of uncluttering, but my head isn't there today ;)

Clicky Clicky

UP / DOWN arrow keys = increase / decrease player lives
right click mouse = add 10 to money
B
15
S
5
G
7
Posts: 876
Reputation: 5,650

Post » Sun Apr 05, 2015 11:17 pm

:D :D :D :D :D :D Thank you very much guys I made it work thanks again
B
5
Posts: 34
Reputation: 295


Return to How do I....?

Who is online

Users browsing this forum: RIDETHEPIG and 5 guests