use of com.gemserk.animation4j.gdx.AnimationFrameMonitor in project commons-gdx by gemserk.
the class AnimationMonitorTest method shouldNotBeShownWhenStarted.
@Test
public void shouldNotBeShownWhenStarted() {
Animation animation = new Animation(new Sprite[] {}, new FrameAnimationImpl(true, 50f, 25f, 30f));
AnimationFrameMonitor animationMonitor = new AnimationFrameMonitor(animation, 50f);
animation.update(1f);
animationMonitor.update();
assertFalse(animationMonitor.isTriggered());
}
use of com.gemserk.animation4j.gdx.AnimationFrameMonitor in project commons-gdx by gemserk.
the class AnimationMonitorTest method shouldNotTriggerAgainOnDifferentAnimationIterationButUpdatedTwice.
@Test
public void shouldNotTriggerAgainOnDifferentAnimationIterationButUpdatedTwice() {
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 + 50f);
animationMonitor.update();
animationMonitor.update();
assertFalse(animationMonitor.isTriggered());
}
use of com.gemserk.animation4j.gdx.AnimationFrameMonitor in project commons-gdx by gemserk.
the class AnimationMonitorTest method shouldTriggerAgainOnDifferentAnimationIteration.
@Test
public void shouldTriggerAgainOnDifferentAnimationIteration() {
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 + 50f);
animationMonitor.update();
assertTrue(animationMonitor.isTriggered());
}
use of com.gemserk.animation4j.gdx.AnimationFrameMonitor in project commons-gdx by gemserk.
the class AnimationMonitorTest method shouldTriggerIfDirecltyChangedIteration.
@Test
public void shouldTriggerIfDirecltyChangedIteration() {
Animation animation = new Animation(new Sprite[] {}, new FrameAnimationImpl(true, 50f, 25f, 30f));
AnimationFrameMonitor animationMonitor = new AnimationFrameMonitor(animation, 50f);
animation.update(50f + 25f + 31f);
animationMonitor.update();
assertTrue(animationMonitor.isTriggered());
}
use of com.gemserk.animation4j.gdx.AnimationFrameMonitor in project commons-gdx by gemserk.
the class AnimationMonitorTest method shouldNotReturnTriggerTwice.
@Test
public void shouldNotReturnTriggerTwice() {
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();
assertFalse(animationMonitor.isTriggered());
}
Aggregations