I am trying to use this code to get the velocity, the velocity is use by effect() function. I get the velocity by calculate the position before and after c_move():
Code:
bullet_speed.x = 80 * time_step; // adjust the speed of the bullet here
vec_set(pos1.x, my.x);
c_move(me, bullet_speed, nullvector, IGNORE_YOU|IGNORE_PASSABLE|IGNORE_FLAG2|ACTIVATE_SHOOT);
vec_set(pos2.x, my.x);
vec_sub(pos2.x, pos1.x);
vec_inverse(pos2);
effect(tail,1,my.x,pos2);
I enable beam for the effect(), but the result is very strange, is there anyone can help?