Random animation

0 favourites
  • 4 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • 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.

  • Go it guys, thanks to Weishaupt and this wonderful tutorial: construct.net/en

    Thanks a lot!!! Problem successfully solved!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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 <img src="smileys/smiley1.gif" border="0" align="middle" />

  • 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! <img src="smileys/smiley20.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)