Login | Register

Object face mouse

July 24, 2006, 23:06 by Calle
[loading]
-->
This is a really simple one; I’ll give you the code which makes your one-sprite, one-subimage object to face the mouse:

image_angle = point_direction(x+sprite_width/2,y+sprite_height/2,
mouse_x,mouse_y);


*** Note that the origin of the sprite has to be set to the origin and that the sprite should originally face right.

Comments

Loading comments... [loading]
.
Users logged in:

game maker articles, game maker examples, game maker tutorials, gmtutorials, game maker questions and answers, game maker crash course, how to create games