doodle/dev-assets/doodads/doors/electric-door.js
Noah Petherbridge a73dec9f31 Doodad Animations Managed In-Engine
* Add animation support for Doodad actors (Play Mode) into the core
  engine, so that the Doodad script can register named animations and
  play them without managing all the details themselves.
  * Doodad API functions on Self: AddAnimation, PlayAnimation,
    StopAnimation, IsAnimating
* CLI: the `doodad convert` command will name each layer after the
  filename used as the input image.
* CLI: fix the `doodad convert` command creating duplicate Palette
  colors when converting a series of input images into a Doodad.
2019-05-06 15:30:43 -07:00

17 lines
320 B
JavaScript

function main() {
console.log("%s initialized!", Self.Doodad.Title);
var err = Self.AddAnimation("open", 100, [0, 1, 2, 3]);
console.error("door error: %s", err)
var animating = false;
Events.OnCollide(function() {
if (animating) {
return;
}
animating = true;
Self.PlayAnimation("open", null);
});
}