C
ChaosX2
Guest
Hello,
I'm having trouble setting up the pursuit steering behavior to fit my situation. I need to know my players velocity and the player is controlled via arrow keys and I'm not sure how to calculate the player's velocity since I'm not using a steering behavior to propel it in any way. I tried something along the lines of...
I also thought about using the formula of change in position / time, but I'm not sure how to do that or if it's even the right approach :x Can someone enlighten me?
I'm having trouble setting up the pursuit steering behavior to fit my situation. I need to know my players velocity and the player is controlled via arrow keys and I'm not sure how to calculate the player's velocity since I'm not using a steering behavior to propel it in any way. I tried something along the lines of...
Code:
steering = scr_vect2(0,0);
steering = scr_vect_add(steering, scr_vect2(x,y));
velocity = scr_vect_add(velocity, scr_vect_subtract(position, steering));
position = scr_vect_add(position, velocity);