Inspiration

I love Zachtronics games. And hence, I decided to try my hand at making a game based off of programming!

What it does

It's a game where you execute custom Inject.ion commands to traverse a network and alter data and your store to complete a given task.

How I built it

I used vanilla HTML5, CSS3, and CoffeeScript initially, as I wanted to use this as a way to learn CS. I used jQuery (because what web project doesn't have jQuery) as well as Canvas to draw the actual network.

I built the structure of the view first, then built the model. I knew the view would have a textarea to write code, and a button to run it. After that, I started simultaneous work on the model and controller. I built the InjectionRunner, Node, and command dictionary in tandem. I created the dictionary initially to only house three commands: "inject", "return", and "set". As my program evolved though, I realized that there were many more I could do. I created mathy methods and loops much later in the competition. Wrangling with Canvas was a bit difficult, and I had to use a piece of paper to do some basic trig, but I managed to get a somewhat nice display of a network going. After that, I decided to put my network diagrams in JSON files, and load them into the CS. This way, levels can be modular, and switched to and from easily. After that, I needed to generate a win condition for levels, and check on running whether that condition was met. There were many various other changes; using pink as a color scheme (a happy accident by randomly tinting the device icons), the creation of a manual, three more buttons, a level description addition, and a lot more.

Challenges I ran into

Accomplishments that I'm proud of

What I learned

It was a fantastic refresher on Canvas and jQuery, and I learned quite a bit of CoffeeScript as well! I'll definitely, strongly consider CS for my next project.

What's next for Inject.ion

Definitely syntax checking and infinite loop prevention. After that, who knows? Graphics updates, larger breadth of commands, more types of devices, there is so much more that Inject.ion can be!

Share this project:
×

Updates