twinblade-infinity/objects/obj_enemy_beamer/Step_2.gml

31 lines
617 B
Plaintext

step += 1;
speed = 6;
if hp < 1
{
score += 500;
instance_destroy();
}
if (instance_exists( obj_player_control ) ) {
if step > 4
{
if distance_to_object(obj_player_control) < 250
{
step = 0
var ID = instance_create(x,y,obj_enemy_beams);
with (ID) motion_set(other.direction-5+random(10),10);
}
}
if point_direction(x,y,obj_player_control.x,obj_player_control.y) > direction
{
direction += 5;
}
if point_direction(x,y,obj_player_control.x,obj_player_control.y) < direction
{
direction -= 5;
}
}