sprite frames not working correctly (maybe bug)

For questions about using Classic.

Post » Tue Jan 10, 2012 9:34 am

I was trying to perform a simple sprite transition from one frame to another using the on click function with a animation frame is equal to condition. The cap is here if anyone would care to take a look. its really frustrating being that it's straight forward logic to switch from one animation frame to another depending on what the active frame is.

also when running the cap file it displays the second sprite frame first which I never asked it to do.

Cap File

Regards

RobertLobsterbob2012-01-10 09:36:06
B
2
G
1
Posts: 9
Reputation: 520

Post » Tue Jan 10, 2012 10:07 am

Try putting a "Else" condition on your second condition. I managed to get it to work. Hope this helps.
B
27
S
9
G
5
Posts: 108
Reputation: 5,744

Post » Tue Jan 10, 2012 4:48 pm

thanks for the reply but it still doesnt want to work correctly, here's the cap with the added else statement amended cap file it also still starts on sprite frame 2 instead of 1
B
2
G
1
Posts: 9
Reputation: 520

Post » Tue Jan 10, 2012 4:51 pm

Sorry, the last CAPX link does not work, and the first is to confusing for me. cant you get dropbox?
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Tue Jan 10, 2012 5:43 pm

Apologies here is the dropbox link

Cap File
B
2
G
1
Posts: 9
Reputation: 520

Post » Tue Jan 10, 2012 5:45 pm

It displays the second frame first, because it is set to animate. You need to turn the animation speed off in the animation properties.

The main problem you have is that 'on click' is read over the two events. It checks the animation frame, sets the animation frame, checks the animation frame and sets it back to the first.

Here is one way around that, manually checking that the button is released between events.

http://dl.dropbox.com/u/1487524/Scirra/SpriteTransition.cap
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Tue Jan 10, 2012 6:06 pm

thanks that solved my problem. knew it was something obvious thanks
B
2
G
1
Posts: 9
Reputation: 520


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests