simple rule not working
UtopianGames
Member Posts: 5,692
Trying to move a paddle (breakout style) left and right using 2 arrow actors but its not working.
2 boolean move left and move right
2 actors arrow left and right
1 paddle (breakout style)
Left actor...touch is pressed move left is true
Right actor if touch is pressed move right is true
2 rules for paddle one for left and other for right...if move left is true change velocity 180 speed 300 and visa versa for rule 2 if move right is true change velocity 0 speed 300.
Only the left actor works......any idea why?
Darren.
2 boolean move left and move right
2 actors arrow left and right
1 paddle (breakout style)
Left actor...touch is pressed move left is true
Right actor if touch is pressed move right is true
2 rules for paddle one for left and other for right...if move left is true change velocity 180 speed 300 and visa versa for rule 2 if move right is true change velocity 0 speed 300.
Only the left actor works......any idea why?
Darren.
Comments
Do you have rules that states 'when touch pressed change to true' otherwise 'change attribute to false'?
You could always make a new actor that displays text for the two attributes, that way you can see when you touch the arrows is it actually triggering the change of attribute, equally when you release does it change back to false. This will allow you to figure out if its a problem with the switch or the actual actor itself
And i did a text so i know touch is being activated when i press my arrows its just not moving my bat right when its true.
So it's a problem with my bat actor not knowing if right is active but funny how left is ok?
Darren.
It doesn't like 2 seperate rules it seems....although not sure why.
Darren.
Stacking rules in otherwise sections can be good practices anyways. "Nesting" (as it's called) can really help with performance depending on the behaviors. It allows less variables to have to run at a time when not needed and can give back some computing power to other parts of the game
Although in many experiences I noticed it makes very little difference, there are some cases where you may have many rules that can be nested onto a single behavior, and you can gain some FPS back with it.