Else If

Get help using Construct 2

Post » Sat Jan 11, 2014 3:26 am

Hi guys, I'm noob, so... I dont know how can I solve this problem:

I have the condition:

if number_Stars = 4 -> player wins 1 life
if number_Stars = 5 -> player wins 3 lifes

I created a variable to verify this... but... it dont work.

Anyone have any idea?

Tks!
B
44
S
7
Posts: 79
Reputation: 4,340

Post » Sat Jan 11, 2014 3:36 am

Right click on the your event, and you should see "add --> add else"
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Sat Jan 11, 2014 4:12 am

HOld on... if that does not work, how do you increment number_Stars ?
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Sat Jan 11, 2014 4:13 am

I tried, I tried but I was unable to do it
B
44
S
7
Posts: 79
Reputation: 4,340

Post » Sat Jan 11, 2014 4:42 am

Is your "Player wins 1 life" or whatever, simply "global variable life + 1" or something?

Elaborate more or we cannot help you. You provide us with so little information.
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Sat Jan 11, 2014 9:24 am

One way of doing this sort of thing (A slightly more complex example than you asked about) :






edit

Updated picture (10:01am 11/01/2014)

I have written it out like this to make it easy to read the logic - this could probably be done in one line using multiple brackets but for this example I thought breaking it up a bit would help ....RamPackWobble2014-01-11 10:02:35
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Sat Jan 11, 2014 1:40 pm

Thank you guys, you helped me. :)
thank you very much!!!!!
B
44
S
7
Posts: 79
Reputation: 4,340


Return to How do I....?

Who is online

Users browsing this forum: RandomlyMooN and 7 guests