How to make a PICO-8 game: Part 7


If you remember (it was before Christmas, so I realise you might not), the last thing we did on our game was make it harder. This was done by making the enemy speed up, but there’s another way – why not spawn more enemies?

Part 7: Spawning

Up until now, we’ve referred to the enemy’s position variables as ex and ey, and used the variables d and dinc to determine their speed and how much they speed up by. If we decide to add a second enemy, we can use more varables – ex2, ey2, d2 and dinc2 perhaps. And for a third enemy, ex3 and ey3 and so on. Simple, yes?

Well yes, but terribly inefficient. Not least because we need the associated code to alter them too. What if, instead, we can just say “make an enemy with these attributes” as many times as we like, and then say “just update all the enemies and draw them on the screen please and thanks”? That’d be like magic, right?

Magic in the form of an enemy object. In PICO-8, objects take the form of specially constructed tables, with keys and values. For example, we can create an “empty” enemy called “en” like this:

and then give it some attributes as key/value pairs:

and so on.

Then, we can be clever and create lots of these and put them all in another table, called “enemies”. We can then perform tasks on all the enemies in the enemies table in one go!

Let’s start with a function to make enemies and add them to the enemies table.

Continue reading “How to make a PICO-8 game: Part 7”

2017 Game of the Year, The Actual 2017 Game of the Year

Which is the game of the year, of the year 2017.

I’ve gone done and told you some great games that were not the best games of 2017 (that I played for the first time in 2017, remember) in parts 1 and 2. Some great, great games in there, Brent. But you’ll notice that I’ve already discounted two highly likely winners of the prize – Mario and Zelda.

Which leaves what, then? Did you guess? And don’t think that big picture at the start of this post (or thumbnail in your RSS reader, or in a broken position on the page because you’re reading this in 2034 and WordPress themes have moved on and aren’t properly backwards compatible and anyway who needs images now when your eyes have been replaced with bionic implants that source stuff straight from the AOLWeb?) gives it away, because that’s a decoy. Although oh my, what a decoy.

Continue reading “2017 Game of the Year, The Actual 2017 Game of the Year”

2017 Game of the Year, Part 2

Part 2 of the list of the best games I played for the first time in 2017. Again, they’re in no particular order, but they are better games than those in Part 1. Although those in Part 1 were great too. Erm. After this there’ll be one more post with the Actual Best Game of 2017, which isn’t any of these.

SteamWorld Heist (3DS)

I’ve no idea why it took me so long to jump into this. I like turn based strategy games, I loved the aesthetic of SteamWorld Dig, and the reviews (from people I trust especially) were very complimentary. When I finally did buy it – oh my was it great.

A side-on, platformy strategy turn based shooter was waiting for me. And I loved every minute. Bought the DLC. 100%ed the game. Outstanding game. Just a little too short, perhaps? If I had to choose something negative, I mean.

I’m hoping for a sequel in 2018. Got on it, Image & Form!

The Legend of Zelda: Breath of the Wild (Switch)

Waaaait a minute, I hear you cry. Zelda wasn’t Game of the Year? Nope, sorry.

It was excellent. It took everything I liked about 3D Zelda games (er, it being Zelda, mainly) and took out or changed everything that I hated about them. It’s open world, it’s mostly completely choose your own path. There’s loads to find, tonnes to do, and it’s slick and clever and just a bit… disappointing.

Don’t get me wrong, it’s one of the best games this year. It’s the best 3D Zelda by a long way. But being unable to climb walls when it’s raining, no proper dungeons, and (Lynels aside) an almost complete lack of any sort of challenge temper that a bit. But it’s really very, very good. Honest.

Life is Strange: Before the Storm (PS4)

I mentioned this on the ugvm podcast, and on my diary so won’t go over it all again here, except to say this: it’s a fantastic, gripping story, but it’s not as epic or interesting as the original Life is Strange. Before the Storm is still absolutely worth your time, though, even if Chloe isn’t Chloe.

