• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Development How to structure my Shoot 'Em Up.

P-Fritz

Member
Hopefully this is the right section of the forum to post this. If not, I'm sorry.

Anyway, as a beginner I've been currently working on an auto-scrolling space shoot 'em up. I've watched a lot of tutorials on this and most of them teach you how to create an endless arcade game that spawns enemies randomly. But I'm going beyond that and want to create levels where specific enemies come in at specific times and specific waves. The question is, how do I go about doing that? There's dozens of ways I could do theoretically do this.

My first idea was to create a large stretched out room and the player is blocked off from the rest of the room as the backgrounds scroll (to create the illusion that they're moving forward in the level). Then I would have waves of different enemies placed at different points in the long stretched out room travel into the area where the player is. Like a train on a track heading to the player's screen. But perhaps there is a better way? Instead of having a giant room where every enemy all moves simultaneously to the boxed off area where the player is; would it be better to have a smaller room and enemies spawn where / when I want them to? Maybe utilizing a series of timed spawn objects that activate and destroy themselves at different times? Of course that would make planning the layout of a stage a lot more difficult since I wouldn't be able to visualize it.

I suppose both those things could work, but what direction should I take?

I thank the community ahead of time for their help!
 

woods

Member
having that long room is good for visualizing your level.. like you said.
also the trade-off of having all those enemies doing stuff is taxing on the machine..

maybe look into activating/deactivating instances that are outside of the play area as needed... you would get teh benefits of visualizing your level and a performance boost for not having EVERYTHING running all the time.
 
Yeah, as woods said, I would definitely base the flow of the game around activation/deactivation for a large level. This has multiple benefits as not only does it cut down on the processing required for the level, but it prevents enemies that aren't meant to be in the current "zone" from trying to get to the player (of course, you can use point_distance or a variety of other methods to do this, but deactivation works just as well). However, you're going to have to deal with how to decide when to activate what enemies.

You could use variable definitions to setup stuff for each individual enemy (such as when they activate or whatever), which you can edit in the room editor, but I feel like this would become very cumbersome over the course of many enemies, so I wouldn't go down that route.

The first method I would try would be to create objects for each region that are just a single pixel with a unique partially transparent colour and stretch them over sections of the map. Mark them as invisible so you can't see them in-game, but you can see them in the room editor. When enemies (and whatever else should be activated/deactived in a "section" like manner) spawns in-game, they all check to see what block they are colliding with, add their id to an array stored inside that block and then deactivate themselves. Whenever the player touches a new block, that block can then search through it's array and activate all the id's that were added to it previously. This lets you visually craft "sections" of the game that will become active whenever a player reaches a certain spot using only the room editor. Because the enemies add their id on run-time, you don't have to do anything besides write the initial "add to the array" and the "search through array and activate" code to get the enemies to properly activate and deactivate themselves.
 
Last edited:
Top