Rotate & Move

aalzankiaalzanki Member Posts: 283
edited November -1 in Working with GS (Mac)
Hello,
Guys I used this example to rotate an actor with spinning it :

Create two integer game attributes spinX and spinY

Create an invisible actor with rule:

when touch is pressed
constrain self.positionY to touchY
constrain self.positionX to touchX

constrain game.spinY to self.positionY
constrain game.spinX to self.positionX

In the spinning objecting:

When touch is pressed and inside
constrain self.rotation to VectorToAngle(self.positionX-game.spinX, self.position.Y-game.spinY)

So i want when the actor rotates at a high speed the other actor move at a high speed and when it rotates at a low speed the other actor move at a low speed, how?

Regards,

Comments

  • POMPOM Member Posts: 2,599
    not shure if that helps but, if u want to spin an actor with your finger just do:

    rule - when touch is preesed and inside
    rotate to position:
    touchX touchY offset- depanding on your actor's angle
    relative to scene
    and uncheck "run to completion" and "stops on destination"
Sign In or Register to comment.