Mush
Member
I'm making a shoot em' up game which you can collect three types of powers and then mix them between two slots to make different types of bullets you can shoot, and, while i managed to make a working system for it, i think the powerup combining part is kind of obtuse and outdated. It may be simple, but is akwardly long. To get an idea, here's how long ONE section of it looks:
I don't mind having to write all those lines of code, but i wanted to know, is there any better (and shorter) way to write this?
GML:
if can_shoot = true
{
if slot1 = 0
{
if slot2 = 0
{
if instance_number(bullet0) < (number)
{
//Code for normal bullet
}
if slot2 = 1
{
if instance_number(bullet1) < (number)
{
//Code for fire+normal bullet
}
}
if slot2 = 2
{
if instance_number(bullet2) < (number)
{
//Code for multi+normal bullet
}
}
if slot2 = 3
{
if instance_number(bullet3) < (number)
{
//Code for homing+normal bullet
}
}
}
}