In this exercise, you will develop a hero RPG (Role Playing Game) using all of the cool new python knowledge you've acquired. This game will be created using Object Oriented Programming.
The game starts off with 2 characters: a hero
and a goblin
. Each character will be given a starting health and starting value.
Each character also has a power that can be used to attack their opponent. In the initial scenario, the hero's
opponent is the goblin
, and the goblin's
opponent is the hero
.
When either character attacks his/her opponent, the opponent's health will decrease by the amount of power of the attacking character.
For example
If the hero starts off with the following:
- health = 9
- power = 4
And the
goblin
starts off with the following:
- health = 7
- power = 3
Then when the hero attacks the goblin, the goblin's health will decrease by 4.
The result of goblin's health after being attacked
- health = 3 ==> (7 - 4)
- power = 3
Run following command to clone this repository onto your local computer
- Clone this repository:
git clone https://github.com/DigitalCraftsStudents/python-rpg-starter.git
cd python-rpg-starter
git init
git add
git commit -m 'rpg game'
- Create a new repository without a README in your github account
- Follow the instructions to connect and push your local repo to your remote repository
git remote remove origin
git remote add origin [url of your repo]
git push --set-upstream origin main
Use hero_rpg.py
, located in this repository, as a starting point for your game.
As you complete each step, commit, push, and tag the final working version. In the future we'll base a refactor off of one the steps.
Follow the link below to continue building new characters with new abilities to your game.
Follow the link below to continue building new characters with new abilities to your game.