Individual project to learn essential ruby programming skills.
Space Merchant is Ruby Programming Quiz #71.
In this project we'll use Ruby to build an interactive game. The premise of the game is simple: you play a space trader flying around the galaxy buying and selling goods. The main goal is to find places to buy goods at a low price and then unload those goods at another location with a higher price, turning a profit.
- Learn essential Ruby programming skills
- Become familiar with Git for version control
- Fork this Repo
- Setup an
upstreamremote to this repo; to keep up with base changes
- Start implementing the requirements
- Have FUN!!
Task 1 - Fork the space_merchant repository
The code in the inital space_merchant repository provides us with two objects:
- The Player Object - centralized storage for game state information (e.g. how much the player has)
- The Event Loop -
the options a player has available at any given time, which are a function of where they are. Ex:
- While flying through space a player can select a destination
- When docked commands center around buying and selling goods
Task 2 - Create the Galaxy (An object that represents space as a whole)
Galaxy is responsible for creating all of the game locations and allowing event code to access these
locations (event code gives the player some choices, fetches an action from the keyboard, and responds
appropriately). There should be only one
Galaxy . The
Galaxy object should construct
Planet , and
Galaxy should provide a pathfinding algorithm, for use in navigation. The
should return an
Sectors beginning with the
start_sector and ending with the
finish_sector. If the
avoid_sectors is provided, those sectors should not be used. It's okay to return
nil, if a path
could not be found, but this should only be possible with
Task 3 - Create Sectors (Think of Sectors as squares on the game board)
The Sector is the main interface for moving around the Galaxy. The Sector should show the player their location, and request a command. These areas must be connected, so the player can move from location to location.
Game Level Functions
Any game level functions should be included within the Sector code e.g. 'quit' 'save' 'dock at station' 'land on planet' 'plot course' 'buy' 'sell'
Task 4 - Create Stations (Stations are where the player can buy and sell goods)
There may be some set of categories available in the Galaxy but only a subset of those goods should be traded in an individual Sector.
Use station implementations to flesh out the player's ship. The player's ship should have a limited capacity of goods that it can carry at a time.
Task 5 - Create Planets
Allow players to pick up special people and cargo to transport to other planets. Use these objects to form a basic underlying plot for the game.