NOTE: This exercise is intended for an object oriented programming language such as C# or Java. PHP or python should work fine as well, without to many adjustments.
Your task is to create a simple text based game where two characters fight each other to death. You can either let the fight progress automatically or hit a key for each round. The project will be divided into subtasks with prerequisits for each task. Make sure each piece works before you move on to the next one. You must be able to run the program before you move on.
At the end, you’ll have four character classes with one unique skill each as well as some skills they all have in common. Each character class must have some way to attack as well as some defence attributes. I won’t bother with class balancing for this challenge. If you want to do that yourself, feel free to go ahead. Some of the classes will have a weapon. We’ll only create two weapons for this exercise, but you, again, can create more if you like. The result of the fight will be randomly generated each time you run the program. The program flow will look like this.
- The program starts
- The player enters a name for his/her character.
- The player picks a class for his/her character.
- The player picks a weapon for the character.
- The computer selects an opponent with a random class and weapon.
- Opponent information is shown to the player.
- The player is prompted to press a key or click a button to start the fight.
- At the start of each round, the first character to make a move is selected randomly.
- The first character to make a move picks a skill to use.
- The second character gets a chance to counter the skill.
- The second character makes his move.
- The first character gets a chance to counter the move.
- This continues until one of the characters is out of hitpoints.
- The result is displayed to the player.
- Program ends.
This might seem overwhelming at first, but we’re going to use basic concepts to complete all these tasks.
- Step 1: Setup
- Step 2: Character name
- Step 3: List of opponent names (optional)
- Step 4: Create the base character class
- Step 5: Give the character a name
- Step 6: Create a weapon class
- Step 7: Implement methods in the weapon class
- Step 8: A few more things
- Step 9: Let’s do some fighting
- Creating character classes (Unfinished)
- More weapons (Unfinished)
- Let the player pick a class (Unfinished)
- Cleaning up (Unfinished)
- Adding more features (Unfinished)