Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

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
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!

1 decade ago by Graphikos

Not a frame function.. but should be a frame property.

http://impactjs.com/documentation/class-reference/animation#frame

1 decade ago by Xatruch

Thanks Graphikos! Think I need to read the docs more often...
Page 1 of 1
« first « previous next › last »