Over the weekend I participated in the Ludum Dare competition. This was the first time I have entered LD. The end result was a bit… Iffy, but I learnt a lot along the way.
The theme was “an unconventional weapon”. I took some time and wrote down ideas such as “cheese”, “socks” and even “mice” to scare off elephants. In the end I settled on a snake that is used as a whip. Unfortunately that never actually became the weapon.
I opened up Unity, started up mono develop and then started questioning myself. How much would I learn if I made yet another game in Unity? Before I knew it, I had closed unity and opened visual studio. This one was to be made in c++.
The only other game I have made in c++ was Shark! Shark! Back last year. So this was going to be a huge learning experience. Fortune rely I have made many games in Java before, so I wasn’t going in completely blind. I knew it would be so much more work than unity, but I was ready.
I decided on using SDL for the window and input. Since I have never used SDL before, I had to spend a whole reading the documentation and working out how to link libraries into the project. This was quite frustrating at first because I was getting linking errors, but with some perseverance, I worked it out.
Eventually I got to this point though:
Admittedly, it took me a little longer than expected to get to that point, but I was happy when I finally got there. From this point, I started writing a lot of the things needed for the game to work. I wrote out a texture class, input, file loader, entity class, level system and a character. That took me to the night of the first day and a few hours into the next morning. I decided sleep would be best (I was right on that call) and got a good amount of sleep. When I started on Sunday, this is what the game looked like:
Next problem: scrolling levels. This was a problem because of a silly mistake I made. To get this done, I was rendering all the level with an offset based on how far the character had moved. That was working well, but the collision was off. I spent a whole playing and making tweaks, trying to work out why. Eventually I realised I forgot to stop moving the player… Now the level moved instead!
I was tired at this point, so I worked on the title screen for a little while. Nothing mind blowing, but it was at this point I wished I wrote a gamestate base class and had a good swapping system because it was tedious making menus.
I was running out of time and my drawing skills were not up I the task of making a snake whip. So I changed the idea slightly so you release snakes into traps to stop you getting harmed.
Finally I made the traps before submitting the game. The traps caused me some issues as for some reason it didn’t like changing textures. I fixed them by breaking in a for loop involving collision. So….apparently they are related?
Overall, I am not so happy with the game I created, but I am still happy I made it in c++. I knew I was dooming myself to a not so great game, but to me the learning I did over the weekend was much more valuable than making another game in Unity. I also believe I am a lot more confident with c++ as a language now. I found I was getting less and less silly errors the further along I went (except they texture swapping problem!).