Upgrade screwed up with some levels of my game
I think I found the problem but I don't know how to solve it.
If I create 2 actor (ball and wall) and an attribute, then I create a rule, in the wall, like this:
if wall collides with ball [
if (attribute = 1)[
attribute=attribute+1
]else[
reset scene
]
]
In the previous version I used a code similar when I wanted that the ball collides with some walls in a determinate order, but now every time that the ball collides with the wall both commands are executes (the attribute+1 and the reset scene).
Someone has a way to solve this problem?
If I create 2 actor (ball and wall) and an attribute, then I create a rule, in the wall, like this:
if wall collides with ball [
if (attribute = 1)[
attribute=attribute+1
]else[
reset scene
]
]
In the previous version I used a code similar when I wanted that the ball collides with some walls in a determinate order, but now every time that the ball collides with the wall both commands are executes (the attribute+1 and the reset scene).
Someone has a way to solve this problem?
Comments
What you would want to do is only run the inner rule once and put a delay of when to change the attribute so it doesn't activate the Otherwise right away.
It may work if you try putting a timer around the inner rule (For .01 seconds or some other short amount of time. And put a timer around the Change Attribute (run to completion after .02 seconds) so the attribute is changed but after that inner rule is turned off so the Otherwise doesn't get activated.
There may be other ways, but that would probably include more rules and attributes to help manage when a rule is active.
Today is not my day, I don't know how I don't remembered this such simple way to to get arround the problem.
Thank you.