add delay to see attack animation

- add short delay to see player and mob attack animation before the duel starts
This commit is contained in:
Anthony Calosa
2022-05-26 13:11:15 +08:00
parent e0a16981ff
commit 644b1c051a
2 changed files with 32 additions and 26 deletions

View File

@@ -662,7 +662,9 @@ public class MapStage extends GameStage {
currentMob = mob; currentMob = mob;
player.setAnimation(CharacterSprite.AnimationTypes.Attack); player.setAnimation(CharacterSprite.AnimationTypes.Attack);
mob.setAnimation(CharacterSprite.AnimationTypes.Attack); mob.setAnimation(CharacterSprite.AnimationTypes.Attack);
SoundSystem.instance.play(SoundEffectType.Block, false);
Gdx.input.vibrate(50); Gdx.input.vibrate(50);
startPause(0.8f, () -> {
Forge.setCursor(null, Forge.magnifyToggle ? "1" : "2"); Forge.setCursor(null, Forge.magnifyToggle ? "1" : "2");
SoundSystem.instance.play(SoundEffectType.ManaBurn, false); SoundSystem.instance.play(SoundEffectType.ManaBurn, false);
DuelScene duelScene = ((DuelScene) SceneType.DuelScene.instance); DuelScene duelScene = ((DuelScene) SceneType.DuelScene.instance);
@@ -679,6 +681,7 @@ public class MapStage extends GameStage {
}, ScreenUtils.getFrameBufferTexture(), true, false)); }, ScreenUtils.getFrameBufferTexture(), true, false));
} }
}); });
});
} }
public void setPointOfInterest(PointOfInterestChanges change) { public void setPointOfInterest(PointOfInterestChanges change) {

View File

@@ -84,7 +84,9 @@ public class WorldStage extends GameStage implements SaveFileContent {
if (player.collideWith(mob)) { if (player.collideWith(mob)) {
player.setAnimation(CharacterSprite.AnimationTypes.Attack); player.setAnimation(CharacterSprite.AnimationTypes.Attack);
mob.setAnimation(CharacterSprite.AnimationTypes.Attack); mob.setAnimation(CharacterSprite.AnimationTypes.Attack);
SoundSystem.instance.play(SoundEffectType.Block, false);
Gdx.input.vibrate(50); Gdx.input.vibrate(50);
startPause(0.8f, () -> {
Forge.setCursor(null, Forge.magnifyToggle ? "1" : "2"); Forge.setCursor(null, Forge.magnifyToggle ? "1" : "2");
SoundSystem.instance.play(SoundEffectType.ManaBurn, false); SoundSystem.instance.play(SoundEffectType.ManaBurn, false);
DuelScene duelScene = ((DuelScene) SceneType.DuelScene.instance); DuelScene duelScene = ((DuelScene) SceneType.DuelScene.instance);
@@ -97,6 +99,7 @@ public class WorldStage extends GameStage implements SaveFileContent {
currentMob = mob; currentMob = mob;
WorldSave.getCurrentSave().autoSave(); WorldSave.getCurrentSave().autoSave();
}); });
});
break; break;
} }
} }