public class Pokemon
extends java.lang.Object
Let's play Pokemon! This is our Pokemon class. Each Pokemon has several member variables that make it a Pokemon. Each Pokemon has:
Have a look through the Pokemon file to see how we can construct objects, can use member variables of these objects, and use objects of the same type to make our game.
Constructor | Description |
---|---|
Pokemon() |
Create a new Pokemon with default values.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
attack(Pokemon opponent) |
Attack another Pokemon.
|
public Pokemon()
Constructs a new Pokemon with a 6-sided die, 20-sided die, 0 hit points, attack level of 0, defense level of 0, and an empty name.
public boolean attack(Pokemon opponent)
Calling this method will cause this Pokemon to attack another Pokemon as follows:
opponent
- the Pokemon to attack