Creating a PICO-8 game
I recently discovered this awesome fantasy console with a lot of beautiful but tiny games and I believe it is a great starting point for someone who is starting to code and want to focus on developing games.
I’m 35 and started programming as a hobby when I was 13, I then took it as a professional career but never immersed myself in videogames development, even being a huge fan of them. I also have a tendency to think of an idea for a game, start working on it and realize is too big for me to handle and leave it in the middle, so this is a great opportunity for developing something small and simple. Something with a really small scope that I can force myself to finish it.
Going back to the topic of the article, the PICO-8 is a tiny environment with the following specs:
- Display: 128x128, fixed 16 colour palette
- Input: 6-button controllers
- Carts: 32k data encoded as png files
- Sound: 4 channel, 64 definable chip blerps
- Code: P8 Lua (max 8192 tokens of code)
- CPU: 4M vm insts/sec
- Sprites: Single bank of 128 8x8 sprites (+128 shared)
- Map: 128 x 32 Tilemap (+ 128 x 32 shared)
It also includes a development environment complete with code, sprite, sounds, music and map editors!
The language used for coding is Lua but it does not use the standard Lua library so there are a few functions missing, so if you need something from there you have to code it yourself. I have heard of Lua before but never really used it.
Because of the specs, there is a lot of constraints in place. I found this useful for keeping focus on developing a game from start-to-end instead of trying to build something huge where I get lost in configurations, compilers, libraries and so on. In simpler terms, I have to work with what is given to me and nothing else. These constraints can boost the creativity of the developer by forcing it to think out-of-the-box for alternative ways of doing something.
Within this context, I set myself to create a top-down shooter game where you have to defeat a lot of enemies (kind of a bullet-hell game) until the end where you have to fight against the final boss.
I decided to go with the name “Face Of Mars” for the game title. The idea came from the S1:E9 of the sci-fi show “The X-Files” called “Space” where a former astronaut is being tormented by some entity emerging from the alleged face of Mars.
Naturally, due to my anxiety, I started at the end: the actual boss battle against the face of Mars. I took the image of the formation in Mars you see above and started drawing on top of it, adding some details, etc. This is my first sketch of it:
I was unable to use this image of course because of the PICO-8 restrictions, but it was good to have an idea of what I wanted the boss to look like.
I wrote down also how this boss will behave, how it will attack, etc. Some of the attacks I thought of:
- Shooting bullets from the mouth.
- Shooting lasers from its eyes.
- Invoke Mars’ moons, Phobos and Deimos, and spawn enemies from them.
- Invoke Mars’ moons, Phobos and Deimos, and make them collide to crush your ship.
- Grow some arms with hands that crush your ship
Ideas 3, 4 and 5 were discarded since I wanted to keep it small, but I added also some movements attack that I called Sniping (Go fast to the position of the ship) and Loop (Move in a loop from the edges to the center and when there shoot a spread of bullets).
Here is what the boss looks like so far:
After having the boss defined, it was time to define some other enemies and how the gameplay will be. I decided the following for the general gameplay:
- There will be waves of enemies, each one being harder than the last.
- The player will have a Dash movement.
- It kills enemies
- It charges your secondary weapon on each kill.
- There is going to be a Secondary Weapon, selectable by enemy drops between one of two possibilities:
- A nuke bomb that damages everything in the screen.
- A blue laser constantly firing forward for a few seconds.
- The ship will have upgrades that are going to be randomly dropped by enemies.
- There is a max of 2 upgrades
- They increase the number of bullets the player shoots and also increase the amount of hits that the player can take.
- Each hit reduces the upgrades of the ship until explosion.
There will be 4 types of enemies:
- Wanderers: They just travel the screen in a zig-zag pattern from top to bottom.
- Snipers: They go past until your ship, then they go against the ship really fast to collide.
- Shooters: They travel from top to bottom and to the sides shooting bullets to your ship.
- Blockers: Pair of bullet-immune enemies that travel from top to bottom creating a laser barrier between them. Only can be killed by dashing through them.
I leave embedded below the last iteration of the game: