Inspiration

This is the first hack I've properly done for a hackathon. The idea here was to combine my desire to make an app that was fun and engaging with my hope that I could create something with some kind of long-term use or payoff beyond just entertainment value. The game is loosely inspired by predecessors like Grid World or Karel the Robot.

What it does

The user plays a game where they must type basic functions (moveRight(), moveLeft(), etc.) to navigate a spaceship along a path towards a destination. As the levels pass, the paths become more complex and the player must learn to combine new commands. Eventually fog, enemies and other obstacles will force the player to think creatively and use if-statements, for-loops and while-loops to make their way to their destination. The aim of the game is to gradually introduce the player to more advanced programming concepts with each level, intending to teach not only how programming works syntactically but also some deeper lessons about the nature of abstraction.

How I built it

The game grid itself is created using HTML Canvas, while the editor used to take user inputs is the ACE Editor. All parsing of the resulting code is done through JavaScript function. A little jQuery was used for site interactivity. While I was the only person coding on this project, I received a lot of help and support from my significantly more knowledgeable friend Amol Kapoor.

Challenges I ran into

My very basic knowledge of JavaScript syntax and especially object/function scope proved to be a difficulty early on; while I could imagine what I wanted to accomplish with the game, for a long time it was difficult to figure out how exactly to connect various moving pieces together to make it happen. I also struggled for a while with HTML Canvas, which was something I had never been exposed to before.

Accomplishments that I'm proud of

I think that the game is designed in such a way that a relatively small amount of player inputs can result in a fairly large variety of possible challenges; I think this is a prototype with a lot of potential that could eventually become a much longer, very interesting educational experience.

What I learned

A lot about JavaScript and HTML, and almost as much about my ability to go without sleep.

What's next for TBD: An Educational Game

I'd like to add more levels, and eventually get into adding enemies or other obstacles with independent AI (so the player will have to create methods to dodge enemies or stay still while they move past, etc.). I'd also like to add more detailed instructions (and possibly even a story!) to guide a new player along.

Share this project:

Updates