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
38
S
10
G
9
Posts: 542
Reputation: 9,181

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
53
S
24
G
70
Posts: 1,200
Reputation: 41,428


Return to How do I....?

Who is online

Users browsing this forum: Jantaaa, Lordshiva1948 and 6 guests