Imp.js 383 B

12345678910111213141516171819
  1. var game = Atomic.game;
  2. var node = self.node;
  3. var animationSet = game.cache.getResource("AnimationSet2D", "Sprites/imp.scml");
  4. var sprite2D = node.createComponent("AnimatedSprite2D");
  5. self.playAnimation = function(animation) {
  6. sprite2D.setAnimation(animationSet, animation, Atomic.LM_FORCE_LOOPED);
  7. }
  8. function start() {
  9. sprite2D.setAnimation(animationSet, "idle");
  10. }