How to make a PICO-8 game: Part 9

Animated

Sprites are all well and good, but if they animate they look so much better. Let’s head towards the end of this project by polishing it a bit.

Part 9: Animation

First up, we need to have some frames of animation for the enemy sprites. To make it a bit more logical on the sprite screen, I’ve moved the first frame from “slot” 2 to “slot” 17, then edited it and created three more frames of animation:

It’s nothing fancy, but you can change that if you like.

Now, when we create the enemy, we need to pass an extra parameter to the make_enemy() function – the total number of animation frames for the sprite. Of course we could hard code this into the enemy object, but lets assume we might want to reuse this function at another time for a range of objects each with a varying number of animation frames.

Currently, the function starts with this:

We’ll add “eframemax” to this:

and then set:

in the function itself. You’ll see why we had en.frame = 0 in there now!

Next, we need to add some code to change which sprite to use, changing it every so many ticks so it animates like a flickbook. We already have variables for ticks and ticksmax to help with this.

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

How to make a PICO-8 game: Part 8

Enemy objects

Last time, we got halfway through butchering our previously working game, leaving it in a state where it refused to even run. This time, we’ll fix that.

Part 8: Enemy Objects

Now that there are multiple enemies, and they’re all objects, we can no longer use any code that refers to the old variables of ex and ey, or any other “single enemy” legacy code. Currently, that also means that collisions no longer work.

Luckily, the function checkcol() only needs to be sent two lots of x and y values, so still works fine providing we send it the right variables, so we can leave that alone. However, we need to replace the code that calls it.

At the moment, it says this in _update():

which doesn’t work – note the ex and ey. Instead, lets call this function for each enemy, and pass that enemy’s x and y to the function. Like this:

Be extra careful with the brackets here – the foreach encloses the code in them!

Hopefully by now what this code does is clear, as it’s similar to the enemy  draw routine: It runs through each enemy in enemies{} and triggers checkcol for each.

That’s collisions sorted. Our code won’t run yet, because we still have to fix the enemy move and enemy speed increase routines.

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

Pokémon Gone

Everybody’s dead, Dave.

That’s it. I’m free. No more walking eggs, no more staring at my phone everywhere I go, no longer will my phone battery need charging five times a day. Pokémon Go is over.

Well, not yet, but soon. Niantic have announced that in February, Apple devices that can’t run iOS 11 will no longer be able to run Pokémon Go. Since I can’t run iOS 11, I can’t keep playing, and I’m damned if I’m buying a new phone just for one “game”.

It’s a shame, but in a way I’m glad. It’s given me a reason to stop. I’d say it’s been fun but actually, has it? Collecting all the monsters hasn’t been feasible, the gyms have been broken so they serve no purpose other than to provide me with coins, trading Pokémon never happened, and raids are impossible (and mostly pointless). I have to wonder why I was playing, and honestly, I can’t think of a single reason.

So I’ve stopped now. There’s nothing to gain from playing for another 6 or 7 weeks and then having it switched off, so why wait? It’s gone.

Goodbye Dave, Dave, Dave and Dave. And Dave. Poor Dave.

How to make a PICO-8 game: Part 7

Outnumbered

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!