【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:

When Bad People Make Good Art

I offer six guidelines on cancel culture ͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏...

Contact Form

Name

Email *

Message *