end a code run

Get help using Construct 2

Post » Mon Feb 04, 2013 3:09 pm

Hi,
first of all sorry for the not really clear title but i hope you will get what i mean.
i'm currently doing the menu for my game and wanted to ask you something about the code:

https://www.dropbox.com/s/t258mx2vzvrwb3f/code%20example.png

I know that this can't work because right after it sets the sprite to invisible it gets "detected by the next condition" and set to visible again because the key was released before.

But what i want is that with every press of the button the sprite gets visible if its invisible and if its already visible it gets invisible.

so I wanted to ask if there is any action that "says" start reading the code from above again without looking any further in the code, so that i can place this action right after the set visible/invisible action.

I hope i could point out what i meant.

greets cannikon
B
3
Posts: 10
Reputation: 370

Post » Mon Feb 04, 2013 3:14 pm

Use 'else' condition on second condition, that should work.
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Mon Feb 04, 2013 3:14 pm

The best way of you want some type of "toggle" on/off behavior would be to use a variable. Then have it check for the variable changing. That may give you more predictable control.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Mon Feb 04, 2013 7:24 pm

ok thank you both for your great and especially super fast answers ^^
B
3
Posts: 10
Reputation: 370


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests