This is the MIT-licensed source code for https://www.codako.org/. Feel free to use it in whole or in part. If your contributions would benefit the core project, please feel free to open pull requests!
Codako is a programming-by-demonstration tool that allows anyone to create simulations (worlds) containing one or more stages (2D grids) and build their own games. Codako allows you to draw your own characters, demonstrate rules they should follow, manage control flow and handle events, and create interactive experiences.
In Codako's source code, the following terminology is used:
-
characterrefers to a "class" in your game -
actorrefers to an instance of acharacterat a particular position with a particular state. -
stagerefers to the two-dimensional grid that contains actors. -
worldrefers to the overall game, which may contain one or more stages. -
rulesare attached to characters and define requirements that must be matched, andactionsthat are taken. Rules can be nested insideflow containers, which apply control flow policies (eg: run a random rule in this group, run all rules in this group), or event handlers. (eg: run this group when a key is pressed)