Re: Game Maker Questions Topic!!!
@alucard
- Code: Select all
move_towards_point(playername.x,y,speedhere)
move_towards_point(playername.x,y,speedhere)jellonator wrote:@alucard
- Code: Select all
move_towards_point(playername.x,y,speedhere)
{
instance_deactivate_all(true);
instance_create(pausebutton1,x,y)
instance_create(pausebutton2,x,y)
instance_activate_object(pausebutton1);
instance_activate_object(pausebutton2);
}instance_activate_all;Koopa Parayoshi wrote:How to make enemies chase player in a maze game
Put the Move Towards or whatever its called, its the 3rd move action in the moves section, put it in the Step event and type obj_player.x and obj_player.y
{
{
if otherobject.x > x
x += speedhere
}
{
if otherobject.x < x
x -= speedhere
}
}
// this code is more for platformers.
//swap out x with y for y position btw.
dir = point_direction(x,y,otherobject.x,otherobject.y)
x += lengthdir_x(speedhere,dir)
// with y position, change the above line with this; y += lengthdir_y(speedhere,dir)
// this also slows down as the object draws closer, but speeds up when its farther away in some cases.
//very good for pong games.