if !revive
{
	x = obj_player.x + 10;
	y = obj_player.y + 10;
	depth = obj_player.depth + 1;
	image_angle = obj_player.image_angle;
}
else if (--timer)
{
	global.pts = 0;
	if keyboard_check(ord("W"))
		y -= 7;
	if keyboard_check(ord("S"))
		y += 7;
	if keyboard_check(ord("A"))
		x -= 7;
	if keyboard_check(ord("D"))
		x += 7;
	image_angle = point_direction(x, y, mouse_x, mouse_y);
	if !(timer % 12)
	{
		var inst = instance_create_layer(x, y, "Instances", obj_trace_p);
		inst.image_angle = image_angle;
	}
}
else
{
	revive = false;
	timer = 300;
	instance_create_layer(x, y, "Instances", obj_player);
}

if keyboard_check(vk_escape)
{
	global.rooom = "title";
	instance_create_depth(0, 0, -100, obj_fade);
}