Out of bombs?

Last week I did some initial work on the user interface of game levels, which may still receive substantial changes as I add new gameplay features thought. Playing the first prototype of b&p I've also realized that I had to limit the number of bombs you can throw against falling objects. Obviously if you had an infinite number of them, it wouldn't be so fun, right?

But the question was.. should I just put a maximum number of bombs the player has to use wisely or should I think something else? At the end I came up with a "bomb bar" which I think is a bit more intuitive. It slowly decreases if you throw bombs too frequently. So you do have infinite bombs, but still you cannot throw them too fast. :)

The bomb bar slowly recovers if no bombs are thrown for a small amount of time, but if you want it to become full in no time you will have to get one of these bomb boxes!

 And here's a small screen shot of the first ui:


When game programming books are useful

While I was working on Bombs & Penguins I ended up being quite satisfied with the visual and gameplay elements of the game, but I couldn't really say the same to the programming architecture I came up with.

With bombs and penguins I did my first attempt to create a "game engine" in C++ in which all the library I used could fit nicely, and I may say I both succeeded and failed in this intent. I succeeded because everything was actually working fine and failed because everything was slowly getting messy and difficult to mantain as I wrote new code :)

It is true that every architecture you build/use will have some trade-offs, but I needed a better base to build my game. That's why I decided I would buy the book you see in this post and after reading it, it definitely taught me how a good architecture should be made.

That's why I decided to rewrite the game code for bombs & penguins from scratch following the model proposed by this book. Of course, I didn't copy the code proposed in the book as it is, and that would be quite pointless I think, but instead I took inspiration from it and built a much better and efficient game engine than the old one. It took me about two weeks of coding, but it was worth the pain! :)

This isn't a review of game coding complete, but I do recommend reading this book to any game programmer wishing to build a solid base for their game!

I also rethought the role of Lua scripting language in my game. Before I was using it to code the gameplay elements, but now I'm using it more as a replacement for XML to load levels and elements. That is because I program alone and I do not have any scripter working with me, so why spend a lot of time trying to fully integrate scripting in my game? I realized it's quite a waste of time in cases like mine :)