How joshua122388/ponggame works
Ping Pong is a local Android Pong game: the player configures a match, starts it, moves the left paddle by touch, and plays against a difficulty-configured CPU while the score and game status update. The app separates its Compose presentation from game state and rules. The README documents physics, collisions, CPU behavior, and scoring, but the sampled source does not show the implementation or exact call wiring; those links are therefore limited to the documented MVC relationship and the visible app structure.
Main entry points: PongGameScreen.kt Game screen · GameModels.kt Game state and rules · MainActivity.kt Main activity · components Match selectors
Components 14
App entry
- Main activity
app/src/main/java/com/example/pingpong/MainActivity.kt
Compose UI
- Game screen
app/src/main/java/com/example/pingpong/ui/PongGameScreen.kt - Match selectors
app/src/main/java/com/example/pingpong/ui/components - Scoreboard
app/src/main/java/com/example/pingpong/ui/components/Scoreboard.kt - Player labels
app/src/main/java/com/example/pingpong/ui/components/PlayerLabels.kt - Pause overlay
app/src/main/java/com/example/pingpong/ui/components/PauseOverlay.kt - Game-over overlay
app/src/main/java/com/example/pingpong/ui/components/GameOverOverlay.kt - UI theme
app/src/main/java/com/example/pingpong/ui/theme
Game logic
- Game state and rules
app/src/main/java/com/example/pingpong/game/GameModels.kt
Game options
- Game modes
app/src/main/java/com/example/pingpong/game/GameMode.kt - Winner
app/src/main/java/com/example/pingpong/game/Winner.kt - Difficulty
app/src/main/java/com/example/pingpong/model/Difficulty.kt
Other components
- Player
- Android app
Connections 16
- Player → Android app: launches
- Android app → Main activity: opens
- Main activity → Game screen: shows
- Player → Game screen: touches
- Game screen → Game state and rules: controls game
- Game state and rules → Game screen: provides state
- Game screen → Match selectors: renders
- Player → Match selectors: chooses options
- Game screen → Scoreboard: renders score
- Game screen → Player labels: renders players
- Game screen → Pause overlay: renders pause
- Game screen → Game-over overlay: renders result
- Game screen → UI theme: uses styling
- Game state and rules → Difficulty: uses difficulty
- Game state and rules → Game modes: uses mode
- Game state and rules → Winner: determines winner