use of com.gemserk.animation4j.gdx.AnimationFrameMonitor in project commons-gdx by gemserk.
the class AnimationMonitorTest method shouldNotTriggerIfNotFrameOnSecondIteration.
@Test
public void shouldNotTriggerIfNotFrameOnSecondIteration() {
Animation animation = new Animation(new Sprite[] {}, new FrameAnimationImpl(true, 50f, 25f, 30f));
AnimationFrameMonitor animationMonitor = new AnimationFrameMonitor(animation, 50f);
animation.update(51f);
animationMonitor.update();
animationMonitor.update();
animation.update(25f + 30f + 25f);
animationMonitor.update();
assertFalse(animationMonitor.isTriggered());
}
use of com.gemserk.animation4j.gdx.AnimationFrameMonitor in project commons-gdx by gemserk.
the class AnimationMonitorTest method testWasShowWhenItShouldBe.
@Test
public void testWasShowWhenItShouldBe() {
Animation animation = new Animation(new Sprite[] {}, new FrameAnimationImpl(true, 50f, 25f, 30f));
AnimationFrameMonitor animationMonitor = new AnimationFrameMonitor(animation, 50f);
animation.update(51f);
animationMonitor.update();
assertTrue(animationMonitor.isTriggered());
}
use of com.gemserk.animation4j.gdx.AnimationFrameMonitor in project commons-gdx by gemserk.
the class AnimationMonitorTest method shouldHadBeenShownIfGreaterFrame.
@Test
public void shouldHadBeenShownIfGreaterFrame() {
Animation animation = new Animation(new Sprite[] {}, new FrameAnimationImpl(true, 50f, 25f, 30f));
AnimationFrameMonitor animationMonitor = new AnimationFrameMonitor(animation, 50f);
animation.update(76f);
animationMonitor.update();
assertTrue(animationMonitor.isTriggered());
}
Aggregations