1.3 KiB
1.3 KiB
Game Interactions Implementation
Objective
Implement basic player interactions for the MTG game, including library, battlefield, and other game mechanics.
Changes
-
Backend (
src/server/managers/GameManager.ts):- Created
GameManagerclass to handle game state. - Defined
GameState,PlayerState,CardInstanceinterfaces. - Implemented
createGame,handleAction(move, tap, draw, life). - Integrated with
socket.iohandlers inserver/index.ts.
- Created
-
Frontend (
src/client/src/modules/game):- Created
GameView.tsx: Main game board with drag-and-drop zones (Hand, Battlefield, Library, Graveyard). - Created
CardComponent.tsx: Draggable card UI with tap state. - Updated
GameRoom.tsx: Added game state handling and "Start Game (Test)" functionality.
- Created
-
Socket Service:
- Identify
start_gameandgame_actionevents. - Listen for
game_updateto sync state.
- Identify
Status
- Basic sandbox gameplay is operational.
- Players can move cards between zones freely (DnD).
- Tap/Untap and Life counters implemented.
- Test deck (Mountain/Bolt) provided for quick testing.
Next Steps
- Implement actual rules enforcement (Stack, Priority).
- Implement Deck Builder / Draft Integration (load actual drafted decks).
- Improve UI/UX (animations, better card layout).