E
EvansBlack
Guest
So here is my code:
It is in create event of a projectile. But this projectile when shooted have a VERY high speed and wrong angle. When i move my mouse to the left top corner (0, 0) the projectiles starts to slow down. It's like Game Maker ignores all my "phy_position_x" and "phy_position_y" and sets them to zero. Pls help!
Code:
var ximpulse, yimpulse;
ximpulse = lengthdir_x(0.1,point_direction(phy_position_x,phy_position_y,mouse_x,mouse_y));
yimpulse = lengthdir_y(0.1,point_direction(phy_position_x,phy_position_y,mouse_x,mouse_y));
physics_apply_impulse(phy_position_x,phy_position_y,phy_position_x+ximpulse,phy_position_y+yimpulse);