so_many_mars/objects/oEnemy/Alarm_0.gml

23 lines
474 B
Plaintext
Raw Normal View History

2022-02-21 23:45:19 +00:00
var move_speed = random_range(0.75, 1.1);
if instance_exists(oPlayer) {
move_towards_point(oPlayer.x, oPlayer.y, move_speed);
}
if place_meeting(x,y,oEnemy) {
with instance_place(x,y,oEnemy) {
move_towards_point(other.x,other.y,-move_speed);
}
}
if place_meeting(x,y, oPlayer){
move_towards_point(oPlayer.x,oPlayer.y,-move_speed);
}
if(direction > 90 && direction < 270) {
image_xscale = -1;
} else {
image_xscale = 1;
}
alarm[0] = step_speed;