1 decade ago by Xatruch
Hey guys, wanted to know if its possible to get the current frame from the current animation. Maybe ill explain better with an example..
lets say that the player can only hit the enemy when he uses the sword attack, but also just when the player animation actually hits with the sword which the frames are 2 and 3
I know that thereĀ“s not .frame() function that returns the current animation frame or similar in the animation class. Could anybody please help me, to get a function that does that :P thanks!
lets say that the player can only hit the enemy when he uses the sword attack, but also just when the player animation actually hits with the sword which the frames are 2 and 3
check: function(other){ if(this.currentAnim == this.anims.swordAttack){ if(this.currentAnim.frame() == 2 || this.currentAnim.frame() == 3){ other.recieveDamare(5, this); } } }
I know that thereĀ“s not .frame() function that returns the current animation frame or similar in the animation class. Could anybody please help me, to get a function that does that :P thanks!