Starting to Feel Like a Real Video Game (2D Space Shooter Project)
Been having a lot of fun with the 2D Space Shooter project recently. The introduction of power-ups is really helping spruce things up and add a little more variety to the game. In particular, they add in an extra element of randomization as to which of the power-ups spawns in, where it’ll spawn, and when. It’s a slightly underhanded way of looking at it, but these power-ups also encourage potentially reckless maneuvers in order to grab them before they exit the screen (which hopefully adds an element of risk and challenge).
I’ll touch on each of these power-ups a bit more in subsequent articles, but for the time being I’ll just focus on what I think needs doing. Some more UI, VFX, and post-processing would could be nice at some point, and I’d also love to see some animations on the spaceships themselves, not to mention a better sense of movement (as it does still feel a tad static at this stage). It’d also be great to make collecting and using these power-ups as satisfying as possible (a bit more audio and visual feedback for both), and I’ve never done anything with screen shake before but it could also help make things feel more alive in the game. Fully appreciate I might end up overdoing it with this to begin with, but I’m sure I can rein it in (perhaps with a slider on a float in the inspector to adjust the intensity).
One thing I’m particularly happy with is something you can’t see from any of the images or gifs I’m putting up: the game is run using events rather than direct references. Which is to say, instead of using the GetComponent method and referencing specific objects within the scene when, say, the player needs to take damage, collects power-ups, or is destroyed, I’m broadcasting these out as messages so-to speak. Objects within the scene are listening for some of these messages and perform logic accordingly. In that we can’t really see the difference, this is largely just an alternative way of approaching the systems needed to run the game, with one of the main benefits being that this approach mitigates dependencies (which can lead to cumbersome, heavily interdependent code that can result in null reference exceptions).
I absolutely want to give this particular subject more attention, so I’ve got an article in the works on an introduction to Unity Events (and how to start thinking about them) as well as some practical steps on how to get started with them 😉