Class Colosseum
- java.lang.Object
-
- Colosseum
-
public class Colosseum extends java.lang.Object
Class that implements a Pokemon colosseum.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!
- See Also:
- Lab 4 Description
-
-
Constructor Summary
Constructors Constructor Description Colosseum()
-
Method Summary
All Methods Static Methods Concrete Methods 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.
-
-
-
Method Detail
-
buildPokemon
public static Pokemon buildPokemon()
How we will build our Pokemon to battle.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- Returns:
- tempPokemon - the Pokemon we built and are going to set our fighting Pokemon to
(Look, we can return objects too!)Implement this function.
-
printWhoIsAhead
public static void printWhoIsAhead()
Prints who is ahead.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.
-
determineWinner
public static void determineWinner()
Prints out the overall winner of the battle.This will only be called if there is not a tie, so you don't need to worry about this case.
Write this function.
-
initializePokemon
public static void initializePokemon()
Initializes the member Pokemons.You do not need to modify this function.
-
determineOrder
public static void determineOrder()
Determines the order of which Pokemon will go first.Uses a 2-sided die to roll for first.
You do not need to modify this function.
-
main
public static void main(java.lang.String[] unused)
Conducts the Pokemon battle.You do not need to modify this function.
- Parameters:
unused
- unused input arguments.
-
-