A velocity encompasses both speed and direction in a single vector. I'm a little bit confused about how to separate the two.
I have 2 creatures. The first is located at position (x1, y1). The second is located at (x2, y2).
I would like the first creature to move towards the second creature, so I get the vector from creature1 to creature2 as so:
velocity = (x2 - x1, y2 - y1)
Then I normalize the vector using the distance between the 2 points like so:
velocity.x = velocity.x / distance; velocity.y = velocity.y / distance;
If I use this as my velocity, the creature will move in the correct direction but it will be moving too fast. How can I control the speed of the creature without changing the direction? I would like for creature1 to move in the direction of creature2 at a constant speed which I choose.