【GameMaker】 Gradually rotating an object towards a target

Information about object: obj_projectile
Sprite: spr_projectile
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Step Event:
execute code:

var dir = point_direction(x, y, mouse_x, mouse_y);
var angle = angle_difference(image_angle, dir);
if abs(angle)<=25
{
image_angle -= angle;
}
Draw Event:
execute code:

draw_self();
draw_text(x-100,y,image_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 *