K
kiodoko
Guest
Hi I'm new. I am creating my first game with the newest game maker program. I cannot for the life of me get one object to move towards another. This should sound really simple, but for some reason it won't work no matter what I try. I'm creating a real time strategy game and I'm trying to get a soldier to move to a way point. What I'm trying to do is: make a soldier_object and make an event that activates when the enter button is pressed. Then inside the event, I use the set point direction drag and drop command to try and get the soldier to move towards the way point. I even tried using the game maker language code approach and used four commands and none of them worked.
such as:
move_towards_point( way_point_object.x, way_point_object.y, 4 );
that:
direction = point_direction(x,y,way_point_object.x,way_point_object.y);
that:
if instance_exists(obj_player)
{
move_towards_point( way_point_object.x, way_point_object.y, 4 );
}
else instance_destroy();
and that:
if instance_exists(way_point_object)
{
var dir = point_direction(x, y, way_point_object.x, way_point_object.y);
{
speed = 4;
direction = dir;
Please help this is really giving me the blues.
such as:
move_towards_point( way_point_object.x, way_point_object.y, 4 );
that:
direction = point_direction(x,y,way_point_object.x,way_point_object.y);
that:
if instance_exists(obj_player)
{
move_towards_point( way_point_object.x, way_point_object.y, 4 );
}
else instance_destroy();
and that:
if instance_exists(way_point_object)
{
var dir = point_direction(x, y, way_point_object.x, way_point_object.y);
{
speed = 4;
direction = dir;
Please help this is really giving me the blues.
Attachments
-
65.3 KB Views: 4