How do I show four of the same objects, different animation?

0 favourites
  • 4 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • I am close, I think, but I just can't figure this out.

    I have four of the same "ColorBar" objects on the screen. This object has four animation frames.

    I want each "ColorBar" object to show a different animation frame.

    Thank you!

    My incorrect code:

    [attachment=0:xdr2eqqa][/attachment:xdr2eqqa]

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi, see if this helps.

  • Hi, see if this helps.

    Hi, codah. Your example worked perfectly. I didn't know how to make an array like this. Thank you for taking the time to do this.

  • No problem. You wanted to select a different 'non repeating' random number for the animation frame whereas your code was just choosing from 0-3 each time and so could repeat. With mine you have a list of numbers that it chooses randomly from, and that chosen number then gets removed from the pool of available numbers for next time. Not sure what the While loop was for in your code, and choosing numbers twice... so I didn't go into that much The other thing is you can just set animation speed to 0 so you don't have to 'stop animation'.

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