Tutorials / Build journal← All tutorials

A month of small games

On January 25, 2016, I was sick at home. Instead of opening Netflix, I bought a $6 course on making games. A small project became several, each giving me a different part of game development to learn.

These notes follow that month of experiments. The code and tool versions belong to 2016; the projects are preserved as learning material, not current production recipes. The original hosted demos are no longer available on this site; source repositories are linked where available.

Start with a small game: Jetpack Wannabe

Jetpack Wannabe sends a player after coins and away from missiles, inspired by Jetpack Joyride. I built it on January 26 from a Phaser class, part of a pay-what-you-want game-development bundle. The next day, I added a high-score table on Parse.

That gave me a game loop and a reason to connect it to a backend. The source is on GitHub.

Try the physics: Plonko and Product Hunt-o

Plonko started with the Plinko board from The Price Is Right. Tap near the top to drop a disk, and score more by landing near the middle. I wanted to explore immovable objects and Phaser’s default physics engine. Smaller disks and more obstacles were possible ways to make later levels harder.

I upgraded to Phaser 2.4.4 while working on the concept on January 27. Version one went public at 12:30 a.m. on January 28, shared on Facebook, Twitter, and Peach. The source records that experiment.

Product Hunt-o was a version with cats and images borrowed from the internet without attribution. That was how I described it in the original notes; those borrowed assets should not be assumed cleared for reuse. It launched on Product Hunt at midnight on January 28. By February 1, I was moving it to the P2 physics engine. The source repository records that work.

Turn a text game into a graphical one

togetherogue GUI was a collaboration with Ittai, begun during Hack50 at Facebook on January 28. The underlying game was a Telnet-based multiplayer roguelike. Our first task was to turn its text output into sprites.

By January 29, the proof of concept could convert a captured Telnet session into graphics. Ittai added WebSocket support on February 5, connecting the interface to the game. The live GUI proof of concept rendered that stream, with keyboard support and the first bat graphic.

The next day, I reorganized rendering around a 120-by-45 matrix. Each cell’s graphics were cleared when it was redrawn. Phaser sprite groups replaced individual sprites, making it easier to track multiple layers in a cell. Keyboard handling expanded to all keys, including uppercase input with Shift. I added potions, weapons, armor, staffs, scrolls, stairs, and water, followed by doors, zombies, centaurs, NPCs, and traps on February 7.

Integration with the full Phaser game required a preloader, a loading screen, and a disconnect screen. Version 1.0-alpha launched on February 8. That pass included the remaining monster sprites, upgraded item graphics, extra mappings for braces, performance work, and UglifyJS compression into a single production file. I also added “This House” by Kevin MacLeod of incompetech.com as background music.

On February 9, my notes recorded a 50% reduction in browser CPU use after adding the Phaser SaveCPU plugin. That was an observation from this build, not a general performance guarantee. I kept chasing rendering bugs, removed the background music, and added sounds for stairs, taking damage, and regaining health.

The interface gained a HUD on February 10, shown when maxHP > 0, plus a zap graphic for thrown objects and staff attacks. I added random dungeon residue, choosing from twelve sprites with roughly a 40% chance. The next day brought a “DEAD” indicator when health reached zero.

The beta added held direction keys and HJKL navigation on February 12. An artist’s 16-by-16 sprites began replacing my hand-drawn 24-by-24 ones. New art went live on February 17, while I tried introducing the game to other roguelike fans. Repeating-key support continued on February 18. Score joined the HUD on February 23, along with Shift-number-key support. On March 2, I restricted repeating keys to after the game began.

The development version and early proof of concept marked stages of that work. Original sprites were based on Ordinal’s sprite kit, and the interface used Kottke’s Silkscreen font. Those credits remain part of the project.

Give a donut some weight

The goal in Rollnut was to roll a donut down a ramp and see how far it traveled. Drop timing and height would change the distance. I also wanted to understand the differences between Phaser’s physics engines.

I laid out the assets on January 30. The next day, I tried P2 and downloaded PhysicsEditor. P2 could use polygon data exported by PhysicsEditor to describe an object’s physical shape. By 10 a.m., the physics was working well enough that I could think about obstacles and power-ups.

I wanted a single-tap game. A tap or the space bar would make the donut hop. One possible version was an endless level: keep hopping over obstacles until the donut stopped or fell off, then show the high-score page. That remained an idea to explore, rather than a completed feature in these notes. The source records that experiment.

What I wanted to try next

My wish list grew with each experiment: a Unity game in 3D, something released on Kongregate, an RPG, and a surfing or bodyboarding game. I wanted to try audio-led play and real-time interaction with PubNub. Side-scrolling adventures, a particle demo or vertical shooter inspired by Tyrian, and an MMO with chat were on the list too.

I hadn’t built those things yet. A small playable experiment was giving me a way to find out which parts I wanted to spend more time with.

Original reuse note: work displayed is free to use with attribution. Code is experimental and should not be used in production. © 2016. Third-party assets retain their own rights and attribution requirements.