Coder Social home page Coder Social logo

project3.05_oregontrail's Introduction

Project 3: Oregon Trail

Using variables, functions, and conditionals in Python, students will create an Oregon Trail game.

Overview

We will be recreating Oregon Trail! The goal is to travel from Independence, Missouri to Oregon City, Oregon (2000 miles) by Dec 31st. However, the trail is arduous. Each day costs you food. You can hunt and rest, but you have to get there before winter!

Details

Behavior

  • Player starts in Independence, MO on 03/01 with 2,000 miles to go, 500lbs of food, and 5 health.
  • The player must get to Oregon by 12/31
  • At the beginning of the game, user is asked their name.
  • Each turn, the player is asked what action they choose, where the player can type in the following: travel, rest, hunt, status, help, quit
  • The players health will decrease twice each month.
  • The player eats 5lbs of food a day.
  • travel: moves you randomly between 30-60 miles and takes 3-7 days (random).
  • rest: increases health 1 level (up to 5 maximum) and takes 2-5 days (random).
  • hunt: adds 100lbs of food and takes 2-5 days (random).
  • status: lists food, health, distance traveled, and day.
  • help: lists all the commands.
  • quit: will end the game.

Implementation details

  • Create functions for all options a player can take
  • Use global variables to keep track of player health, food pounds, miles to go, current day, current month
  • Create a function add_day which updates the day
  • Use a list to keep track of which months have 31 days and use this in the add_day function (i.e.: MONTHS_WITH_31_DAYS = [1, 3, 5, 7, 8, 10, 12])
  • Create a function select_action which uses a while loop to call add_day function
  • Game ends if days run out, health runs out, you get there (Oregon), or the player quits.

Bonus

  1. Make the rate of food consumption be a function of activity. So if a player hunts for a turn they take up more food, but if they rest they take up less food.
  2. Create a random event that occurs randomly once a month, like a river crossing or a dysentery, that will take up a range of 1-10 food, 1-10 days and 0-1 health.

project3.05_oregontrail's People

Contributors

crfullerton avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.