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
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 money the player has
The Event Loop - the options a player has available at any given time, which are a function of where they are e.g. while flying through space a player can select a destination but when docked commands center around buying and selling goods
The 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 Sector, Planet, and Station objects.Navigation The Galaxy should provide a pathfinding algorithm, for use in navigation. The pathfinding method should return an Array of Sectors beginning with the start_sector and ending with the finish_sector. If the optional avoid_sectors are provided, they should not be used. It's okay to return nil, if a path could not be found, but this should only be possible with avoid_sectors.
Sectors 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'
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.
Ship Capacity 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.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.
- Github: https://github.com/ScrappyAcademy
- Twitter: Sir Scrappy @ScrappyAcademy
- Google Groups: https://groups.google.com/d/forum/scrappyacademy