Assign random animations to collided objects?
Botha
Member Posts: 8
So I'm working on a breakout type game and I want my actors (which are characters instead of bricks) to react a little differently each time they collide with the ball. I have already made several different animations for each character but I'm not sure how to set up the rules to make this work correctly in the game. If anyone can help I'd appreciate it! I'm assuming has something to do with change image and using a random setting but I'm not sure how set it up with the expression editor!
Comments
Then, when the actor's hit (overlaps or collides with ball, I'd imagine) put in:
Timer:
after .1 seconds
Rule:
Change attribute self.RandAnim to Random (1,5) (the five can be replaced with the number of variations you have).
Then put in your rules for animations:
If self.RandAnim = 1
Play animation 1
If self.RandAnim = 2
Play animation 2
And so on
That should give you a good start. Hope it helps!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io