how do i display animations randomly and differently?

0 favourites
  • 2 posts
From the Asset Store
4 Block Soldiers with different animations, 400x400
  • i have one sprite with five animation. i want to change the sprite animation every 3 seconds. I has been searching how to make it and i found command "choose". My sprite animation changed every 3 seconds but too often displays the same animation. first shows animation 1 and after the first 3 seconds is still animation 1 and only a few 3 seconds later the animation changes, i dont want this. i want after the first 3 seconds it will change randomly with other animation and will repeat after the next 3 seconds again. I want after the first 3 seconds it will change randomly with other animation and animation before will repeat after the next 3 seconds again. eg: animation 1 to animation 3 to animation 1 to aninmation 2 etc...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Quite an easy fix:

    + System: Every 3 seconds

    -> Sprite: Set animation frame to Self.AnimationFrame+choose(-3,-2,-1,1,2,3)

    You can change the range to be as big as you need, don't use random as that will include 0, though in fairness, you could use a sub event in that case.

    You'll also want to clamp the above, otherwise you could end up with minus number frames

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