So how can I normalize a vector like this?
X = (target.x - player.x)
Y = (target.y - player.y)
Develop games in your browser. Powerful, performant & highly capable.
You first find the length and divid both values by it.
(probably a dumb question)
is that the same as
Xnormalised = cos(angle(player.x,player.y,target.x,target.y))
Ynormalised = sin(angle(player.x,player.y,target.x,target.y))
?
(probably a dumb question) is that the same as Xnormalised = cos(angle(player.x,player.y,target.x,target.y)) Ynormalised = sin(angle(player.x,player.y,target.x,target.y)) ?
I think yes, I used that formula to get what I wanted.
Thanks both.