Gorogoa (Switch)

This came in late in 2017. Very late, in fact – in the very last week of the year. But I completed it and felt very clever.

It’s a point and click puzzle adventure game with an unusual method of solving puzzles that’s too long winded to explain here. You feel like you’re juggling several puzzles at once in your head, and needing to re-arrange scenes on the screen (and separate “slices” of them out) just adds several layers of confusion and complexity to them.

Mighty Gunvolt Burst (Switch)

I suppose years ago, I wouldn’t have given this a second look. However, you may have seen that a while back I ran through all the Mega Man and Mega Man X titles, and I also enjoyed the (freebie) original Mighty Gunvolt – which was basically Mega Man in different clothes.

Well, Mighty Gunvolt Burst takes Mighty Gunvolt and ramps it up into a full Mega Man experience. With elemental bosses, that provide weapons to help defeat other bosses weak to those element. There’s a massively deep and varied upgrade system for both moves and attacks, and if that wasn’t enough there’s a whole separate character (with different skills) to play as too. Then they added a third character!

One of the best platformers of the year and so replayable. I’ve completed it about 8 times now, if you need some sort of proof.

SteamWorld Dig 2 (Switch)

Also one of the best platformers of the year, is SteamWorld Dig 2.

I loved the first game. I bought it twice, in fact. This sequel improves on it in almost every way possible though – it’s bigger, more varied, has a better story, has more interesting upgrades, has less grinding for money, and, well, is just better OK? OK.

Super Mario Odyssey (Switch)

Also one of the best platformers of the year, is Super Mario Odyssey.

Sure, I’ve been quite dismissive of it. At the end, with the grinding coins to buy moons, I was actively hating it. If you don’t go for 100% though, and stop playing once you’ve had enough (which was around 500 of the 999 moons for me), then it’s hard to fault it.

It looks glorious. The originally un-Mario soundtrack and un-Mario graphics, over time, became “normal” for Mario and what was originally a mess of art styles just worked. It’s creative, Mario is a joy to control, and although it’s not the followup to Mario 64 I really wanted I can’t argue that until it outstays its welcome it’s utterly sublime.

It just has too many damn moons!

Stardew Valley (Switch)

I’d owned this for ages, unplayed, on Steam, but the problem with Steam is that is isn’t on the Switch. So when Stardew Valley appeared on that, I jumped on it.

It’s really just a clone of Harvest Moon, only how Harvest Moon on the SNES would have been if it continued evolving without changing graphically that much. If that makes sense. Everything is – or can be with the right tools or items – streamlined. You open shortcuts to places to save all the walking. You can sell anything by just sticking it in a box next to your house. Crops can be watered automatically. Animals can be fed automatically.

If I’m not selling it, then put it this way: I played it for 120 hours. 120! That’s more than any other game last year.

So then. Can you guess which game I’ve missed? Which title is my Game of the Year, 2017? It’s not Zelda or Mario, look – I’ve already mentioned them. Find out next time! How exciting.

2017 Game of the Year, Part 1

Once more, it is time to declare which game was the best game of all games in 2017. Once more, I will always be right. And, once more, the rule is that the game was played by me for the first time in 2017, rather than came out in 2017.

With that said, here are the games that didn’t quite make it, in no particular order:

Lego City Undercover (Switch)

Already I’ve broken the only rule I’ve given myself, as I first played this a few years ago when it was a Wii U exclusive. However! The Switch version is two player, where the original was single player only, and playing the entire thing in co-op was new. Sort of. It’s still a fantastic game, and mostly fixes the terrible loading times from the Wii U version (which was perhaps the only fault), so it gets a mention here.

Assassin’s Creed Syndicate (PS4)

Like Unity before it, which made last year’s list, Syndicate is a flawed gem. The assassining hasn’t been this good in ages. The missions were mostly pretty good. Jacob wasn’t as good as Evie to control, granted, but still – it’s a step above the already pretty good Unity.

