Well, slow going lately (but then again, I’m still ahead of the curve, since I’ve started my February game at the end of January). I know what I want to do, but getting my head around the scripting required to do it is a trick. I feel as if everything you’d want to do in a video game is like a magic trick, and the developer has to invent that magic. For example, I want a laser to shoot from my moving turret. Seems easy, right? Well, to experienced coders, it probably is. I, however, am not that.
You need to first make the laser beam itself. That part is done, and with little issue. I even made it look Star-Wars-like, in that it’s white on the inside, with colour around the edges. I’ve made the size what I want it to be, all is good on that front.
Next, I need to make it spawn ON my turret, more specifically, the mini non-aperture I have. I get the logic behind this; in Unity, you create a group of objects that are all relative to each other, so when you want to duplicate it, you duplicate the group, and you’ve got everything along with it. In short, I don’t have to recreate everything about the turret, you make it once, and copy it, and it should share the same behaviour.
After said laser spawns on my turret, I need to make sure that it shoots from there, outward. I could write a script that always makes it shoot downward (south), but that doesn’t work for any turrets on any wall that isn’t north (see my previous post to check out what I’m talking about). I need to make a script that shoots the laser in whatever direction it and the turret are facing.
Next is making it ‘die’ as well as respawn. This means that, if the laser hits either the opposite wall or the player, it should be removed from the game, so it’s not just hanging off of whatever it hit. Add to that the fact that I’d like multiple lasers (or multiple instances of the one laser beam I created) to be spawned from the turret every 2-3 seconds, or any adjustable rate I’ll tweak later.
Lastly, I need to make sure that, if the player gets hit with said laser, they die/lose a life/face the consequences. Without this, there is no game. This part, I believe, should be the easiest.
So, with all of these objectives in mind, I have to start from the very basics, and learn from there. What was it that Sagan said, ‘ If you wish to make an apple pie from scratch, you must first invent the universe?
Yeah, that’s what this feels like. No matter, universe creation is on its way.