Im making a simple computerplayer to my simple 2d action game. it suppose to turn towards me and shoot, but i cant figure out how to calc the shortest path… should it turn left of right if it want to shoot and kill me 😛 ?
Ive got two angles: cpu_facing (direction the cpu is facing) and player_degree (the angle calculated when cpu is in the center).
(im working with degrees, dont like radian :P)
Anyone done this in javascript?
false: turn in the negative directiontrue: turn in the positive direction