Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //draw laser
- if instance_exists(target)
- {
- if distance_to_object(target)<targetDist
- {
- var distX,distY,EnemyDist;
- distX=lengthdir_x(laserDist,point_direction(x,y,oEnemyParent.x,oEnemyParent.y))
- distY=lengthdir_y(laserDist,point_direction(x,y,oEnemyParent.x,oEnemyParent.y))
- enemyDist=point_distance(x,y,oEnemyParent.x,oEnemyParent.y);
- if laserDist<=enemyDist
- laserDist+=1;
- draw_set_color(green);
- draw_line_width(x,y-16,x+distX,y+distY,1)
- }
- else
- laserDist=0;
- }
Add Comment
Please, Sign In to add comment