L
Latteid
Guest
Hello, I been trying to make an enemy that follows a pattern, it shoots 3 times, then move a bit, and then back to the beginning. The problem is that I get to the second part of it, but for some weird reason the object doesn't react at all to the alarm that restart everything, the step code is looking like this:
Battle means that his pattern starts, pace is a variable I made to try to organize it and firing is to make it shoot just once (the point of alarm 0 is to make firing false let him shoot again)
He shoot correctly, and the start to move, but it seems like he doesn't do anything with the alarm, so he keeps moving forever. Right now the only thing that the alarm 1 has is the code for destroy instance, so it makes it even more weird.
I hope someone here can help me with this.
Code:
if global.battle = 1
{ if pace < 4
{
if(!firing)
{
instance_create(x,obj_boss.y-32,obj_bullet);
firing=true;
alarm[0]=60;
pace += 1
movespeed = 0;
}
}
}
if pace >= 4
{
movespeed = 2;
alarm[1]=30;
}
He shoot correctly, and the start to move, but it seems like he doesn't do anything with the alarm, so he keeps moving forever. Right now the only thing that the alarm 1 has is the code for destroy instance, so it makes it even more weird.
I hope someone here can help me with this.