Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. ///@description apply knockback based on direction from explosion point
  2. ///@param knockbackForce
  3.  
  4. var _knockbackForce = argument[0];
  5. var _forceDir = point_direction(other.x, other.y, x,y);
  6. var _forceX = lengthdir_x(_knockbackForce, _forceDir);
  7. var _forceY = lengthdir_y(_knockbackForce, _forceDir);
  8.  
  9. other.currVelocity[XVELOCITY] += _forceX;
  10. other.currVelocity[YVELOCITY] +=_forceY;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement