Initial Doodad JavaScript System

* Add the JavaScript system for Doodads to run their scripts in levels,
  and wire initial OnCollide() handler support.
* CLI: Add a `doodad install-script` command to the doodad tool.
  * Usage: `doodad install-script <index.js> <filename.doodad>`
* Add dev-assets folder for storing source files for the official
  default doodads, sprites, levels, etc. and for now add a JavaScript
  for the first test doodad.
This commit is contained in:
Noah 2019-04-15 23:07:15 -07:00
commit 8c19000603

View File

@ -0,0 +1,13 @@
// Test Doodad Script
function main() {
console.log("I am actor ID " + Self.ID());
// Set our doodad's background color to pink. It will be turned
// red whenever something collides with us.
Self.Canvas.SetBackground(RGBA(255, 153, 255, 153));
Events.OnCollide( function(e) {
console.log("Collided with something!");
Self.Canvas.SetBackground(RGBA(255, 0, 0, 153));
});
}