Well, it’s the time of year that we’ve all been waiting for … the annual year-end code challenges have begun. Like last year, I’m participating in the Advent of Code challenge throughout this month, and will be posting my solutions up onto my GitHub repo linked below. If you’re reading this and taking part in…
All the World’s a Stage…
Now that we’ve got the main game stage all set, we need to populate it with Actors. That is to say the things that move about the screen and interact with one another and with the players. As previously mentioned, I’m going to approach this from the perspective of a new class of object so…
Game On…
It’s been a while since my last post, so I figured I’d get back onto the horse and do a little more on the development side. I’ve added a new class into the codebase now to begin implementing the main game, it currently doesn’t do much more than show the main playfield at present, but…
Happiness is…
There are few things in life that make a person happier than a little retail therapy. So today is the day I say goodbye to my old bike and hello to a new one. I’ve been riding the Triumph Explorer now for the last five years and, whilst it has proven itself a good, sturdy…
Hierarchy Breadcrumbs
Here’s a nifty little nugget I discovered today. Credit goes to DXC’s Sébastien Martin for highlighting this on a LinkedIn post. For records that have a hierarchy linked by a parent field, there is a formatter that can display a clickable series of breadcrumbs on the form to show the set of records that form…
Credit, Where Credits Due
As a brief aside, after building a (mostly) non-functioning menu state, I have taken the time to build a quick state for showing a scrolling credits page as proof of concept for switching between states in the state manager. This allows for some exploration of some other techniques related to how we display the screen,…
Main Menu Development
Now that we have the basic framework for the game in place, it’s time to take a look at out first ‘real’ state definition. This will be the main menu for the game. At this stage, the MainMenu class will be an incomplete placeholder, but it will serve to demonstrate some of the basic functionality…
Dynamic Modules
In the previous post I mentioned that I’d need to dynamically load the state modules at runtime. Luckily, Python provides a module – importlib – to do just this. In order to load our states into the system, we pass a list of dictionary objects into our Game initialiser, which in turn passes this onto…
Managing State
In order to simplify our code, we’ll implement a state-based model for the game. This will allow us to represent each significant ‘mode’ of the game as a separate, encapsulated item, thus keeping code for differing parts of the program isolated from others. This will also have the benefit of allowing us to extend the…
Throttling
In my previous post, I mentioned that we’d need to look at some mechanism to throttle the game execution so that we can achieve a consistent speed across hardware of varying speeds, so here I’ll look at how we can achieve this, and why it is important to adopt the method I outline. As we…