views:

134

answers:

1

Hello, I have a velocity vector that is V(233, 188).

It makes an object moves toward the right-bottom side of the screen in 300 pixels per second when the origin is V(0, 0).

When the position of the object is, for instance, (592, 334), I set the velocity vector to V(294, 55) but the object does not start moving toward that direction... It keeps moving the same direction, but it seems that it makes a small curve of 10 degrees...

What I'm doing is:

objectLocation += velocity * elapsedTime;

What am I doing wrong?

+1  A: 

The difference between (233,188) and (294,55) is not that much, in the grand scheme of things. To verify your code is working, try a vector such as (200,-200). That will cause it to actually bounce off the point in the y-direction.

If that code works, then it's just your values that aren't working.

Andrei Krotkov