obj_player
create event:
spawn_x=x;//set initial spawn points
spawn_y=y;
step event:
//movement code
if (keyboard_check(ord('A'))) {x-=5;}
if (keyboard_check(ord('D'))) {x+=5;}
if (keyboard_check(ord('W'))) {y-=5;}
if (keyboard_check(ord('S'))) {y+=5;}
if (keyboard_check(ord('T')))//move to last spawn point
{
x=spawn_x;
y=spawn_y;
}
if place_meeting(x,y,obj_spawn_point)//create/update spawn point
{
spawn_x=other.x;
spawn_y=other.y;
}
No comments:
Post a Comment