export class Robe {
    constructor(public sprite:Phaser.Sprite) {
        sprite.smoothed = false;
        sprite.scale.setTo(1.5, 1.5);
        sprite.animations.add('down', ['01.png', '02.png', '03.png', '04.png'], 6, true, false);
        sprite.animations.add('up', ['05.png', '06.png', '07.png', '08.png'], 6, true, false);
        sprite.animations.add('left', ['09.png', '10.png', '11.png', '12.png'], 6, true, false);
        sprite.animations.add('right', ['13.png', '14.png', '15.png', '16.png'], 6, true, false);
        sprite.animations.add('hands_up_down', ['17.png', '18.png', '19.png'], 4, true, false);
        sprite.animations.add('fall', ['24.png', '25.png'], 2, false, false);
        sprite.animations.add('naked', ['26.png'], 1, false, false);
    }

    turnLeft = ()=> {
        this.animLeft();
        this.sprite.animations.stop();
    };

    turnRight = ()=> {
        this.animRight();
        this.sprite.animations.stop();
    };

    turnUp = ()=> {
        this.animUp();
        this.sprite.animations.stop();
    };

    turnDown = ()=> {
        this.animDown();
        this.sprite.animations.stop();
    };

    animLeft = ()=> {
        this.sprite.play('left');
    };

    animRight = ()=> {
        this.sprite.play('right');
    };

    animUp = ()=> {
        this.sprite.play('up');
    };

    animDown = ()=> {
        this.sprite.play('down');
    };

    walkLeft = ()=>{
        this.sprite.position.add(-2, 0);
    };

    walkRight = ()=>{
        this.sprite.position.add(2, 0);
    };

    walkUp = ()=>{
        this.sprite.position.add(0, -2);
    };

    walkDown = ()=>{
        this.sprite.position.add(0, 2);
    };
}