The Space Game 3: Crates and Loot


The latest update I’ve made is to add loot crates and randomly generated weapons to the game. I have two weapon types, and change the random ranges based on weapon type. Lasers are powerful but slow firing, while the bullet guns are weaker but fire machine gun style. The result is that you’ve got two distinct weapon types, but the exact stats are randomly determined so you can generate different guns with different attributes.  I’ve also got some nice explosions and shield glow effects when you hit an enemy. It’s still very basic, but I’m starting to see how it could be filled out with items, enemies, and so forth.

Hud example


Tom Francis mentioned in one of his tutorials about how to have HUD style GUI elements appear over objects on the screen. The tricky part is accounting for view movement and rotation. He posted code you can use in a blog entry, but I thought it might be a good exercise to try it out in a little example. In case anyone would like to see his script in action, I’ve posted the code on dropbox here:

I kept it as brief as possible so that you can see the code in action, it just displays two enemies and a player, with GUI elements displayed over the enemies. The view rotates so that you can see that the GUI elements stay in place. The code from Tom Francis’s blog entry that does the calculation of the GUI x and y for the object are contained in a script that takes the object x and y as arguments, and puts the GUI x and y coordinates in variables GUIx and GUIy.

The gui elements turned out to be pretty easy to do, I could see them being used in some kind of Transistor-esque game where you pause it and see readouts on the different enemies.

The Line Game


I decided to take some of what I’d learned in the Tom Francis tutorials and use it to make a small game of my own. The goal wasn’t so much to create something that I’d actually want to play as to get some good practice with the techniques involved.  I wanted to make something very different from the tutorials. The game I ended up with was a version of Lines (That smartphone game where you match 5 blocks and they disappear). More on what I learned after the cut. Continue reading