A
AtomicAstro
Guest
Alright, so I'm making a bullet hell schmup at the moment, and this isn't so much a "how do I do this" so much as asking for a bit of advice on something. Originally I was going to have different enemy types be different objects, but then I got an idea where I can just have a single enemy object and a switch statement that will assign different scripts depending on the assigned enemy type which will determine the sprite, functionality and everything. I also intended to do this for stage bosses, where there is one single boss object which picks a script based on which boss it is. However, in trying to keep it simple that way, it's actually made things a bit more complicated. The biggest problem I'm having is that if I set up a variable within the create event, I have to assign it a value right away. So, for instance, if I establish a variable for "enemy type" I have to give it a value, which I just set to a basic enemy.
What I normally do when spawning the enemies (since I plan for there to be a set pattern for enemy spawning, not randomly generated) is that I have an enemy generator object which constantly counts down on a timer equivalent to the length of the stage, and on specific frames it will spawn the enemy object, and set the variable "type" of that enemy to whatever enemy type I so choose. Since I have the switch statement in my step event, it will see the enemy type and run the script. But the problem is, it takes a split second for it to recognize as that particular enemy type, since by default I have to set the enemy type within the create event to something. It's been immensely frustrating trying to get this system I thought of to work, and I've been constantly racking my brain trying to create some Frankenstein's monster out of this system trying to get it to work the way I want it to.
So, that got me thinking. Since this is not an extremely large-scale game, I'm planning it to be a shooter with 6 stages or so, should I just go the simpler route and have different objects for different enemy types, or should I continue with this system and try to make it work? I didn't intend to ask around about this, since I normally prefer to solve things on my own if at all possible and detest the idea of pestering forums for solutions, but I really have nothing here. Any help is appreciated.
What I normally do when spawning the enemies (since I plan for there to be a set pattern for enemy spawning, not randomly generated) is that I have an enemy generator object which constantly counts down on a timer equivalent to the length of the stage, and on specific frames it will spawn the enemy object, and set the variable "type" of that enemy to whatever enemy type I so choose. Since I have the switch statement in my step event, it will see the enemy type and run the script. But the problem is, it takes a split second for it to recognize as that particular enemy type, since by default I have to set the enemy type within the create event to something. It's been immensely frustrating trying to get this system I thought of to work, and I've been constantly racking my brain trying to create some Frankenstein's monster out of this system trying to get it to work the way I want it to.
So, that got me thinking. Since this is not an extremely large-scale game, I'm planning it to be a shooter with 6 stages or so, should I just go the simpler route and have different objects for different enemy types, or should I continue with this system and try to make it work? I didn't intend to ask around about this, since I normally prefer to solve things on my own if at all possible and detest the idea of pestering forums for solutions, but I really have nothing here. Any help is appreciated.