As with all games in the series, there are bugs which threaten to ruin the game but luckily are mainly just of the funny variety here. Being set in London added to the experience, too, I think.

It’s not perfect, but it’s excellent. So good, in fact, that I even went and got all the collectables and did all the side missions, as well as some of the DLC.

Wonder Boy: The Dragon’s Trap

A graphical and aural facelift for a game that was always brilliant. The gameplay is old school, it’s pretty difficult, and plays exactly like the Master System original. Which is exactly what I wanted, really.

Earth Defense Force 4.1: The Shadow of New Despair (PS4)

Shooting giant insects and robots never gets old. Climbing into a giant robot and punching a skyscraper sized lizard in the face is even better.

Sure, even though it’s pretty much a retread of EDF 2017 on the Xbox 360, and yes – it might look only a bit better and it still suffers from the worst slowdown ever seen despite the extra power of the PS4 – but that doesn’t matter. Shooting giant ants, man. Giant ants.

Kamiko (Switch)

A short, but fun little hack and slash (or aim and shoot, if you choose the archer) game with some simple puzzles and some Titan Souls-looking visuals and bosses. It’s never going to be the best game of the year, but it’s cheap and I enjoyed it a lot, completing it with all three characters and unlocking everything.

Hitman (PS4)

That’s Hitman as in, the recent Hitman not the old Hitman from waaaaay back. After the terrible mis-step that was Hitman Absolution, Agent 47 was properly back in a series of episodes, each set in completely different scenarios and each with a hundred solutions.

The sheer number of ways you can assassinate your targets, by stealth, by cunning, by sniper rifle, by boobytrapping, by proxy… it’s incredible. There were so many “surely I can’t” moments where I found, why yes, yes you can. And it was funny too.

Definitely the best Hitman game.

Bye-Bye Box Boy! (3DS)

It’s not a big name, it’s not a well known series, but Boy Boy’s third title is another excellent platform puzzler that somehow manages to twist the formula a little more over the first two games.

I felt it was a bit easier than previous titles, but I love the art style and the variety in what is essentially a simple premise, and it’s one of the best games on the 3DS eShop.

And that’s it for Part 1. Part 2 will have some more games. Better games than these, even! But will it have the best game of 2017? No. That’ll be later.

How to make a PICO-8 game: Part 6

Die Hard

We have a complete, if dull and far too easy, game. Now we’ve the basics set up, let’s make it harder – and hopefully a bit more playable as a result!

Part 6: Die Hard

There are a number of ways we can make the game harder, but the simplest one is just to make the enemy faster. We can do this just by changing the value of d from 0.05 to a bigger number. Instead of that, though, why not slowly increment d so that the enemy gets faster and faster the more time the player has spent alive?

We can do this with a counter that increments every loop of the game logic. When it hits a certain threshold, increment d and reset the counter. Let’s call this series of counting “ticks”, and after 200 ticks (so 200 loops of the game logic – essentially 200 frames) d increases. We’ll also choose that d will increase by 0.05 each time.

For this, we need three new variables: ticks (the tick counter), tickstrigger (the number at which ticks triggers a speed increase), and dinc (how much d increased by each time).

We’ll put these in _init():

Now we need a simple routine to increment ticks, check if ticks has spilled over the tickstrigger, and if so, increment d by dinc. We can put that in _update(), after the rest of the game logic:

Now, you’ll notice that ticks increases by one each loop, as does score, so you can watch the score counter on the screen increase and at 200, 400, 600 and every other multiple of 200, the enemy will speed up.

That’s made the game somewhat harder. Of course, eventually the enemy will be faster than the player and there’ll be no way to continue playing, but we can deal with that another time.

Our code so far, then:

Next time, we’ll make the game harder in a different way by creating multiple enemies, and to do that we need to delete and rewrite half our code. It’ll be worth it!

