Fire weapons

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-13 20:36:40 +01:00
parent fb2b297900
commit 029e90ea9d
6 changed files with 143 additions and 1 deletions

View File

@@ -300,6 +300,13 @@ class _WolfRendererState extends State<WolfRenderer>
});
}
// 5. Fire weapon
bool isCtrlPressed = pressedKeys.contains(LogicalKeyboardKey.controlLeft);
if (isCtrlPressed) {
player.fire(elapsed.inMilliseconds);
}
player.updateWeapon(elapsed.inMilliseconds);
// Fade out the damage flash smoothly
if (damageFlashOpacity > 0) {
damageFlashOpacity = math.max(0.0, damageFlashOpacity - 0.05);