Guest User

Untitled

a guest
Aug 17th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. //draw laser
  2. if instance_exists(target)
  3. {
  4. if distance_to_object(target)<targetDist
  5. {
  6. var distX,distY,EnemyDist;
  7. distX=lengthdir_x(laserDist,point_direction(x,y,oEnemyParent.x,oEnemyParent.y))
  8. distY=lengthdir_y(laserDist,point_direction(x,y,oEnemyParent.x,oEnemyParent.y))
  9. enemyDist=point_distance(x,y,oEnemyParent.x,oEnemyParent.y);
  10.  
  11. if laserDist<=enemyDist
  12. laserDist+=1;
  13.  
  14. draw_set_color(green);
  15. draw_line_width(x,y-16,x+distX,y+distY,1)
  16. }
  17. else
  18. laserDist=0;
  19. }
Add Comment
Please, Sign In to add comment