Codebot: teaching programming as a game

I just spent the night on building Codebot, a little Web-based prototype for learning programming by playing.

In Codebot, you’re tasked with taking a robot from point A to point B by… writing a program! See for yourself:

You can try it out too. Obviously this is just basic demo. The game could be expanded with more levels, each teaching new programming concepts. For instance a level could sport enemies and traps whose behaviors or positions change from run to run, and the player would have to make its robot’s program able to sense them and take decisions based on its surroundings.

I was able to build this prototype in just four hours by using the following amazing open source projects:

  • Three.js for rendering (using WebGL)
  • Lua.js, an implementation of the Lua programming language in JavaScript. I planned to go with an emscriptened version of Lua first but there was no neatly-packaged ready-to-use build so I gave up.
  • Ace, a powerful code editor widget for the Web with many cool features, coupled with these Lua highlight rules

Pretty awesome how fast and far you can go with the right tools. Thanks a lot to everyone who contributed to these!

I hope to take this experiment further later on, but for now, I have a lot work to do to get ready for a big CraftStudio-related announcement on March 13th… See you then!