On screen buttons, continuously move problem
evilz29
Member Posts: 13
Hello, I want my game to have on screen buttons for movement on the iphone.
I am basically trying to recreate this: http://gamesalad.com/game/play/23210
instead of moving, the actor rotates clock wise or counter clock wise instead.
I seem to be following that game template exactly, but what happens is when i click the Left on screen arrow, it continuously rotates in one direction (instead only moving when holding the button down)
and when I hit the other on screen directional arrow, it stops its movement but it doesn't change directions.
What I have going on:
------------------------------------------------------------------
2 boolean attribute created, rotateleft and rotateright
On left arrow actor
Actor receives event - touch - is pressed
Change attribute: game.rotateleft to true
Change attribute: game rotateright to false
On right arrow actor
Actor receives event - touch - is pressed
Change attribute: game.rotateleft to false
Change attribute: game rotateright to true
On Spaceship
Attribute - game.rotateleft is true
Rotate counter clockwise
Speed: 90
Attribute - game.rotateright is true
Rotate clockwise
Speed: 90
Any help is greatly appreciated
Thanks!
I am basically trying to recreate this: http://gamesalad.com/game/play/23210
instead of moving, the actor rotates clock wise or counter clock wise instead.
I seem to be following that game template exactly, but what happens is when i click the Left on screen arrow, it continuously rotates in one direction (instead only moving when holding the button down)
and when I hit the other on screen directional arrow, it stops its movement but it doesn't change directions.
What I have going on:
------------------------------------------------------------------
2 boolean attribute created, rotateleft and rotateright
On left arrow actor
Actor receives event - touch - is pressed
Change attribute: game.rotateleft to true
Change attribute: game rotateright to false
On right arrow actor
Actor receives event - touch - is pressed
Change attribute: game.rotateleft to false
Change attribute: game rotateright to true
On Spaceship
Attribute - game.rotateleft is true
Rotate counter clockwise
Speed: 90
Attribute - game.rotateright is true
Rotate clockwise
Speed: 90
Any help is greatly appreciated
Thanks!
Comments
Then in each button I have a simple rule - when touch is pressed change attribute button to true otherwise change attribute button to false.
Then in the player (ship) have a rule that says when button is true, accelerate/rotate/etc.
That way when you let go of the button it will stop doing all of the things in the rule because of the otherwise section in the button actor.