Drag multiple objects at once
![RodrigoPerez](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
I have a game I'm working on that requires getting a bouncing ball into a goal by rotating platforms to the correct angles. I currently have it set up to where these platforms can rotate by dragging them with a touch, however when I'm rotating one platform and then simultaneously use another finger and try to rotate another platform it doesn't register. Thank you in advance.
Comments
if its your first time messing with multi touch i suggest you take a look at the Joystick control template as a start.
Roy.
Roy.
Change Attribute
self.initRotation : to : self.rotation
Change Attribute
self.initAngle : to : vectorToAngle( game.Mouse.Position.X - self.Position.X , game.Mouse.Position.Y - self.Position.Y )
Constrain Attribute
self.myAngle : to : vectorToAngle( game.Mouse.Position.X - self.Position.X , game.Mouse.Position.Y - self.Position.Y )
Constrain Attribute
self.Rotation : to : self.initRotation +( self.myAngle - self.initAngle )
BUT ! to make the game understand which touch is touching which platform , and what happen if you put 1 finger , then add finger 2 , AND then remove finger 1 ect , you need to add some bit complicated rules ,
so the way i suggest is to create 3 actors , "Touch1", "Touch2", "Touch3" , each one constrain only to its touch.
And in the platforms make a collision rule:
If collide with actor "Touch1"
Change Attribute
self.initRotation : to : self.rotation
Change Attribute
self.initAngle : to : vectorToAngle( game.Actor.Touch1.X - self.Position.X , game.Actor.touch1.Y - self.Position.Y )
Constrain Attribute
self.myAngle : to : vectorToAngle( game.Actor.Touch1.X - self.Position.X , game.Actor.touch1.Y - self.Position.Y )
Constrain Attribute
self.Rotation : to : self.initRotation +( self.myAngle - self.initAngle )
-----------------
If collide with actor "Touch2"
Do the same but with the coordinates of the actor "Touch2"
And so on.
I hope it helps you mate.
Roy.