Pages

Tuesday, December 01, 2009

Homing missiles

I've now moved onto homing missiles. Once activated they simply 'home' in onto the mouse pointer. This was created for test purposes, but it might be the case that it stays in the game. I like the idea of a laser guided missile, allowing the player to guide the missile with the mouse pointer. Might be fun, if a little difficult to control.



I set the direction of the missile using the following code. It's crude but it works.

if instance_exists(mouse_pointer)
{
dir = point_direction(x,y,(instance_nearest(x,y,mouse_pointer)).x, (instance_nearest(x,y,mouse_pointer).y)-20)
}

1 comment:

Unknown said...

Looks fun. Might be good idea it's a little hard to control, since it's potentially an overpowering weapon.

Also, I believe the word is "honing"