GameSalad

Make a ship turn in a cirkel - Help

Toke+TToke T Posts: 22Member, PRO

Hello.
Hope someone can help with this. I have a ship that follows a push on a touch-screen. The code i use now make it change direction instantly. I would like it to turn like a ship would do.
The code i use now:

constrain.
self.Rotation To: vectorToAngle( self.Motion.Linear Velocity.X , self.Motion.Linear Velocity.Y )

constrain.
self.Motion-Linear Velocity.X To: game.Touches.Touch 1.X - self.Position.X

constrain.
self.Motion-Linear Velocity.Y To: game.Touches.Touch 1.Y - self.Position.Y

Thanks

Comments

  • imjustmikeimjustmike Posts: 450Member, BASIC

    I'm not 100% sure what you mean. Are you saying that when you move your finger don't want the ship to actually go to it's new location, but follow the path your finger traced? There are plenty of follow path tutorials on the forums for that, just do a quick search :)

    Here's one:

    Or are you saying that you simply want a delay on the ship? If that's the case, you could use a move to behaviour instead of constrains. Demo attached.

  • SocksSocks London, UK.Posts: 12,711Member, PRO
    edited June 14

    Here's one approach . . . (file attached)

  • Toke+TToke T Posts: 22Member, PRO

    @Socks
    Wow! Thanks a lot mate. That was exactly what I was looking for :-)

  • Toke+TToke T Posts: 22Member, PRO

    @imjustmike
    Also thanks to you. Good ideas on another direction.

Sign In or Register to comment.