Created
October 17, 2019 21:40
-
-
Save Wolwer1nE/1883945ea8caaf7df94c325e8902af2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
createAnimations: function() | |
{ | |
//тут я генерил анимации мальчику и девочке | |
this.createAnimation("side", [1, 7, 1, 13] ); | |
this.createAnimation("up", [2, 8, 2, 14] ); | |
this.createAnimation("down", [ 0, 6, 0, 12 ] ); | |
this.createAnimation("enemy_down", [ 21, 27, 21, 33 ]); | |
this.createAnimation("searcher_side", [4, 10, 4, 16] ); | |
this.createAnimation("searcher_up", [5, 11, 5, 17] ); | |
this.createAnimation("searcher_down", [ 3, 9, 3, 15 ] ); | |
//Тут я внезапно понял, что может быть больше 1 spritesheet, когда появился панк | |
this.createAnimation('redhead_jump',[4,5,6], 'redhead'); | |
}, | |
//обертка создания анимаций | |
createAnimation: function(key, frames, spritesheet='player') | |
{ | |
this.anims.create({ | |
key: key, | |
frames: this.anims.generateFrameNumbers(spritesheet, { frames: frames }), | |
frameRate: 10, | |
repeat: -1 | |
}); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment