Stopping a random animation.

Discussion and feedback on Construct 2

Post » Sun Sep 02, 2012 11:20 pm

Hi.

I have now converted to Construct 2, and I have a project where there are squares flashing like Press Your Luck and I need to stop the squares by pressing the Space Bar.

Any help on this would be greatly appreciated. Thank you so much.

- Chris
B
1
G
2
Posts: 8
Reputation: 641

Post » Sun Sep 02, 2012 11:41 pm

If variable 'stop' equals 0, every X seconds:
--> set frame to floor(random(0,number of frames in animation)

On space bar pressed:
--> set 'stop' to 1.

You might need a +1 to the number of frames due to the floor(), not sure. Try it out.

sqiddster2012-09-02 23:42:44
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Mon Sep 03, 2012 12:48 am

Hi Squidoo! :)

I'm sorry but, it still is not working.

I have a global variable of Stop=0

I already set the keyboard to On Space Pressed - System Set Stop to 1

And on System - Stop=0, Every X seconds - Sprite, Set Animation Frame to floor(random(0,9))

Am I missing something?

I forget how you add the +1.

Thank you so much again!

- Chrischriskvideochallenge2012-09-03 00:57:57
B
1
G
2
Posts: 8
Reputation: 641


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 3 guests