Game 1 – Space Shooter – The beginning

Setup

After signing up for the #1GAM the next thing was to decide on the three L’s: Language,  Library, Location (IDE).

I have been playing around with C/C++ for a while and decided that C would be a nice low-level language to work with, and a bit of a break from OO languages which I personally think over-complicates things sometimes when there is no need to. Also has the advantage that I could make it a lot more cross-platform rather then using something like Objective-C.

Location is also an easy choice, on OS X I haven’t really found an IDE that compares to XCode, not that I think XCode is the best IDE that I have used either, but for a native IDE it seems to be the best.

Now for the library.

Interestingly the inspiration for this seem to come out of nowhere. I was looking through the MacPorts devel category and I saw Allegro. I had briefly looked at Allegro probably around 6 years ago, but at the time I was using c#.net and I didn’t want to leave that language, and ended up using SDL.net which I think put me off SDL in general (or maybe it was the bad software rendering it did by default).

I played around with it and without too much hassle I had it installed and a test project up and running.

Choosing a game

So now I had my three L’s I just had to start coding… right?

Well, without an idea of sorts to base the game around there really is nothing I could start coding for.

What sort of a game would it be?

Side-scroller? Top-down? Action? Adventure? Sports? RPG? Platformer? First-person? Third-person? The options are endless.

The optional theme for #1GAM this month is money, but not money as in in-game money, money as in making money for the game. That doesn’t really help for designing the game and I don’t think I am ready to start monetising my games yet, that can wait until I get better at making games and building more worthwhile games.

I spaced out over this for a while, and then I realised, Space, a space shooter.

Its an easy choice for a 1st game working with a new framework, no need to find/build a level editor or handcraft levels instead, I could easily generate the maps programmatically very easily, after all, it’s just stars and planets randomly placed on-top of a black background.

If I have enough time I might add in-game resources and purchasable upgrades, but thats as close to the theme as I will get.

Progressing

Working with Allegro has been great and I have found it fairly easy so far. The only complaint I have is that there isn’t a docset for it in dash (an API browser that I quite like) and I have to use the online version, which can be a hassle since I do a lot of my coding on the train with little to no internet connection.

So far I have made an engine that loads all the required resources, builds the map, has a working and optimised render loop (only renders visible sprites), and has keyboard interaction that uses the dpad to scroll the viewport around the map.

Here is a screenshot of the current work-in-progress:

Space Shooter early days
Space Shooter early days

Next on the todo list is to add a space ship, bind the viewport to it, and work on the movement of the ship using a impulse/inertia control system.

Leave a Reply

Your email address will not be published. Required fields are marked *