How to make a PICO-8 game: Part 5


Now that things can collide and the player can effectively die (see last time), the next job is to score some points. Doing this is surprisingly easy, and so this lesson is going to be very short.

Part 5: Score!

For the purposes of this game, simply staying alive is how you score points. Maybe we’ll add bonus points or something later, but for now, the player will get one point for every frame they stay alive.

We need to do three things: set an initial score, update that score, and draw the score on the screen. Hopefully you can see where this is going.

In _init(), we’ll initialise the score to zero:

Then, in _update(), we’ll increment it (so it goes up by one point each time _update() is called. We’ll do that at the end of _update() in case we die that frame:

And finally, we’ll draw this on the screen in – you guessed it – _draw(). We need to draw it after we clear the screen with cls (or we won’t see it), but it’s an artistic choice as to whether our sprites are “on top” of the score, or the score is “on top” of the sprites.

Of course, we could have a status area on the screen for this (where the gameplay area won’t encroach), but for now we’re keeping it simple. Let’s print it at 100,0 so it’s in the top right but has space to allow for multiple digits in case we’re that good, and in colour 7 (white):

And that’s literally all there is to it.

I said it was going to be short! Let’s catch up with the code so far:


How to make a PICO-8 game: Part 4

Crash! But not that sort of crash.

In Part 3, we made an enemy chase the player. Which was nice, but nothing actually happened when the player was caught. Why not? Because we had no code to check for collisions! Let’s fix that.

Part 4: Collision check

What is a collision? Well, for the purposes of our game – and most games – it’s when two objects overlap. In our case, it’ll be our player sprite and our enemy sprite. That’s pretty simple to understand, but how do we code it?

Let’s look at the definition in plain English. Both sprites are 8 pixels wide, and we need to check if any part of each sprite is “inside” the area of the other. Things will be different for different sized sprites, but let’s keep it simple for now.

The player sprite’s four corners are:

And the enemy sprite coordinates are:

So when they overlap, all of the following must be true (follow along with two squares of paper if that helps!):

  • The right edge of the enemy must be to the right of the left edge of the player (ex+8 > x), AND
  • The left edge of the enemy must be to the left of the right edge of the player (ex < x+8), AND
  • The bottom edge of the enemy must be below the top edge of the player (ey+8 < y), AND
  • The top edge of the enemy must be above the bottom edge of the player (ey > y+8)

In PICO-8, that translates to:

Let’s plan ahead a little, and assume we’re going to reuse the collision code for other things later on. After all, we might add more enemies, right? Let’s create a function to check collisions between two objects, using this code as the base. The function will return true if there’s a collision, and false if not:

Now we can send the coordinates of any two objects to that function and get a true or false in return. We’ll put a call to it in the _update() function (before we move anything), and stop the game if there’s a collision. Later, we can lose a life or something instead, but for now we’ll just stop().

Remember that “if checkcol(x,y,ex,ey) then” implies “if checkcol(x,y,ex,ey) == true”.

Here’s a catchup of all the code so far:


The ugvm Podcast is still happening

And I’m just as surprised as anyone.

We’ve done four proper (and one pilot) episodes now. There’s a scattershot selection of ugvm colleagues joining me each time, we’re still tweaking the formula (and the recording method), and the “let’s make it an hour long” goal is now a running joke. But here we are, and I think it’s pretty decent actually.

I’ve no reason to suspect, or even hope for, mass recognition and we’re just one of a billion videogame podcasts, but that isn’t really important. We’ve listeners outside of the ugvm group. We’ve had positive feedback and constructive criticism. That’s not really important either, to be honest. No, I’m finding the best bit is just having a chat about games with some mates. Some of whom I’d never actually spoken to.

Anywho, Episode 4 went up this week. We chatted about lootcrates and Mario and Sonic and all sorts. You can find it here.