public class Colosseum
extends java.lang.Object
The Pokemon battles that you might have grown up to know and love are now console based! The Colosseum class is where all the battles will go down. We will build our Pokemon, let them battle, and see who will be the winner!
Constructor | Description |
---|---|
Colosseum() |
Modifier and Type | Method | Description |
---|---|---|
static Pokemon |
buildPokemon() |
How we will build our Pokemon to battle.
|
static void |
determineOrder() |
Determines the order of which Pokemon will go first.
|
static void |
determineWinner() |
Prints out the overall winner of the battle.
|
static void |
initializePokemon() |
Initializes the member Pokemons.
|
static void |
main(java.lang.String[] unused) |
Conducts the Pokemon battle.
|
static void |
printWhoIsAhead() |
Prints who is ahead.
|
public static Pokemon buildPokemon()
Obtain user input to set Pokemon's member variables
Requirements we should check the user for:
- Hit points are between 1 and MAX_HIT_POINTS
- No more than 50 points are split between attack level and defense leve
- Attack level and defense level must have at least 1 point each
Example of how this will look to the user:
Please name your Pokemon: Dolphin
How many hit points will it have? (1-50): 50
Split fifty points between attack level and defense level
Enter your attack level (1-49): 47
Enter your defense level (1-3): 3
Example of checking for bad input:
Please name your Pokemon: Fire
How many hit points will it have? (1-50): 0
Sorry. Hit points must be between 1 and 50: 55
Sorry. Hit points must be between 1 and 50: 50
Split fifty points between attack level and defense level
Enter your attack level (1-49): -10
Sorry. The attack level must be between 1 and 49: 73
Sorry. The attack level must be between 1 and 49: 27
Enter your defense level (1-23): 24
Sorry. The defense level must be between 1 and 23: 23
Implement this function.
public static void printWhoIsAhead()
Compares the two Pokemon to see if there's a tie, or if a pokemon is currently winning.
Example:
Fire has 41 hit points
Dolphin has 44 hit points
Print "Dolphin is currently ahead!"
Implement this function.
public static void determineWinner()
This will only be called if there is not a tie, so you don't need to worry about this case.
Write this function.
public static void initializePokemon()
You do not need to modify this function.
public static void determineOrder()
Uses a 2-sided die to roll for first.
You do not need to modify this function.
public static void main(java.lang.String[] unused)
You do not need to modify this function.
unused
- unused input arguments.