feat(battleship): add complete Battleship game UI with placement & battle phases
- Implement BattleshipBoard with phase-based rendering (placement/battle) - Add PlacementGrid for ship placement interaction - Add ShotGrid for firing UI with turn validation - Integrate match metadata (pX_placed, pX_ready, phase) - Connect UI to Nakama sendMatchData (place + shoot actions) - Add real-time board rendering for ships and shots - Add status line, turn handling, and winner display - Ensure compatibility with new backend ApplyMove/ApplyPlacement logic
This commit is contained in:
24
src/games/battleship/components/StatusBar.tsx
Normal file
24
src/games/battleship/components/StatusBar.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import React from "react";
|
||||
import { motion } from "framer-motion";
|
||||
|
||||
interface StatusBarProps {
|
||||
text: string;
|
||||
}
|
||||
|
||||
export default function StatusBar({ text }: StatusBarProps) {
|
||||
return (
|
||||
<motion.div
|
||||
key={text}
|
||||
initial={{ opacity: 0, y: -6 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ duration: 0.25 }}
|
||||
style={{
|
||||
marginBottom: 8,
|
||||
fontSize: "18px",
|
||||
textAlign: "center",
|
||||
}}
|
||||
>
|
||||
{text}
|
||||
</motion.div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user