Niels
Member
Hi everyone,
I followed heartbeasts top down space shooter udemy course, and i'm expanding the game with boss fights and extra powerups.
Right now I have a bossfight object that spawns when you reached a certain score.
the bossenemy (see attached image) is suposed to fire lasers at random from his "stalks"...
I know it has to be done with the choose or random_range command, but I have no idea how to put it in GML
right now I tried this code but it will crash my game:
It's probably a easy thing to code, but i haven't found it yet
thanks in advance.
-Niels
I followed heartbeasts top down space shooter udemy course, and i'm expanding the game with boss fights and extra powerups.
Right now I have a bossfight object that spawns when you reached a certain score.
the bossenemy (see attached image) is suposed to fire lasers at random from his "stalks"...
I know it has to be done with the choose or random_range command, but I have no idea how to put it in GML
right now I tried this code but it will crash my game:
Code:
///fire laser
random_range(shoot1,shoot3);
if shoot1
{
instance_create (x-14,y+8,obj_laser_enemy);
}
if shoot2
{
instance_create (x,y+8,obj_laser_enemy);
}
if shoot3
{
instance_create (x+16,y+8,obj_laser_enemy);
}
alarm[LASERALARM] = room_speed;
thanks in advance.
-Niels
Attachments
-
554 bytes Views: 4