simple rule not working

UtopianGamesUtopianGames Member Posts: 5,692
edited November -1 in Working with GS (Mac)
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.

Comments

  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Hi Darren

    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
  • UtopianGamesUtopianGames Member Posts: 5,692
    Yeah i have the otherwise false in already.

    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.
  • UtopianGamesUtopianGames Member Posts: 5,692
    Got it working by making another rule in the bat actors "otherwise" if move right is true move 0 speed 300.

    It doesn't like 2 seperate rules it seems....although not sure why.

    Darren.
  • JonTiStudiosJonTiStudios Member Posts: 66
    Glad to see you got it working.

    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.
Sign In or Register to comment.