Table of Contents
Group 18 - Class 2526I_INT2204_6
- Phạm Minh Khởi - 24020186
- Trần Văn Thạo - 24020312
- Phạm Đức Mạnh - 24020222
Instructor: [Kiều Văn Tuyên]
Semester: [Semester 1 - 2025/2026]
This is a classic Arkanoid game developed in Java as a final project for Object-Oriented Programming course. The project demonstrates the implementation of OOP principles, design patterns, and modern software engineering practices.
Key features:
- The game is developed using Java 21 with JavaFX for GUI.
- Implements core OOP principles: Encapsulation, Inheritance, Polymorphism, and Abstraction.
- Includes sound effects, animations, visual effects, and power-up systems.
- Supports comprehensive save/load game functionality with compression and leaderboard system.
- Two-player multiplayer mode with competitive gameplay.
- Advanced memory management, resource optimization, and performance monitoring.
Game mechanics:
- Control a paddle to bounce a ball and destroy bricks
- Collect power-ups for special abilities
- Progress through multiple levels with increasing difficulty
- Score points and compete on the leaderboard
- Play with a friend in two-player mode
Main menu interface and user profile management
Single player mode with visual effects and two-player competitive gameplay
Save/Load system with thumbnails and game settings
- Multiple Brick Types: Normal bricks, strong bricks (3 hits), moving bricks, and unbreakable bricks
- Power-Up System: Expand paddle, thunder strike, gun paddle, explosion ball, and row clear
- Score System: Floating text displays score on brick destruction
- Progressive Difficulty: Multiple levels with increasing complexity
- Physics Engine: Realistic ball physics and collision detection
- Single Player: Classic Arkanoid gameplay with multiple levels
- Two Player Mode: Competitive multiplayer with:
- Dual player stats panel tracking scores and lives
- Special multiplayer level configuration
- Collision service handling inter-player interactions
- Power-up interference system
- Respawn mechanics with invincibility periods
- Game State Persistence: Save and load game progress at any time
- LZ4 Compression: Efficient storage with compression for save files
- Thumbnail Capture: Visual preview of saved games
- Multiple Save Slots: Manage multiple game saves
- Asynchronous I/O: Non-blocking save/load operations
- Session Storage: Automatic session persistence with compression
- Authentication System: Secure sign-up and sign-in with password hashing
- User Profiles: Track player statistics and achievements
- User Preferences: Customizable settings and preferences
- Inventory System: Manage purchased items and customizations
- Leaderboard: Global high score tracking
- Trail Effects: Dynamic ball and paddle trails for enhanced visuals
- Floating Text: Score popups when destroying bricks
- Line Effects: Visual feedback for special actions
- Particle System: Explosion and impact effects
- Object Pooling: Efficient reuse of visual effect objects for performance
- Memory Monitor: Real-time heap usage tracking and memory profiling
- ColorCache Utility: Efficient color object management to reduce GC pressure
- Resource Management: Proper cleanup and memory leak prevention
- Asset Preloading: Preload images and sounds for smooth gameplay
- Optimized Rendering: Enhanced rendering pipeline for brick textures and effects
- Logging System: Comprehensive logging with Logback (stdout/stderr redirection)
- Ball Skins: Purchase and equip different ball appearances
- Paddle Skins: Customize paddle visuals
- Toast Notifications: User feedback for purchases and actions
- Currency System: Earn and spend in-game currency
The game follows a modular architecture based on the Entity-Component-System (ECS) pattern with clear separation of concerns:
-
Presentation Layer (
com.arkanoid.ui)- Scene management and view controllers
- JavaFX UI components and screens
- User interaction handling
-
Business Logic Layer (
com.arkanoid.systems)- GameManager: Central game state coordinator
- LevelManager: Level loading and progression
- ThreadManager: Manages game loop and async operations
- TwoPlayerMatchManager: Multiplayer game coordination
- Save System: Game state serialization and persistence
-
Entity Layer (
com.arkanoid.core.entities)- Game objects: Ball, Paddle, Bricks, PowerUps
- Visual effects: TrailEffect, FloatingText, LineEffect
- Entity behaviors and rendering
-
Physics Layer (
com.arkanoid.core.physics)- Collision detection and resolution
- Physics engine for realistic movement
- Boundary checking
-
Data Layer (
com.arkanoid.database)- Repository pattern for data access
- Database management (SQLite)
- Entity managers: UserManager, PlayerProfileManager, InventoryManager
-
Utilities & Services
- SoundManager: Audio playback and management
- LoggingManager: Centralized logging system
- MemoryMonitor: Performance and memory tracking
- ColorCache: Object pooling for performance
- CompressionUtil: LZ4 compression for data storage
- Singleton: GameManager, SoundManager, DatabaseManager
- Factory: EntityFactory for creating game objects
- Repository: Data access abstraction layer
Used in: GameManager, SoundManager, DatabaseManager
Purpose: Ensure only one instance exists throughout the application for centralized state management.
Used in: EntityFactory, RepositoryFactory
Purpose: Create game entities (Ball, PowerUp) and repositories without exposing instantiation logic.
Used in: UserRepository, PlayerProfileRepository, GameSaveRepository
Purpose: Abstract data access layer providing clean separation between business logic and data persistence.
The game uses multiple threads to ensure smooth performance and responsive UI:
- Game Loop Thread: Updates game logic at 60 FPS with frame-rate independent timing
- Rendering Thread: JavaFX Application Thread handles graphics rendering
- Audio Thread Pool: Plays sound effects asynchronously without blocking gameplay
- I/O Thread Pool: Handles save/load operations, asset preloading, and database queries without blocking UI
- Memory Monitor Thread: Tracks heap usage and memory statistics in background
Thread Safety:
- Thread-safe collections for concurrent access
- Proper synchronization for shared state
- ThreadContext for managing thread-local state
- Executor service management via ThreadManager
- Clone the project from the repository.
- Open the project in any IDEs that supports Java and Gradle.
- Run the project from prebuilt the run task or manually trigger build on CLI using gradle wrapper.
./gradlew run
| Key | Action |
|---|---|
← |
Move paddle left |
→ |
Move paddle right |
SPACE |
Launch ball |
ESC |
Pause game |
Player 1:
| Key | Action |
|---|---|
A |
Move paddle left |
D |
Move paddle right |
SPACE |
Launch ball |
Player 2:
| Key | Action |
|---|---|
← |
Move paddle left |
→ |
Move paddle right |
ENTER |
Launch ball |
Both Players:
| Key | Action |
|---|---|
ESC |
Pause game |
- Start the game: Click "New Game" from the main menu or "Two Player" for multiplayer.
- Control the paddle: Use arrow keys (or A/D for Player 1 in multiplayer) to move left and right.
- Launch the ball: Press SPACE (or ENTER for Player 2) to launch the ball from the paddle.
- Destroy bricks: Bounce the ball to hit and destroy bricks.
- Collect power-ups: Catch falling power-ups for special abilities.
- Avoid losing the ball: Keep the ball from falling below the paddle.
- Complete the level: Destroy all destructible bricks to advance.
- Save your progress: Press ESC to pause and save your game at any time.
| Icon | Name | Effect |
|---|---|---|
| 🟦 | Expand Paddle | Increases paddle width for easier ball catch |
| ⚡ | Thunder | Lightning bolt destroys multiple bricks |
| 🔫 | Gun | Shoot lasers to destroy bricks |
| 💥 | Explosion Ball | Ball causes explosion on brick impact |
| 🧹 | Row Clear | Clears an entire row of bricks |
- Normal Brick: Breaks after one hit - standard score points.
- Strong Brick: Requires three hits to destroy - higher score value.
- Moving Brick: Moves horizontally - challenging to hit.
- Unbreakable Brick: Cannot be destroyed by normal means - requires special power-ups.
-
Additional game modes
- Time attack mode with countdown timer
- Survival mode with endless levels
- Challenge mode with special objectives
-
Enhanced gameplay
- Boss battles at end of worlds
- More power-up varieties (freeze time, shield wall, multi-ball)
- Achievements and badges system
- Daily challenges and rewards
-
Technical improvements
- Network multiplayer with online matchmaking
- Advanced particle effects and shaders
- Implement AI opponent mode
- Cloud save synchronization
- Mobile platform support (Android/iOS)
- Replay system with video recording
-
Content expansion
- Level editor for custom levels
- Community level sharing
- More customization options (themes, soundtracks)
- Seasonal events and limited-time content
| Technology | Version | Purpose |
|---|---|---|
| Java | 21 | Core language |
| JavaFX | 21.0.9 | GUI framework |
| Gradle | 9.1.0 | Build tool & dependency manager |
| SQLite (via JDBC) | Latest | Local database storage |
| LZ4 Compression | 1.8.0 | Data compression for saves |
| Logback | 1.5.12 | Logging framework |
| GSON | 2.13.2 | JSON parsing |
| JUnit | 5.11.3 | Unit testing framework |
This project is licensed under the MIT License and developed for educational purposes only.







