How do I choose between 2 frames?

Get help using Construct 2

Post » Sun Nov 30, 2014 1:16 am

Hello everyone,

Im having a small issue! im currently using:

Every 2 seconds -> Set animation frame to: choose(0,1)
So that it chooses a random frame when the object is created.
But my problem is, i want to restrict it, so that it will not choose the same frame more than 3 times in a row.


How would i do that?
B
37
S
9
G
8
Posts: 541
Reputation: 8,554

Post » Sun Nov 30, 2014 2:46 am

You can "Pick Nth instance" in the System conditions.

Then use object.Count-4 as the Nth instance to check the frame.
Do the same for object.Count-3 and object.Count-2
If all have same frame as the new object, then change it to something different.

Something like that. This is one way to do it. You can also use a variable to count how many repeats there are, and reset it if it doesn't repeat. If variable is above a number, then choose accordingly.
B
43
S
19
G
65
Posts: 1,105
Reputation: 37,949


Return to How do I....?

Who is online

Users browsing this forum: evillair and 11 guests