A JavaFX-based space-themed RPG game featuring multiple game modes, multiplayer PvP battles, character progression, and an in-game marketplace.
- Overview
- Features
- Technology Stack
- Prerequisites
- Installation
- How to Run
- Game Mechanics
- Project Structure
- User Data
- Contributing
Beyond The Galaxy is an immersive space adventure game where players navigate through various levels, battle monsters, collect resources, upgrade their characters, and compete against other players in real-time PvP combat. The game features a comprehensive progression system with weapons, shields, special cards, and a player-driven marketplace.
Click the link above to watch the complete gameplay demonstration showcasing all features in action!
- Guest Mode: Play without creating an account - explore the game world freely
- Story Mode: Progress through 3 main levels (Level 1, 2, 3) with increasing difficulty
- Phase Mode: Additional 3 phases with unique challenges
- PvP Mode: Real-time multiplayer battles against other players
- Account System: Create and manage player accounts with secure login
- Character Progression:
- Collect and upgrade weapons
- Enhance shields for better defense
- Acquire special cards with unique powers (6 different cards)
- Track total character power
- Resource Management: Collect 3 types of resources to build your spaceship
- Gem Economy: Earn and spend gems throughout the game
- Shop Marketplace:
- Buy special cards from other players
- Sell your own cards at custom prices
- Real-time marketplace updates
- Global Chat: Communicate with other online players
- Leaderboard: Track top players and rankings
- Sound System: Background music and sound effects with mute controls
- Projectile-based Combat: Shoot projectiles in all directions (standard 4 directions, with 8-directional and 16-directional spell patterns for card upgrades)
- Active Card Combat System: Cast powerful combat spells by pressing
Ebased on your highest owned Special Card (includes glassmorphism card slot, cooldown overlay, circular particle bursts, pulsing shields, chronos time warp time-dilation, vampiric heal, and giga laser!) - Instant-Action Enemy Relocation: Relocated initial monsters along the main path to provide instant gameplay engagement right at the starting area, and extended their player detection triggers to cover your initial spawn coordinates.
- Monster AI: Intelligent enemies that track and attack the player
- Health & Oxygen Systems: Manage your character's vitals
- Monster Respawning: Dynamic enemy respawn mechanics
- Explosion Effects: Visual feedback for combat
- Language: Java 23 / 25
- UI Framework: JavaFX 17.0.6
- Game Engine: FXGL 17.3
- Build Tool: Maven
- Additional Libraries:
- ControlsFX 11.1.2
- FormsFX 11.6.0
- BootstrapFX 0.4.0
- Testing: JUnit 5.10.0
- Java Development Kit (JDK): Version 23 / 25 or higher
- Maven: Version 3.6 or higher
- JavaFX: Included via Maven dependencies
-
Clone the repository (or download the project):
git clone <repository-url> cd FinalBTG
-
Verify Java installation:
java -version
Ensure you have JDK 23 or higher installed.
-
Verify Maven installation:
mvn -version
-
Install dependencies:
mvn clean install
Run the game using the JavaFX Maven plugin:
mvn clean javafx:run- Import the project as a Maven project
- Wait for Maven to download all dependencies
- Locate the main class:
com.example.finalbtg.MainGame - Run the
MainGameclass
To create a distributable package:
mvn clean package- Launch the Game: Start from the home page
- Choose Mode:
- Guest: Play immediately without account
- Login: Access full features with an account
- Click "Sign up" on the login page
- Enter a unique username and password
- New accounts start with:
- 0 gems
- 0 resources
- Basic weapon and shield
- No special cards
- Arrow Keys / WASD: Move character
- Mouse Click: Shoot projectiles in the direction of the cursor
- F Key: Shoot projectile in current facing direction
- E Key: Cast equipped Special Card active combat spell
- SPACE: Activate speed boost (when picked up)
- Level 1-3: Story progression with increasing difficulty
- Phase 1-3: Additional challenges with unique maps
- Each level has:
- Custom map layout (defined in
level1map.txt,level2map.txt, etc.) - Different monster types and quantities
- Resource collection opportunities
- Gate to next level (unlocks when all monsters are defeated)
- Custom map layout (defined in
- Shoot projectiles to damage monsters
- Monsters shoot back and chase the player
- Collect gems from defeated monsters
- Manage health and oxygen levels
- Avoid obstacles and monster projectiles
- Collect Gems: Defeat monsters and complete levels
- Gather Resources: Find resources to upgrade spaceship (10 of each type needed)
- Acquire Special Cards: Purchase from shop or earn through gameplay
- Upgrade Equipment: Improve weapons and shields
- Increase Power: Total power = Weapon + Shield + Card Power
- Buy Cards: Browse cards listed by other players
- Sell Cards: Set your own price and list cards for sale
- Real-time Updates: See new listings as they appear
- Requires active server connection
- Matchmaking: Wait for an opponent to connect
- Real-time Combat: Battle against another player
- Custom Arena: Dedicated PvP map
- Uses your character's stats (weapon, shield, card power)
- Global Chat: Talk with all online players
- Auto-connect: Connects when you open chat
- Persistent: Chat history maintained during session
- View your username
- Check total gems
- See collected resources (x/10 for each type)
- Review character stats:
- Weapon power
- Shield power
- Special card power
- Total character power
- View card collection
FinalBTG/
โโโ src/
โ โโโ main/
โ โโโ java/com/example/finalbtg/
โ โ โโโ MainGame.java # Application entry point
โ โ โโโ ButtonHandler.java # UI controller for all menus
โ โ โโโ MainCharacter.java # Player character class
โ โ โโโ AllCharacter.java # Base character class
โ โ โโโ Monster.java # Monster base class
โ โ โโโ loginMonster.java # Monster for story levels
โ โ โโโ Pet.java # Pet companion class
โ โ โโโ loginPet.java # Pet for story levels
โ โ โโโ Projectile.java # Projectile mechanics
โ โ โโโ CombatUpgradeHelper.java # Active Special Card HUD slot and custom combat skills
โ โ โโโ PvpProjectile.java # PvP projectile mechanics
โ โ โโโ Resource.java # Resource collection
โ โ โโโ Level1Controller.java # Level 1 UI controller
โ โ โโโ Level1Loop.java # Level 1 game loop
โ โ โโโ Level2Controller.java # Level 2 UI controller
โ โ โโโ Level2Loop.java # Level 2 game loop
โ โ โโโ Level3Controller.java # Level 3 UI controller
โ โ โโโ Level3Loop.java # Level 3 game loop
โ โ โโโ Phase1Controller.java # Phase 1 UI controller
โ โ โโโ Phase1Loop.java # Phase 1 game loop
โ โ โโโ Phase2Controller.java # Phase 2 UI controller
โ โ โโโ Phase2Loop.java # Phase 2 game loop
โ โ โโโ Phase3Controller.java # Phase 3 UI controller
โ โ โโโ Phase3Loop.java # Phase 3 game loop
โ โ โโโ GuestGameController.java # Guest mode controller
โ โ โโโ GuestGameLoop.java # Guest mode game loop
โ โ โโโ PvpController.java # PvP UI controller
โ โ โโโ PvpLoop.java # PvP game loop
โ โ โโโ PvpClient.java # PvP client networking
โ โ โโโ PvpClientHandler.java # PvP client handler
โ โ โโโ PvpServer.java # PvP server
โ โ โโโ ChatClient.java # Chat client
โ โ โโโ ChatServer.java # Chat server
โ โ โโโ ShopClient.java # Shop client
โ โ โโโ ShopServer.java # Shop server
โ โโโ resources/
โ โโโ com/example/finalbtg/
โ โ โโโ homePage.fxml # Home screen
โ โ โโโ loginPage.fxml # Login/signup screen
โ โ โโโ loginDashboard.fxml # Main dashboard
โ โ โโโ guestDashboard.fxml # Guest dashboard
โ โ โโโ guestGameWorld.fxml # Guest game world
โ โ โโโ levels.fxml # Level selection
โ โ โโโ level1.fxml # Level 1 UI
โ โ โโโ level2.fxml # Level 2 UI
โ โ โโโ level3.fxml # Level 3 UI
โ โ โโโ phase1.fxml # Phase 1 UI
โ โ โโโ phase2.fxml # Phase 2 UI
โ โ โโโ phase3.fxml # Phase 3 UI
โ โ โโโ pvp.fxml # PvP UI
โ โโโ image/ # Game images and sprites
โ โโโ bgm.mp3 # Background music
โโโ user/ # User account data (created at runtime)
โโโ level1map.txt # Level 1 map data
โโโ level2map.txt # Level 2 map data
โโโ level3map.txt # Level 3 map data
โโโ phase1map.txt # Phase 1 map data
โโโ phase2map.txt # Phase 2 map data
โโโ phase3map.txt # Phase 3 map data
โโโ pvpmap.txt # PvP map data
โโโ worldmap.txt # World map data
โโโ onSale.txt # Shop marketplace data
โโโ pom.xml # Maven configuration
โโโ README.md # This file
User accounts are stored in the user/ directory as text files:
Format: username.txt
Contents:
username,password
resource,amount1,amount2,amount3
gems,totalGems
weapon,weaponPower
shield,shieldPower
cardPower,cardPowerValue
specialcard,cardId1,cardId2,...
Example:
player1,password123
resource,5,7,3
gems,1500
weapon,250
shield,300
cardPower,1200
specialcard,1,3,5
This is an educational project. If you'd like to contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is created for educational purposes.
- Start with Guest Mode to learn the controls
- Create an Account to save progress and access all features
- Collect Resources early - you need 10 of each type
- Save Gems for purchasing powerful special cards in the shop
- Upgrade Strategically - balance weapon, shield, and card power
- Use Chat to coordinate with other players or get tips
- Practice in Story Mode before trying PvP
- Check the Leaderboard to see how you rank against others
- Verify JDK 23 is installed:
java -version - Ensure Maven dependencies are installed:
mvn clean install
- Check that the
resources/image/directory contains all required images - Verify JavaFX is properly configured
- Ensure the server components start automatically
- Check firewall settings if connecting across networks
- Multiple players need to be online for PvP and chat
- Verify
bgm.mp3exists inresources/ - Check system audio settings
- Use the in-game mute toggle
Enjoy your journey Beyond The Galaxy! ๐