Actor drop like dice
alexxxhp
Member Posts: 161
How can I make an actor act like dice when they are dropped for example board games you roll the dice how can an actor be created to react like dice being dropped any ideas I can't figure it out thanks
Comments
for example tell the game to roll the dice and when it stops what number is there to show it.
more like a button when pressed the dice spin on the screen then when it stops display the number from the set of dice not an actual drop of dice. thanks
so you could use something like:
create an animation of 6 frames, each with a different number of pips, 1 - 6
create an integer attribute in the dice actor called myNumber.
create a boolean attribute in the dice actor called pleaseAnimate.
create a boolean attribute in the dice actor called getMyNumber.
Rule
When pleaseAnimate = TRUE
Animate
Timer
After (some random amount of time)
Change Attribute: pleaseAnimate to FALSE
Change Attribute: getMyNumber to TRUE
Rule
When getMyNumber = TRUE
Rule
When self.Image = "image1.png"
Change Attribute: myNumber to 1
Rule
When self.Image = "image2.png"
Change Attribute: myNumber to 2
Rule
When self.Image = "image3.png"
Change Attribute: myNumber to 3
Rule
When self.Image = "image4.png"
Change Attribute: myNumber to 4
Rule
When self.Image = "image5.png"
Change Attribute: myNumber to 5
Rule
When self.Image = "image6.png"
Change Attribute: myNumber to 6
Does that make sense?
Hope it helps!
Joe