Touch 1 - Move Actor 1 Touch 2 - Move Actor 2
![TheBoss_123](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hey Forum,
Needed a little bit of help. cant seem to get this to work.
If I touch the screen - Actor 1 moves to my finger
If i touch the screen again - Actor 2 moves to my finger
Again - Actor 1 moves to my finger
Again - Actor 2 moves to my finger
ect
ect
Cheers
TheBoss_123
Needed a little bit of help. cant seem to get this to work.
If I touch the screen - Actor 1 moves to my finger
If i touch the screen again - Actor 2 moves to my finger
Again - Actor 1 moves to my finger
Again - Actor 2 moves to my finger
ect
ect
Cheers
TheBoss_123
Comments
have this rule
when touch is pressed change game.actorNumber to (game.actornumber+1)%2
Then have a rule when touch is pressed
-----when game.actornumber=0
---------move rules for actor 1
-----OTHERWISE
---------move rules for actor 2
Only works once,
I have 2 Buttons on the Hud - One red - One blue
Press the red one and wherever i press next Actor 1 moves to the touch
Press the blue one and wherever i press next Actor 2 moves to the touch.
What I have so far.
Inside Red Button
When red button is pressed inside
change att game.touch = 1
In Actor 1
Attrib game.touch = 1
slf.pos.x to mouse.pos.x
slf.pos.y to mouse.pos.y
However this does not let me place it but rather places Actor 1 where the red button is, however i want it to be placed where i press the second time. And also the game is scrollable so I need the actors to move porperly even when i have scrolled
Cheers
TheBoss_123
first - your gameplay seems a bit simple that it doesnt required S&D (spawn & destroy). You just need to place it outside of the scene which is way easier.
second - dont place the control on the buttons. Just use the buttons to change an attribute and let the actor react to it.
ex: game.ActorID
BUTTONS
if red is pressed
game.ActorID = 1
if Blue is pressed
game.ActorID = 2
ACTOR1
if game.ActorID = 1
move me to happy place
otherwise
Hide me
ACTOR2
if game.ActorID = 2
move me also to happy place
otherwise
Hide me
so this part
move me to happy place
doesnt seem to work...edited previous post to see what i did
Actor.
First make an invisible actor and fill out the whole scene except your hud. Unlock this one and place a rule inside.
RULE
if this s pressed
Change attribute game.MoveAnActor = TRUE
change attribute game.touchX = mouse.position.X
change attribute game.touchY = mouse.position.Y
if release
Change attribute game.MoveAnActor = FALSE
ACTOR1
if game.ActorID = 1 && MoveAnActor = TRUE
move me to happy place (using touchX & touchY)
otherwise
Hide me
Created another actor which controls where to place it