twinblade-infinity/objects/obj_enemy_mother/Step_2.gml

40 lines
740 B
Plaintext
Raw Permalink Normal View History

if (instance_exists( obj_player_control ) ) {
if distance_to_object(obj_player_control) < 350
{
final += 1
if final = 2
{
var ID = instance_create(x,y,obj_enemy_beams)
with (ID) motion_set(other.direction-10+random(20),10)
final = 0
}
}
if point_direction(x,y,obj_player_control.x,obj_player_control.y) > direction
{
direction += 4
}
if point_direction(x,y,obj_player_control.x,obj_player_control.y) < direction
{
direction -= 4
}
}
speed = 5
direction = direction
if hp < 1
{
score += 10000;
instance_destroy();
}
shield += 1
if shield >= 450
{
shielded = 1
}
if shield >= 600
{
shielded = 0
shield = 0
}