Problem with buttons
Abrigaito
Member Posts: 44
I need help with this, I really don't know what I'm doing wrong. So there is the actor in the center then a right and left button. When I press the right button the actor moves but it doesn't stop and then the button can't be pressed again, same for the left button.
I want to press the button so the actor move one step then stop then do it again and again.
Here is the template:
http://gamesalad.com/game/play/89024
I want to press the button so the actor move one step then stop then do it again and again.
Here is the template:
http://gamesalad.com/game/play/89024
Comments
Hope that helps.
http://gamesalad.com/game/play/85953
I followed that template, but it doesn't work the same and it doesn't matter if I use accelerate, move or move to it always do the same thing.
Created two boolean game attributes Left and Right
Player.....
Attribute - game.right is true
Move right
Speed 50
Attribute - game.left is true
Move left
Speed 50
Right button.....
actor receives event touch is pressed
change attribute game.right to... true
Left button......
actor receives event touch is pressed
change attribute game.left to... true
In your right and left buttons, put an otherwise statement in each
Right: Otherwise, change attribute game.right to false
Left: Otherwise, change attribute game.left to false
Whenever you use a template as a guide or to copy and paste from be sure to ALWAYS check the otherwise sections. They really ought to make a little icon that appears when the otherwise is used because it is so easy to forget to look there!