Random animation

Get help using Construct 2

Post » Sat May 25, 2013 3:57 am

Hi guys,

Could you please help me to construct an array of the following animations : leftup, rightup,leftdown,rightdown, center,centerup.

I tried several tutorials but without success (I'm just a newbie), the thing is that I need to play a random animation when the mouse left button is clicked, in my basic knowledge of arrays (other languajes) i could think about something like this Sprite.Set animation to array(random[leftup, rightup,leftdown,rightdown, center,centerup]) but obviously this won't work.

I'll really appreciate your help pals.
B
5
Posts: 23
Reputation: 821

Post » Sat May 25, 2013 5:55 am

Go it guys, thanks to @Weishaupt and this wonderful tutorial: https://www.scirra.com/tutorials/252/random-animation

Thanks a lot!!! Problem successfully solved!frankencost2013-05-25 05:55:58
B
5
Posts: 23
Reputation: 821

Post » Sat May 25, 2013 7:45 am

Another way of doing it is to set animation to: "AnimationStart" & clamp(random(5), 1, 5)

This would set the animation to animations of names "AnimationStart1" to "AnimationStart5" and saves using variables
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Sat May 25, 2013 5:57 pm

Thanks a lot Jayjay, it's great to know there's more than one way to do things, I'll try your option as well because I really want to learn and for that I will need a lot of practice. Have a great day!
B
5
Posts: 23
Reputation: 821


Return to How do I....?

Who is online

Users browsing this forum: flemmig, Jarnopa, semaso, Skebab and 12 guests

cron