Else Statements

For questions about using Classic.

Post » Mon Nov 26, 2007 9:04 am

Hi, I'm having a bit of trouble getting else statements to work, as I understand it, they would work similarly to TGF's negate function no?
for example I have something like:

If controller is moving, change the character sprite animation to walking
else
change character animation to stopped

Now logically it looks as though it would work, but whenever I try it, all i get is the stopped animation and no walking. EIther I dunno how to use the else statement right or something is wrong :(
Help! lol
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Mon Nov 26, 2007 2:27 pm

My guess is animations are broken :P Else runs when the event above it does not run:

+ Global variable 'My value' = 0
: Do something

+ (separate event) Else
: Do something else

Else in this case is like a shortcut for "Global variable 'My value' does not equal 0". It runs when the event above it does not.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Mon Nov 26, 2007 11:52 pm

:(
I made a little .cap file that tried what you just said, I can email it to you if you want.
But all that happens is anything in the else event happens ALL the time and the event above it does nothing.
At least that's what happens on my machine...
B
3
S
2
G
5
Posts: 351
Reputation: 2,377


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests