SHARE:
Uncategorized

8-Bit Git: The Challenges of Creating a Git-Based Game (Part One)

Flatiron School / 16 June 2013

The following is a guest post by Ning Yap and originally appeared on his blog. Ning is currently a student at The Flatiron School. You can follow him on Twitter here.

I made some games, but I’m pretending like I didn’t because they all turned out weird. — Shigeru Miyamoto (creator of The Legend Of Zelda)

Game Start

After day one of using Git during a lesson @TheFlatironSchool, I developed this fantastic (and insane) idea to write a simple Git-based adventure game loosely based on my favorite video game series of all-time, The Legend of Zelda. My initial idea was to use git branches and branch switching to represent the different “worlds” containing “treasures” to be collected, like

  • Forest branch….. w/ master sword

  • Desert branch…. w/ ocarina

  • Mountain branch…. w/ fairy in a bottle

This “branch-world” idea quickly became preposterous as Git branches are not meant to be completely distinct entities, but rather different versions of a master branch and represent modest changes in files and structures. I realized I’d need a cleaner, more sensible approach.

Tutorial-Based Game

It became apparent that if I wanted to build a sensible game, I would need to actually study Git and understand how it should be used. I would have to acknowledge and draw upon Git’s power as a version control system and create a context to utilize that workflow.

Thus, The Legend of BASHellda was born. It would be a tutorial — masking as a game — played from the BASH command line. It would use sensible, beginner-friendly git commands, like

And to provide instructions to the player, I would have Princess BASHellda leave notes (in .txt format) to guide the player on what to do next.

Logistics and Building a Story

The classic story of The Legend of Zelda involves a hero saving a princess from an evil wizard through the use of key items, such as a magical sword. Here is how I mapped those characters and items

And here are the branches or “worlds”

Sample note from the Princess in .txt file accessible by running cat command in BASH

Building the Local Repository

Figuring out the gameplay logistics was half the battle. The other half was actually coding and “building the levels” in the repository. Here are some of the major issues I ran into as I built and played through the initial stages of the game:

  • In what finished form should the repository be so, when pushed up to GitHub, it is playable when cloned
  • Will the player have access to the different branches after cloning
  • How to deal with the branch merges so there are no conflicts
  • How to leave clear and concise instructions with moderate difficulty so as not to make the game too easy and boring or unplayable and confusing for a beginner

In building the repository, order of creating branches and adding folders and files was extremely important as to not cross-pollute other branches. For example, I would want

to be replaced by

after running

on the master branch. Here’s what the palace “looks like” after the player merges from backup.

I’ll continue this blog post next week with details about the finished game and maybe even some player feedback!

Next week, read Part TWO of this series 

Mentally Reframing Ruby – Part 2 Previous Post What I Learned About Programming From a Delivery Guy Next Post