accelerometer and rotation problem

fenix66fenix66 Member Posts: 59
edited November -1 in Working with GS (Mac)
Hi

i need to rotate object around another object so I used the idea from Example Rotations demo but I can't figure how to use accelerometer insted of mouse.
It' something like this

Rotate to position :
x game.mouse.position.x y game.mouse.postiony speed 230

Constrain attribute:
self.position.x to game.centralobject.position.x+cos(self.rotation)*self.size.width/2

Constrain attribute:
self.position.y to game.centralobject.position.y+sin(self.rotation)*self.size.width/2

IS this even possible in this case or the rotation must be done in some other way?
Sign In or Register to comment.