I’ve been programming since the days of yore when Commodore 64 was the personal computer of choice. I can program but I wouldn’t call myself a programmer. I can program VBScript macros on my work terminal and churn out a mean spreadsheet. I have learned the basics of programming Javascript, PERL, PHP, Ruby, Elixir and a few other languages I’ve forgotten, but I rarely implement anything worth sharing.
The main problem is the gap between my skills and vision. On one side, as I start learning a language my skills are improving, but on the other side I can’t envision anything worthwhile to create with my limited knowledge. I could eventually bridge the gap, but only with greater effort than I have mustered so far.
I had a day off from work today and started to play with a program called Pico-8, a “fantasy game console.” I watched a few tutorials and put together a mini game called Periwig that can be played in a web browser.
You are a wig. You can jump by pressing Z. There’s a bald guy standing over there. What should you do?
The Beauty of Constraints
Pico-8 is an integrated development environment for simple games which get saved as “cartridges.” Anyone can play the games other people have shared in a browser or through the program itself with the “splore” command. The program can also display the source code for those programs and be used to make more games.
Pico-8 uses a subset of the Lua scripting language, and includes integrated tools for creating sprites, maps, sound effects, and background music.
What makes Pico-8 a great tool for learning programming are the self-imposed constraints. You can only use 16 predefined colors. The resolution is 128 x 128 pixels. No one is going to expect whatever games you make to have great graphics, a fantastic soundtrack, or hundreds of levels.
But you also get immediate payoff while coding. First I drew a wig and programmed it to move back and forth on the screen when pressing the arrow keys. I then added some code to animate the wig when it moved. Then I added in a bald guy and had his head move back and forth.
As I completed each step I ran the program and celebrated. My wig can jump! I haven’t had this much fun programming since I was a wee sprig.
After a few hours of programming I have something that I can either continue to develop or abandon for another idea.
And what I’m learning has real value. How these games are made resembles how commercials games and programs are made. While the program isn’t free, the games made on the program can be shared with anyone. There are also similar fantasy consoles that are open source and free.