Move actor with touch and then at certain location do something
Stormtrix
Member Posts: 256
Hey all,
been awhile since i've been on here but back to working on one of my projects,
basically a shapes game.. move the green square to the grey square location for a match.
I'm trying to just move an actor with touch and when I move that actor to a certain spot
on the screen then play a sound or something.
I've got the move on touch down with just -
Actor receives touch - constrain self.position.x to game.touches.touch 1.x
- constrain self.position.y to game.touches.touch 1.y
i was thinking if i then put a rule in like -
attribute - self.position.x = 400
attribute - self.position.y = 400
then -
play sound
thinking if i move the actor to position 400,400 on the screen that would work..
uh.. doesn't work.
also, if wouldn't mind adding if the actor is moved to that location then lock it there.
thanks,
storm
been awhile since i've been on here but back to working on one of my projects,
basically a shapes game.. move the green square to the grey square location for a match.
I'm trying to just move an actor with touch and when I move that actor to a certain spot
on the screen then play a sound or something.
I've got the move on touch down with just -
Actor receives touch - constrain self.position.x to game.touches.touch 1.x
- constrain self.position.y to game.touches.touch 1.y
i was thinking if i then put a rule in like -
attribute - self.position.x = 400
attribute - self.position.y = 400
then -
play sound
thinking if i move the actor to position 400,400 on the screen that would work..
uh.. doesn't work.
also, if wouldn't mind adding if the actor is moved to that location then lock it there.
thanks,
storm