help with touches move
iLITE
Member Posts: 18
i a noob, i try to make a actor moves with touch, but the actor move only the same position, i need to move a actor in a line, like a pong, but using touch movement.
i try to find a template,but i not found.
sorry , i dont speak inglish e the google tradutor is my god.
Thanks!
i try to find a template,but i not found.
sorry , i dont speak inglish e the google tradutor is my god.
Thanks!
Comments
Hope I can help!
Create a rule
-if actor receives event - touch - pressed
-- change attribute self.isTouched to true
OTHERWISE
-- change attribute self.isTouched to false
Create a Timer: every - 0
Create a rule INSIDE that timer
- if self.isTouched is True & if game.Touches > 0
--change attribute: self.Position.X = game.Touches.Touch 1.X
hope this helps!
EDIT: due to scitune's post, used the otherwise function to allow for only 1 rule. Kudos scitunes!
constrain self.positionY to where ever you want the pong actor to be positioned
if touch is pressed change self.isTouched to true
OTHERWISE change self.isTouched to False
Rule when self.isTouched is true
constrain self.position.X to game.touch1.x
i put colide with walls, and the actor, make a weird loop