spr_player
0
-1
-100
0
<undefined>
<undefined>
1
603
7
0
0
-1
2
self
0
0
1
/// Player creation code.
ship_type = 0;
image_speed = 0;
image_index = ship_type;
is_moving = false;
dead = false;
invuln_counter_max = 1*room_speed;
invuln_counter = invuln_counter_max;
energy_max = 500;
energy = energy_max
hp_max = 100;
hp = hp_max;
1
603
7
0
0
-1
2
self
0
0
1
/// Player per frame
if(dead == true)
{
gravity = 0;
speed = 0;
direction = 0;
return 0;
}
if(hp <= 0 && !dead)
{
speed = 0;
direction = 0;
instance_create(x,y,obj_boom_fx);
sprite_index = spr_boom;
image_speed = 1;
dead = true;
}
direction = image_angle
speed = floor(speed);
if(speed < 0)
{
speed += 1;
}
if(speed > 0)
{
speed -= 1
}
if((energy >= 10 && is_moving && keyboard_check(vk_shift)) || (energy >= 10 && is_moving && gamepad_button_check(0,gp_face3)))
{
if(speed > 30)
{
speed = 30;
}
energy -= 10;
}
else
{
if(speed > 20)
{
speed = 20;
}
}
view_xview[0] = x - view_wview[0]/2;
view_yview[0] = y - view_hview[0]/2;
if(!is_moving)
{
if(energy < energy_max)
{
energy += 5;
}
}
if(invuln_counter == invuln_counter_max)
{
visible = true;;
}
if(invuln_counter != invuln_counter_max)
{
if(invuln_counter % 5 == 0)
{
visible = !visible;
}
invuln_counter ++;
}
1
603
7
0
0
-1
2
self
0
0
1
///pull_towards_black_holes();
pull_towards_black_holes();
1
603
7
0
0
-1
2
self
0
0
1
/// Do Controller Stuff
if(keyboard_check(ord("A")) || gamepad_button_check(0,gp_padl))
{
if(dead == true)
{
return 0;
}
image_angle += 5;
}
if(keyboard_check(ord("D")) || gamepad_button_check(0,gp_padr))
{
if(dead == true)
{
return 0;
}
image_angle -= 5;
}
if(keyboard_check_pressed(ord("W")) || gamepad_button_check_pressed(0,gp_padu))
{
if(dead == true)
{
return 0;
}
is_moving = true;
audio_play_sound(snd_engine,1,true);
image_index = ship_type+1;
}
if(keyboard_check(ord("W")) || gamepad_button_check(0,gp_padu))
{
if(dead == true || speed < 0)
{
return 0;
}
direction = image_angle
speed += 5
}
if(keyboard_check_released(ord("W")) || gamepad_button_check_released(0,gp_padu))
{
if(dead == true)
{
return 0;
}
is_moving = false;
audio_stop_sound(snd_engine)
image_index = ship_type;
}
if((mouse_check_button_pressed(mb_left) && os_type != os_psvita) || gamepad_button_check_pressed(0,gp_shoulderr))
{
if(dead == true)
{
return 0;
}
if(obj_inv_controller.is_open)
{
return 0;
}
if(energy >= 20)
{
var new_bullet = instance_create(x,y,obj_bullet);
audio_play_sound(snd_shoot,2,false);
new_bullet.image_angle = image_angle;
new_bullet.direction = image_angle;
new_bullet.speed = speed + 5;
energy -= 20;
}
}
1
603
7
0
0
-1
2
self
0
0
1
damage_player(5);
instance_create(other.x,other.y,obj_boom_fx);
other.direction = direction;
other.image_angle = image_angle;
other.speed = 20;
speed = -20;
1
603
7
0
0
-1
2
self
0
0
1
damage_player(5);
instance_create(other.x,other.y,obj_boom_fx);
speed = -20;
1
603
7
0
0
-1
2
self
0
0
1
var didAdd = add_item_to_inventory(other.item_id);
if(didAdd)
{
instance_destroy(other);
}
1
603
7
0
0
-1
2
self
0
0
1
damage_player(hp_max);
1
603
7
0
0
-1
2
self
0
0
1
damage_player(5);
instance_create(other.x,other.y,obj_boom_fx);
other.direction = direction;
other.image_angle = image_angle;
other.speed = 20;
speed = -20;
1
603
7
0
0
-1
2
self
0
0
1
/// Show Game over screen
if(dead == false)
{
return 0;
}
visible = false;
obj_controller.visible = false;
image_speed = 0;
instance_create(view_xview[0]+(view_wview[0]/2),view_yview[0]+(view_hview[0]/2),obj_gameover_overlay);
instance_create(view_xview[0]+(view_wview[0]/2),view_yview[0]+(view_hview[0]/2),obj_respawn);
1
603
7
0
0
-1
2
self
0
0
1
if(global.debug)
{
ship_type +=2;
image_index = ship_type;
}
0
0
0
0.5
0.100000001490116
0
0.100000001490116
0.100000001490116
0.200000002980232
-1
0