McJazzhands
Member
Heya folks! I'm back with a question relating to Gradius once again. This time around, I'm trying to recreate the bean enemies you see when you start the game, shown below:
What I'm aiming for is a group of identical enemies (A) that drop a powerup capsule for the player when the whole group is destroyed. If even one of them makes it offscreen (B), the player doesn't get a capsule from that group. How would I go about doing this in GameMaker? Right now I have it tied to a global variable that increments when one of the enemies is destroyed and resets to zero when one of them gets away, but it doesn't work as cleanly as I want it to. Like if one gets offscreen and the player destroys some of the beans behind that one, the relevant variable won't reset to zero and ends up dropping a powerup in the middle of a subsequent group.
Here's what I've got written out thus far:
I'm at a loss for how to get this working like in a manner reminiscent of the source material, truth be told. If it helps, I'm using IDE v2.3.3.574 and Runtime v2.3.3.437.
What I'm aiming for is a group of identical enemies (A) that drop a powerup capsule for the player when the whole group is destroyed. If even one of them makes it offscreen (B), the player doesn't get a capsule from that group. How would I go about doing this in GameMaker? Right now I have it tied to a global variable that increments when one of the enemies is destroyed and resets to zero when one of them gets away, but it doesn't work as cleanly as I want it to. Like if one gets offscreen and the player destroys some of the beans behind that one, the relevant variable won't reset to zero and ends up dropping a powerup in the middle of a subsequent group.
Here's what I've got written out thus far:
GML:
global.beancount += 1;
//show_debug_message(global.beancount);
if (global.beancount % 5 = 0)
{
isRed = true;
}
if (isRed = true)
{
if (global.capsule_count < 14)
{
instance_create_layer(x, y, "Instances", o_powerup);
global.capsule_count += 1;
isRed = false;
global.beancount = 0;
}
else
{
instance_create_layer(x, y, "Instances", o_crash);
global.capsule_count = 0;
isRed = false;
global.beancount = 0;
}
}
GML:
instance_destroy();
global.beancount = 0;
I'm at a loss for how to get this working like in a manner reminiscent of the source material, truth be told. If it helps, I'm using IDE v2.3.3.574 and Runtime v2.3.3.437.