Homebrewing Beer

Recently I’ve started to brew my own beer - I’m on my third batch now. I got the urge after wanting to make a game about managing a pub. That got me to discover another game via Steam called Beer Brewing Simulator. Then after playing that for a while, it seemed easier than I thought - so I decided to give it a go in real life! Several things put me off doing this before, but I realised they’re misconceptions. That’s something I’ve learned during my time off work: if there’s something you want to do but think you can’t for whatever reason, chances are you probably can (and should!). Challenge whatever assumptions are holding you back! In my case, these assumptions were: ...

September 27, 2024 · 8 min · Mike Cartmell

Creating a Tower Defense Game in Pico8: Part 5 - Placing Totems

In the previous tutorial, we made our player move around the screen. Next on our list is the ability to place totems (our towers) - a core gameplay element in a tower defense game! Unlike the player, totems don’t exist at the start of the game. Also, there can be many totems on the screen at the same time! So for this to work, we’ll need to introduce two new concepts: ...

February 22, 2024 · 4 min · Mike Cartmell

Creating a Tower Defense Game in Pico8: Part 4 - Player Movement

What Next? So far, we’ve introduced some basic coding and game design concepts and written some helper functions that will live up to their name soon enough. Let’s take a step back and think about what kind of game we’re making, as this will help guide us over the next few parts of this tutorial. Tower Defense Player controls Typically, the player in tower defense games acts as a godlike presence, building and upgrading towers from nowhere as the player issues actions using their mouse or a touchscreen. However, this is a Pico-8 game, and Pico-8 games usually mimic an oldschool console with two-button control schemes using either a gamepad or joystick or the keyboard. While we could implement a cursor controlled by a gamepad, I don’t think it’d be very fun here. So, unlike traditional tower defense games, I’ve decided to use an actual player character to control and build the towers. This can be seen in games like Factorio, which features base-building with a player character instead of the traditional god-game approach, and also has tower defense gameplay among many many other things! ...

February 6, 2024 · 10 min · Mike Cartmell

Creating a Tower Defense Game in Pico8: Part 3 - Setting Foundations

Helper Functions There are some techniques, like _debug mentioned in part 2, that I use in almost all my games. In this post we’ll implement some of them right at the beginning, because it’ll save us time later! In Pico-8’s code editor you’ll notice a number at the bottom-right which increases as you write code. This is the token count, and it’s very important to keep an eye on this because Pico-8 programs can only have 8192 tokens! This might seem restrictive but it’s actually useful when just starting out to have constraints like this, because it encourages you to keep your game short which means you’ll have more chance of finishing it. It also encourages good coding practises which will be useful even when writing non-game programs later on. ...

February 6, 2024 · 8 min · Mike Cartmell

Creating a Tower Defense Game in Pico8: Part 2 - Special Functions

Special Functions In part 1, we wrote some commands called function calls to tell Pico-8 to draw text and shapes on the screen. But we can write our own functions too. And there are 3 special functions that, if you include them in your code, will be called by Pico-8 itself while your program is running! This forms what’s known in game programming as a game loop. Games must run code constantly to calculate game logic, move characters around on the screen, respond to the user pressing controller buttons and so on. And then it must display what’s happening on the screen many times per second (the rate of this is called frames per second or FPS). This means there is a constant ’loop’ that consists of: updating the game’s state, drawing it to the screen, and repeating. ...

February 6, 2024 · 6 min · Mike Cartmell