Unity 6.2 port of the CenterBall 3D precision ball game with full feature parity and multi-platform support.
This is a comprehensive Unity implementation of CenterBall, originally built with React + Three.js for the web. The Unity version maintains complete feature parity while adding native platform support for mobile and desktop.
Features:
- ๐ฎ Full 3D physics-based gameplay
- ๐ฑ Multi-platform support (WebGL, iOS, Android, Windows, Mac, Linux)
- ๐จ Modern UI with glass-morphic design (UI Toolkit)
- ๐ต Complete audio system with sound effects and music
- ๐ Player statistics, achievements, and leaderboards
- โ๏ธ Dual physics modes: Arcade (simplified) and Realistic (simulation)
- ๐ Interactive 8-step tutorial system
- ๐ 6 preset color themes
- โฟ Accessibility features (reduced motion, high contrast, large text)
- Original web version: https://centerball.netlify.app
- Web repository: https://github.com/non-relating/CenterBall
- Unity repository: https://github.com/non-relating/CenterBall-Unity
Assets/CenterBall/
โโโ Scripts/
โ โโโ Core/ # Game logic (ScoreCalculator, etc.)
โ โโโ Data/ # Data models and constants
โ โโโ Managers/ # Game managers (GameManager, AudioManager, etc.)
โ โโโ Physics/ # Physics systems (Arcade, Realistic)
โ โโโ UI/ # UI controllers
โ โโโ Utilities/ # Helper functions
โโโ Prefabs/ # Ball prefabs, UI prefabs
โโโ Materials/ # PBR materials for balls and table
โโโ Textures/ # Ball textures and table texture (1.6MB total)
โโโ Scenes/ # Game scenes (Menu, Game, Settings, Leaderboard)
โโโ Audio/ # Sound effects and music
โโโ UI/
โ โโโ UXML/ # UI Toolkit structure files
โ โโโ USS/ # UI Toolkit stylesheets
โ โโโ Runtime/ # Runtime UI components
โโโ Resources/ # Runtime loadable assets
Packages/
โโโ manifest.json # Unity package dependencies
ProjectSettings/ # Unity project configuration
Current State: Foundation Complete (Phase 1-3 Partial)
- โ Unity 6.2 project structure
- โ Multi-platform build configuration (WebGL, iOS, Android, PC)
- โ Texture assets imported (1.6MB - balls + table)
- โ Core data models (GameConstants, GameState, BallData, PhysicsConfig)
- โ Complete arcade physics system (exact port from web version)
- โ Scoring calculator (3-tier scoring system)
- โ GameManager skeleton with event system
- ๐ ~72-92 C# scripts remaining (see DEVELOPMENT_ROADMAP.md)
- ๐ UI implementation (UI Toolkit UXML/USS)
- ๐ Audio system
- ๐ Input handling
- ๐ Statistics & achievements
- ๐ Visual effects and polish
See DEVELOPMENT_ROADMAP.md for complete implementation plan.
Unity 6.2 (6000.0.24f1) - Latest Unity 6 release
- Input System 1.11.2
- TextMeshPro 3.2.0-pre.8
- UI Toolkit (uGUI) 2.0.0
- Newtonsoft JSON 3.2.1
- Universal Render Pipeline 17.0.3
- WebGL: Browser-based, PWA-ready
- iOS: Native iOS app (Xcode 14+)
- Android: Native Android app (API 24+)
- PC Standalone: Windows, Mac, Linux
The game includes two physics modes, both fully editable in the Unity Inspector via PhysicsConfig ScriptableObject:
-
Arcade Physics (Default):
- Simplified trajectory calculation
- Boundary bouncing with energy loss
- Predictable, fun gameplay
- Configurable parameters: bounce coefficient, force multiplier, movement multiplier
-
Realistic Physics (Optional):
- Full timestep simulation
- Friction-based deceleration
- Ball-to-ball collision detection (optional)
- Energy loss on impacts
- Singleton Pattern: Core managers (GameManager, AudioManager, etc.)
- Event-Driven: C# events for loose coupling between systems
- ScriptableObjects: Configuration data (PhysicsConfig, AudioConfig, etc.)
- UI Toolkit: Modern, performance-focused UI with UXML/USS
- Unity 6.2 (6000.0.24f1) or later
- Unity Hub (recommended)
- For iOS builds: macOS with Xcode 14+
- For Android builds: Android SDK and NDK
-
Clone this repository:
git clone https://github.com/non-relating/CenterBall-Unity.git cd CenterBall-Unity -
Open Unity Hub
-
Click "Open" and select the
CenterBall-Unityfolder -
Unity will import all packages and assets (may take a few minutes on first open)
- File โ Build Settings โ WebGL
- Click "Switch Platform"
- Click "Build" and select output folder
- File โ Build Settings โ iOS
- Click "Switch Platform"
- Click "Build" to export Xcode project
- Open exported project in Xcode
- Configure signing and build
- File โ Build Settings โ Android
- Click "Switch Platform"
- Click "Build" to create APK or AAB
- File โ Build Settings โ Windows/Mac/Linux
- Click "Switch Platform"
- Click "Build" to create executable
Two players compete to position their balls closest to a center ball to score points.
- 3 points: Ball touching center ball AND both balls in center ring (radius 2.5)
- 2 points: Ball in center ring but NOT touching center ball
- 1 point: Closest ball to center ball (outside the ring)
- Each player has 5 balls
- Players alternate turns shooting one ball at a time
- Control angle (0-360ยฐ) and power (0-100%)
- After all balls are played, round scores are calculated
- First player to reach target score (11 or 21) wins
- Standard: First to 21 points
- Quick: First to 11 points
Scripts/Data/GameConstants.cs- Game rules and physics constantsScripts/Data/VisualConstants.cs- Camera, lighting, and rendering settingsScripts/Data/GameState.cs- Complete game state managementScripts/Data/BallData.cs- Ball position and state dataScripts/Data/PhysicsConfig.cs- Editable physics configuration (ScriptableObject)Scripts/Physics/ArcadePhysics.cs- Arcade physics engineScripts/Core/ScoreCalculator.cs- Scoring logicScripts/Managers/GameManager.cs- Main game manager
Packages/manifest.json- Unity package dependenciesProjectSettings/ProjectSettings.asset- Build and platform settings
DEVELOPMENT_ROADMAP.md- Complete development plan and progress trackingREADME.md- This file
This is a port of an existing web game. For consistency, new features should:
- Match the web version behavior exactly (unless improving)
- Use the established architecture patterns
- Be fully cross-platform compatible
- Include editable parameters in ScriptableObjects or Inspector
- Desktop: 60 FPS
- Mobile: 30-60 FPS (adaptive)
- WebGL Build: <50 MB compressed
- Mobile Builds: <100 MB
MIT License - See LICENSE file for details
- Original Web Version: CenterBall team (https://github.com/non-relating/CenterBall)
- Unity Port: In active development
- Physics Engine: Ported from web version with Unity adaptations
- Textures: Original assets from web version (optimized for Unity)
- Web Version: https://centerball.netlify.app
- Web Repository: https://github.com/non-relating/CenterBall
- Unity Repository: https://github.com/non-relating/CenterBall-Unity
- Development Roadmap: DEVELOPMENT_ROADMAP.md
Last Updated: October 19, 2025 Unity Version: 6.2 (6000.0.24f1) Status: Foundation Complete - Active Development