+
Жизни: {lives}
+
+
+ {!gameStarted ? (
+
+ ) : (
+
+ )}
+
+ {/* Модальное окно при проигрыше */}
+ {isGameOver && (
+
+
Игра окончена
+
+
+ )}
+
+ )
+}
diff --git a/packages/client/src/components/Game/collision.tsx b/packages/client/src/components/Game/collision.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/packages/client/src/components/Game/controls.tsx b/packages/client/src/components/Game/controls.tsx
new file mode 100644
index 0000000..6aa62c4
--- /dev/null
+++ b/packages/client/src/components/Game/controls.tsx
@@ -0,0 +1,46 @@
+import { KeyMap, Player } from '@/components/Game/gameTypes'
+
+const keyMap: KeyMap = {}
+
+// Обработчик нажатия клавиш
+export const handleKeyDown = (event: KeyboardEvent) => {
+ keyMap[event.key] = true
+}
+
+// Обработчик отпускания клавиш
+export const handleKeyUp = (event: KeyboardEvent) => {
+ keyMap[event.key] = false
+}
+
+// Функция для обновления позиции игрока на основе нажатых клавиш
+export const updatePlayerMovement = (
+ player: Player,
+ setPlayer: React.Dispatch