Direction and speed control for effect sprites on a screen

Tull

New member
Joined
Apr 14, 2017
Messages
5
Hi there.

I'm soon starting a project where I need to describe the path of an object using 2d vectors. The object can change direction by altering the 'angle' of the vector, the vector will be rotated by x.x radians. The object will be able to tighten it's angle of turn by increasing the value with which the vector is rotated.

That bit I'm fine with. However, I need to change the length of the speed vector as the object is 'turning'. The tighter the turn the slower the object will need to be. Imagine a car travelling a straight line, then entering a corner, the car needs to slow depending on the tightness of the turn.

I'm not working with a car, that's just an easy analogy. It's actually effect sprites on screen, so I don't need to worry about friction or any surface conditions.

I can fudge the speed decrease when turning, but I'd sooner find a tidy equation that will suit.

So I'll have a position vector, a velocity vector, a variable rotation number, and hopefully a calculated value for decreasing the velocity depending upon the rotation.

Any ideas?

Thanks.
 
I would try this: as rotation speed goes from 0 to max linearly reduce the speed vector length from 'normal' to min.
 
Top