"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var key = 'pig';
/**
 * 
 * @param {Phaser.Scene} scene 
 */

function loadSprite(scene) {
  scene.load.spritesheet(key, require('../assets/pig.png'), {
    frameWidth: 256,
    frameHeight: 256
  }); // var shardsImg = new Image();
  // shardsImg.onload = () => {
  //   scene.textures.addSpriteSheet(key, shardsImg, { frameWidth: 256, frameHeight: 256 });
  // };
  // shardsImg.src = require('../assets/pig.png');
}
/**
 * 
 * @param {Phaser.Scene} scene 
 */


function makeAnimation(scene) {
  scene.anims.create({
    key: 'pig',
    frames: scene.anims.generateFrameNumbers(key, {
      start: 0,
      end: 4
    }),
    frameRate: 6,
    repeat: -1,
    yoyo: true
  });
}
/**
 * 
 * @param {Phaser.Scene} scene 
 */


var _default = {
  loadSprite: loadSprite,
  makeAnimation: makeAnimation
};
exports["default"] = _default;