A very small detour
There comes a time when a developer likes to branch out, sample different technologies and experiment with new fields. A welcomed change to practice finding a solution no matter the context and creating something out of nothing, out of nothing but a few hundreds lines of code.
Personally, especially in the summer months, I like to tinker with little games instead of web pages and for this, it would be difficult to argue for an easier experience than that offered by the console that is, or may not be, PICO-8. The best way to immerse yourself in the topic might be a very insightful playlist creating a full-fledged shoot ‘em up. And if you go through the entire series you may just create something shy of grandiose. But to get started, you need an inkling of inspiration and a concept, no matter how simple. Like Pico adventure.
Riffing off the title for the Atari 2600, the game asks you to pick up a sword and fight the enemy, or enemies, jittering in the room. Hold the weapon long enough and you only need to then cross the gates to enter a new level. There are barely three floors and a poor excuse of a trophy, but ultimately a cute adventure implemented rather clearly, with basic data structures and a multitude of if statements.
In the realm of PICO-8 you run the game by loading the cart directly in the console. You can try the education edition for a free, web-based alternative. Type load and execute to pick the file ending with the .p8 extension. Enter run and play around with the handful of available buttons.
In the console you also gain the option to review everything which makes up the game: the code, the sprites, the map of the closed dungeon. Even the tentative sound effects and repetitive music pattern.
You can improve the set just clicking around the packed interface, and if you want to tweak the code, here a few tips to ease your first of many updates:
the programming language is Lua. Look past the fact that tables start at index 1 and you will find one of the most approachable syntaxes you ever experienced
every PICO-8 title is governed by three essential functions:
_init: executed once at the very beginning, and a good place to initialize the game’s state_update: executed over and over to change the state of the game. This is where you consider user input, change the position of the character, the speed of an enemy and anything in between_draw: executed over and over to actually paint, to show something on the screen
_drawfollows_update, so that the player sees the game in the most up-to-date fashion.
It is likely a short tutorial might do a better job to show off the console and the built-in fancy features, but as an amuse-bouche, this should suffice. And if not, at least you have a little plaything to entertain your next two-minutes break. A veritably miniscule adventure.