Actor drop like dice

alexxxhpalexxxhp Member Posts: 161
edited November -1 in Tech Support
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

  • alexxxhpalexxxhp Member Posts: 161
    thats what I am trying to figure out what would be the attributes to appear and random spin or show the numbers rolled on the dice I am a bit confused on doing this feature.
    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
  • firemaplegamesfiremaplegames Member Posts: 3,211
    you do have access to the name of the current image of an Actor...

    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
  • alexxxhpalexxxhp Member Posts: 161
    cool that worked how can an actor moved to the value of that dice I have tried different things but can't figure that out I want the actor to moved to the value of the roll
Sign In or Register to comment.