How tshedisob/space-invaders-game works
Space Invaders is a browser-based React game. The player enters a name, then controls a shooter to move and fire at invaders; collisions or clearing the invaders end the round, with a replay option. Redux holds player and game state, while a saga delays the game-over transition. The graph preserves the documented controls, scoring, and obstacle/monster end conditions; some of those capabilities are described in the README but are not fully visible in the sampled game code.
Main entry points: Game.js Game Loop · PlayerNameForm.js Player Name Form · GameOver.js Game Over · store.js Redux Store
Components 19
Entry and Setup
- React Entry
src/index.js - App Shell
src/Components/App.js - Player Name Form
src/Components/PlayerNameForm.js
Game Experience
- Game Loop
src/Components/Game.js - Game Header
src/Components/Header.js - Game Sidebar
src/Components/SideBar.js - Stats Display
src/Components/StatsDisplay.js - Game Rules
src/Components/GameRules.js - Button Highlights
src/Components/ButtonsHighlight.js - Game Over
src/Components/GameOver.js - Win Celebration
src/Components/Celebrate.js
State Management
- Redux Store
src/Redux/store.js - Game Over Saga
src/Redux/sagas.js - Game Actions
src/Redux/GameStats/actions.js - Game State Reducer
src/Redux/GameStats/reducer.js - Player Actions
src/Redux/PlayerName/actions.js - Player State Reducer
src/Redux/PlayerName/reducer.js
Game Utilities
- Grid Helpers
src/utils/helper.js
Other components
- Player
Connections 24
- Player → Player Name Form: enters name
README.md - Player → Game Loop: controls shooter
README.md - React Entry → Redux Store: provides state
src/index.js - React Entry → App Shell: renders
src/index.js - App Shell → Player Name Form: renders
src/Components/App.js - Player Name Form → Game Loop: starts game
src/Components/PlayerNameForm.js - Player Name Form → Grid Helpers: hides form
src/Components/PlayerNameForm.js - Player Name Form → Player Actions: dispatches name
src/Components/PlayerNameForm.js - Game Loop → Game Header: renders
src/Components/Game.js - Game Loop → Game Sidebar: renders
src/Components/Game.js - Game Loop → Game Rules: renders
src/Components/Game.js - Game Loop → Game Over: shows on end
src/Components/Game.js - Game Loop → Grid Helpers: draws invaders
src/Components/Game.js - Game Loop → Game Actions: dispatches updates
src/Components/Game.js - Game Loop → Game State Reducer: tracks game state
- Game Sidebar → Stats Display: renders
src/Components/SideBar.js - Game Sidebar → Button Highlights: renders
src/Components/SideBar.js - Game Over → Win Celebration: shows on win
src/Components/GameOver.js - Game Over → Game Actions: dispatches replay
src/Components/GameOver.js - Game Over → Game State Reducer: reads outcome
- Redux Store → Game Over Saga: runs saga
src/Redux/store.js - Redux Store → Game State Reducer: combines reducer
src/Redux/store.js - Redux Store → Player State Reducer: combines reducer
src/Redux/store.js - Game Over Saga → Game Actions: dispatches delayed end
src/Redux/sagas.js