Skip to content

Individual project to learn essential ruby programming skills.

Notifications You must be signed in to change notification settings

districtem/space_merchant

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

space_merchant

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.

Goals

  • Learn essential Ruby programming skills
  • Become familiar with Git for version control

🔰 Getting Started

  1. Fork this Repo
  2. Setup an upstream remote to this repo; to keep up with base changes
  3. Start implementing the requirements
  4. Have FUN!! 😜

Requirements

Task 1 - Fork the space_merchant repository

The code in the inital space_merchant repository provides us with two objects:

  • The Player Object - :suspect: centralized storage for game state information (e.g. how much 💰 the player has)
  • The Event Loop - ➿ the options a player :suspect: has available at any given time, which are a function of where they are. Ex:
    • While flying 🚀 through space a player :suspect: 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)

The Galaxy 🌌 is responsible for creating all of the game locations and allowing event code to access these locations (event code gives the player :suspect: 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 argument 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 avoid_sectors.

Task 3 - Create Sectors (Think of Sectors as squares on the game board)

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'

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.

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.

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.

Contact Us

About

Individual project to learn essential ruby programming skills.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published