Vector math problem

BlitzMax Forums/BlitzMax Programming/Vector math problem

After you said that I first thougth that was the solution. But how do I calculate this dragForce?

if Speed.Length() > MaxSpeed
DragForce.SetDir(Dir+180)
DragForce.SetLength(EngineForce)'
endif

This would result in that the engine force gives no effect to the tanks movement if it goes faster than MaxSpeed.

I have to somehow calculate the speed in the direction of the tank. If tank is thrown to the side by a force which accelerates the tank to 200pix/sec to left (seen from the tank itself). If then the MaxSpeed is 50pix/sec the tank should still be able to continue forward at this speed while it is pushed to the left at 200pix/sec resulting in a mix of the two. This works until I reach the maxspeed, whereas the tank just get's pushed away until the friction from the ground makes it go slower than maxspeed. I need a way of keeping track of the speed forward, or the speed that originates from the engineforce. So that I can cap that speed and not just see to the total.