Behavior Help
craps
Member Posts: 353
I have actor A:
Rule:
touch.inside
change attribute - game.rollTheDice TO: True
Actor B:
Rule:
attribute - game.rollTheDice IS True
animate (png's)
The two above rules work as outlined. You touch the Roll The Dice actor and the animation plays in the other actor.
The problem is that this will only happens ONE time. It needs to happen each and every time Roll The Dice actor is touched.
I do not have a "change the attribute" back to false any where else so the game.rollTheDice should always be True.
Thoughts
Rule:
touch.inside
change attribute - game.rollTheDice TO: True
Actor B:
Rule:
attribute - game.rollTheDice IS True
animate (png's)
The two above rules work as outlined. You touch the Roll The Dice actor and the animation plays in the other actor.
The problem is that this will only happens ONE time. It needs to happen each and every time Roll The Dice actor is touched.
I do not have a "change the attribute" back to false any where else so the game.rollTheDice should always be True.
Thoughts
Comments
after 3 seconds or how ever you want your dice to move
set game.rollTheDice to false
should work
Didn't get the last line : I do not have a "change the attribute" back to false any where else so the game.rollTheDice should always be True.
So I don't know if this will help (since you would have to put it back to false) :P
But still no luck - a one time roll only. (The reason the destroy actor is there is to show what is underneath the animation.)
I did not change the game.rollTheDice back to false because I thought if its always true it would be ready to go. Guess not.
http://i52.tinypic.com/ngp011.png
The above should work.
If that's the case, then of course nothing happens, cause there is not that actor anymore. Just don't put any dice in the scene, than, in actor A, where you say change attribute to true, make it so that it spawn a dice too.
Or else do not destroy the dice. Make after 2 second self.alpha = 0. If attribute = true then alpha 1, animation, after 2 seconds first set attribute to false then self.alpha = 0.
in your timer do a change image back to the original image so your actor is there for additional rolls. I would also change back to false otherwise the roll will not ever stop animating. put the change attribute in the timer also. try that. There is also a way you use otherwise to stop the roll also but see if this works for now
Think of a slot machine - I have two random animated dice rolling then they are destroyed and the random dice outcome roll shows up (from underneath the animation).
This way it looks like the dice are rolling and stopping and the stopped dice faces are truly the random dice outcome.
Hope this makes sense.
Actor A
Rule - Touch
Actor A - game.betOn5 = true
(some other behaviors that work go here)
Rule
All game.betOn10 (betOn50, betOn100 etc) = true
Change Att - self.image.alpha =.5
Rule
All game.rollTheDice = false
Change Att - self.image.alpha = 1
So when one of the actors are touched - the other actors go alpha = .5
and the actor touched stay at it self.
Then after game.rollTheDice = false all the actors should go back to game.image.alpha = 1.
It works one time. But not on the repeat.
Yes after the rolling of the dice the game.rollTheDice does get changed back to roll the dice false.
Like the problem in the first portion of this post - tried to correct it the same way - but wont work. WOW
Thanks
if mouse is down then -> if touch is outside then -> self.alpha = 0.5 otherwise -> self.alpha = 1.