This project is a recreation of the popular game Space Trader as an exercise for version control best practices, object design, object-oriented programming methods, Agile and Iterative development and JavaFX programming.
The goal of the game is to travel around different locations in space to buy/sell items and earn enough credits in order to be able to buy the winning item found at a random location.
When starting a new game, the player can select the difficulty (easy, medium or hard) which determines the starting amount of credits, skill points, and the outcomes of encounters with traders and bandits.
Skill points can be assigned to the player's attributes/skills. The Pilot skill decreases the amount of fuel used, the Fighter skill increase the chances of fighting off a bandit or robbing a trader, the Merchant skill decreases the purchasing price of most items, and finally the Engineer skill decrease the cost of restoring ship's health points.
The game features multiple locations with randomly generated coordinates, names (through multiple dictionaries), and attributes. The player can travel to any of these locations by spending some ship's fuel based on the distance between the location the player is travelling to and the player's current position (fuel cost can be discounted based on the player's Pilot attribute). During each travel there is a chance of meeting a bandit or a trader on the way. The player can decide to either pay, flee or fight the bandit, or to rob, trade, negotiated or ignore the trader. The outcomes of these action (success or failure) depend on the game difficulty and player attributes.
Each location has a pseudo randomly generated market. Each market offers items with equal or lower "tech" level of the civilization at that location. Higher tech items are more expensive therefore it's easier to make a profit when sold. Moreover, markets also offer special items that are either player upgrades, fuel or the ability to restore ship's health points (more effective with a higher Engineer level). The price of the items is randomly determined within a preset range, and a discount is applied based on the player's Merchant attribute.
The ship has various attributes:
- current health points and maximum health points;
- current fuel amount and maximum fuel amount;
- attack value (determined by the player's Fighter skill);
- maximum cargo capacity;
- list of cargo items currently stored;
- maximum number of slots for upgrades;
- list of upgrades currently installed.
All this information can be seen at the bottom bar and at the market.
The winning item spawns as a special item at a random location and only after the player has played for some time.
Purchasing this item will allow the player to win and complete the game, and will cause the game to reset to a fresh new game after the credits.
-
Map & Regions
- Designed and implemented:
- the region class →
Region.java
- the region class →
- Designed, styled and wrote the scenes for:
- the map scene →
MapScene.java
- the region scene →
RegionScene.java
- including:
- information panes
- random generation and layout of regions (locations), and their names, descriptions and attributes
- player travelling sequence and implementation
- bottom info bar with amount of credits available, players skills level and ship's information
- the map scene →
- Designed and implemented:
-
Markets & Items
- Designed and implemented:
- the market class →
Market.java
- the item class →
Item.java
- the market class →
- Designed, styled and wrote the scenes for:
- the market scene →
MarketScene.java
- including:
- random generation of items, and their names, descriptions and attributes
- generation and adjustments of items prices based on players attributes, region's tech level and item's rarity
- implementation of player's upgrades
- items transfers from market to ship cargo and vice versa
- upgrades transfers from market to player cargo and vice versa
- bottom info bar with amount of credits available, players skills level and ship's information
- winning item design and spawn
- the market scene →
- Designed and implemented:
-
Ship
- Designed and implemented:
- the ship class →
Ship.java
- including:
- health points (HP)
- fuel & cargo management
- the ship class →
- Designed and implemented:
-
Skill Selection
- Designed, styled and wrote the skills selection scene →
SkillsLevelSelectionScene.java
- Designed, styled and wrote the skills selection scene →