How ankush00123/re-snakes-and-ladders works
This is a React/Redux Snakes and Ladders game. A player rolls the die in the sidebar; the game engine advances the active player, resolves ladders and snake effects, updates game state, and the board and sidebar display the result. The graph also includes player setup, game logs, and save/load. Relationships are based on the supplied excerpts and SOURCE INDEX; unsampled implementation details are not inferred.
Main entry points: useGameEngine.js Turn Engine · save_load.js Save and Load · playerSlice.js Player State · SideBar.jsx Sidebar
Components 28
Application UI
- App Layout
src/App.jsx - Introduction Panel
src/comps/IntroductionPanel/IntroductionPanel.jsx - Board View
src/comps/Board/Board.jsx - Board Tile
src/comps/Board/Tile.jsx - Ladder Views
src/comps/Board/Ladders - Sidebar
src/comps/SideBar/SideBar.jsx - Player Controls
src/comps/PlayerContainer/PlayerContainer.jsx - Player Display
src/comps/PlayerContainer/Player.jsx - Dice Controls
src/comps/DiceBox/DiceBox.jsx - Die
src/comps/DiceBox/Dice.jsx - Die Faces
src/comps/DiceBox/Face - Game Log
src/comps/LogBox/LogBox.jsx
Gameplay
- Turn Engine
src/hooks/useGameEngine.js - Range and Delay
src/utils/checks.js - Snake Movement
src/utils/snakeutils.js - Position Conversion
src/utils/converts.js
Game State
- Redux Store
src/store/store.js - Game State
src/features/gameSlice.js - Player State
src/features/playerSlice.js - Snake State
src/features/snakeSlice.js - Ladder State
src/features/ladderSlice.js
Game Data and Persistence
- Board Data
src/data/board.js - Player Data
src/data/players.js - Snake Data
src/data/snakes.js - Ladder Data
src/data/ladders.js - Save and Load
src/utils/save_load.js
Other components
- Player
- Browser Local Storage
Connections 40
- Player → Introduction Panel: starts game
- App Layout → Introduction Panel: shows
src/App.jsx - App Layout → Board View: renders
src/App.jsx - App Layout → Sidebar: renders
src/App.jsx - Board View → Board Tile: renders
src/comps/Board/Board.jsx - Board View → Position Conversion: converts positions
src/comps/Board/Board.jsx - Board Tile → Ladder Views: renders
src/comps/Board/Tile.jsx - Board Tile → Range and Delay: checks range
src/comps/Board/Tile.jsx - Sidebar → Player Controls: renders
src/comps/SideBar/SideBar.jsx - Sidebar → Dice Controls: renders
src/comps/SideBar/SideBar.jsx - Sidebar → Game Log: renders
src/comps/SideBar/SideBar.jsx - Sidebar → Save and Load: saves and loads
src/comps/SideBar/SideBar.jsx - Player Controls → Player Display: renders
src/comps/PlayerContainer/PlayerContainer.jsx - Player Display → Player State: reads and updates
src/comps/PlayerContainer/Player.jsx - Player Display → Game State: reads game state
src/comps/PlayerContainer/Player.jsx - Dice Controls → Die: renders
src/comps/DiceBox/DiceBox.jsx - Dice Controls → Turn Engine: invokes turns
src/comps/DiceBox/DiceBox.jsx - Die → Die Faces: renders
src/comps/DiceBox/Dice.jsx - Turn Engine → Game State: dispatches game actions
src/hooks/useGameEngine.js - Turn Engine → Player State: dispatches player actions
src/hooks/useGameEngine.js - Turn Engine → Snake State: dispatches snake actions
src/hooks/useGameEngine.js - Turn Engine → Ladder State: reads ladder state
src/hooks/useGameEngine.js - Turn Engine → Range and Delay: uses timing and range
src/hooks/useGameEngine.js - Turn Engine → Snake Movement: resolves snake movement
src/hooks/useGameEngine.js - Turn Engine → Position Conversion: creates player positions
src/hooks/useGameEngine.js - Redux Store → Game State: registers reducer
src/store/store.js - Redux Store → Player State: registers reducer
src/store/store.js - Redux Store → Snake State: registers reducer
src/store/store.js - Redux Store → Ladder State: registers reducer
src/store/store.js - Game State → Board Data: initializes board
src/features/gameSlice.js - Player State → Player Data: initializes players
src/features/playerSlice.js - Player State → Position Conversion: maps positions
src/features/playerSlice.js - Snake State → Snake Data: initializes snakes
src/features/snakeSlice.js - Snake State → Position Conversion: maps positions
src/features/snakeSlice.js - Ladder State → Ladder Data: initializes ladders
src/features/ladderSlice.js - Save and Load → Browser Local Storage: reads and writes
src/utils/save_load.js - Save and Load → Game State: dispatches loaded state
src/utils/save_load.js - Save and Load → Player State: dispatches loaded state
src/utils/save_load.js - Save and Load → Snake State: dispatches loaded state
src/utils/save_load.js - Save and Load → Ladder State: dispatches loaded state
src/utils/save_load.js