Space Explorer is an engaging interactive fiction simulation game written in Java. You command a spacecraft exploring distant star systems, managing resources, fuel, and crew morale. The game features dynamic exploration, strategic decision-making, and multiple possible endings.
- Java Development Kit (JDK) 8 or higher installed
- Command line/terminal access
javac SpaceExplorer.javajava SpaceExplorerPrimary Goal: Explore 5+ star systems AND collect 50+ resources to win!
Challenges:
- Manage fuel carefully - running out means game over!
- Keep crew morale high or risk mutiny
- Balance exploration with resource management
- Strategic decision-making at every turn
| Command | Effect |
|---|---|
explore |
Explore nearby star systems within fuel range. Consumes fuel based on distance. Random chance to discover resources, artifacts, or anomalies. |
manage |
Access crew management menu. Give speeches, allow rest days, or push crew harder. Affects morale and fuel. |
scan |
Scan nearby space for anomalies and discoveries. Uses 10 fuel. Chance to find alien signals or resources. |
hyper |
Execute hyperspace jump for long-distance travel. Consumes 30 fuel but travels 30-80 light-years. |
status |
Display detailed mission report including total credits earned, resource descriptions, and achievements. |
save |
Save your current game progress. |
quit |
Exit the game and display final statistics. |
- 100%: Full tank, ready for exploration
- 50%: Getting low, plan carefully
- 0%: Game over - your ship loses power!
- 75%+: Crew is content and productive
- 50-74%: Crew is adequate
- 25-49%: Crew is unhappy
- 0%: Game over - crew mutiny!
- Earned through exploration, scanning, and crew labor
- Convert to credits in the end-game scoring
- Essential for winning the game
- Count increases with each successful exploration
- Need 5+ systems for victory
- Each system can yield valuable discoveries
When you explore a system:
- You choose a distance (game randomizes)
- Fuel is consumed equal to distance
- You have a 70% chance of discovery
- Possible discoveries:
- Exotic minerals (10-30 resources)
- Energy anomalies (5 resources + morale boost)
- Ancient artifacts (15 resources)
Three options available:
- Motivational Speech: +10 morale, no cost
- Rest Day: +15 morale, -5 fuel
- Forced Labor: +10 resources, -20 morale (risky!)
- Requires 30 fuel minimum
- Jumps 30-80 light-years (longer than normal exploration)
- Great for covering distance quickly
- Crew gets morale boost from the thrilling jump
✓ Achieve VICTORY by:
- Exploring 5 or more star systems
- Collecting 50 or more resources
- Keeping your ship operational
✗ Game Over if:
- Out of Fuel: Fuel reaches 0% - your ship loses power
- Crew Mutiny: Crew morale drops to 0% - you lose control
Your mission value is calculated as:
Total Credits = (Resources × 100) + (Systems Explored × 50) + (Distance × 10)
Example:
- 60 resources × 100 = 6,000
- 5 systems × 50 = 250
- 100 light-years × 10 = 1,000
- Total = 7,250 credits
- Explore nearby systems to build resources
- Don't waste fuel on distant jumps yet
- Keep crew morale steady
- Push toward 5 systems explored
- Use hyperspace jumps strategically
- Manage crew to maintain morale
- Focus on collecting 50+ resources
- Use scans and crew labor for final push
- Monitor fuel to ensure you don't run out
- Balanced Approach: Mix exploration with crew management
- Scout First: Use scan before committing to expensive exploration
- Plan Fuel: Calculate fuel needed before each expedition
- Crew Care: Happy crew = better exploration success rates
The program includes 8 functions beyond main():
- initializeGame() - Sets up initial game state
- displayGameStatus() - Shows current ship statistics
- handleUserInput(String) - Processes player commands (String parameter)
- exploreSystem(int) - Explores distant systems (int parameter)
- calculateResources() - Computes mission value in credits (returns int)
- manageFuel(int) - Adjusts fuel levels (int parameter)
- getResourceDescription(int) - Creates descriptive text (int parameter, returns String)
- displayCrewManagementMenu() - Shows crew management options
- Extensive code comments explaining every function
- Clear variable naming for readability
- Structured game state management
- Dynamic random events for replayability
- Visual status bars for fuel and morale
WELCOME TO SPACE EXPLORER
Objective: Explore distant star systems and collect valuable resources...
============================================================
SHIP STATUS REPORT - TURN 1
============================================================
Location: Earth Spacedock
Fuel Level: 100% [==========]
Crew Morale: 75% [======= ]
Systems Explored: 0
Resources Collected: 0
> Enter command (explore/manage/scan/hyper/status/save/quit): explore
Initiating exploration protocol...
[EXPLORATION LOG]
Traveling 14 light-years through space...
SUCCESS! Discovered 18 units of exotic minerals!
============================================================
SHIP STATUS REPORT - TURN 2
============================================================
Location: Star System 1
Fuel Level: 86% [======== ]
Crew Morale: 80% [======== ]
Systems Explored: 1
Resources Collected: 18
Every game is unique because:
- Random distances for exploration
- Random discoveries during scans
- Random artifacts found in systems
- Unpredictable crew morale changes
- Multiple valid strategies to achieve victory
Try different approaches:
- Aggressive exploration vs. cautious approach
- Crew-focused vs. resource-focused
- Early hyperspace jumps vs. gradual exploration
"javac: command not found"
- Java JDK is not installed. Download it from oracle.com or use OpenJDK
"Exception in thread main..."
- Ensure the file is named exactly
SpaceExplorer.java - Check that Java is properly installed
Game seems unresponsive
- The game waits for your input. Type a command and press Enter
- Valid commands are: explore, manage, scan, hyper, status, save, quit
Command your ship wisely, manage your resources carefully, and discover the wonders of distant star systems. Safe travels, Captain! 🚀