Need help with rotating around an actor [VIDEO INCLUDED]

NtGNtG Member Posts: 103
edited November -1 in Working with GS (Mac)
Hey, im having this problem with rotating my actor around another actor (if you saw my thread, you are already aware that im trying to get sort of a swinging motion) :



I have it so if i press "right" it should rotate counter clockwise, and left rotates clockwise, however, imagine the center of the brick is the origin of a graph, when rotating left it slows down in the 2nd and 4th quandrants, and going right slows down in the 1st and 3rd. I turned gravity off and all that other stuff, I cant figure out whats wrong. Any help?

here's the code i have to keep the actor in constrained to a circle around the brick, and also the object movement:

(keep in circle):
Constrain self.position.Y to "game.Post Y + self.radius *sin(vectorToAngle( self.Position.X - game.Post X , self.Position.Y - game.Post Y ))"

Constrain self.position.X to "game.Post X + self.radius *cos(vectorToAngle( self.Position.X - game.Post X , self.Position.Y - game.Post Y ))"

(to keep the actor pointed towards the brick):
Constrain self.Rotation to self.angle-90

(movement)
if key left is pressed:
accelerate to 134° relative to actor

if key right is pressed:
accelerate to 45° relative to actor

i've noticed that putting the left and right movement at 135 and 45, respectively, makes the movement a little bit smoother than 0° and 180°.

Sorry for reposting the topic, i realized that the "game design" section isnt very active. If I can get this problem fixed, then all of the programming of my game will be pretty much done. It will be all graphics and level design from here on out.
Sign In or Register to comment.