I have one sprite sheet and for only one row the width and height of the tiles are smaller, so I've tried to compile the same sheet 2 times with different data.
But when I tried to set them in a function, I get an error TypeError: anim is undefined -> rate = anim.rate || p.rate,
Here is the code:
hadouken: function(){
console.log(this.p.sheet + ', ' + this.p.sprite);
this.set({sheet: 'attack', sprite : 'ken_attack'}); // setting the second compiled sheet and animations
console.log(this.p.sheet + ', ' + this.p.sprite);
if(this.p.direction == "right")
this.play('hadouken_pose_right', 1);
else if(this.p.direction == "left")
this.play('hadouken_pose_left', 1);
this.set({sheet: 'ken', sprite : 'ken_movement'}); // setting the first compiled sheet and animations
console.log(this.p.sheet + ', ' + this.p.sprite);
},
Hi,
I have one sprite sheet and for only one row the width and height of the tiles are smaller, so I've tried to compile the same sheet 2 times with different data.
But when I tried to set them in a function, I get an error
TypeError: anim is undefined -> rate = anim.rate || p.rate,
Here is the code:
Here is the load function:
Creating another Sprite object and adding it to the player Sprite will work, or is there another way to do so?