【GameMaker】 Distance from Object to Mouse

Information about object: obj_distance Sprite: spr_distance Solid: false Visible: true Depth: 0 Persistent: false Parent: Children: Mask: No Physics Object Create Event: execute code: //set variables: dist=0; dir=0; Step Event: execute code: dist=distance_to_point(mouse_x,mouse_y);//store distance in variable angle=point_direction(x,y,mouse_x,mouse_y);//store the angle Draw GUI Event: execute code: draw_set_alpha(0.5); draw_self(); draw_set_alpha(1); //draw variables draw_text(x,y-40,"Distance "+string(dist)); draw_text(x,y-60,"Direction "+string(angle));

No comments:

Renowned Water Expert Reynold Aquino Offers Exclusive Water Softener Discounts

Los Angeles, California - November 21, 2024 - World-renowned water expert Reynold Aquino is excited to announce exclusive discounts on prem...

Contact Form

Name

Email *

Message *