-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPokemon.java
More file actions
55 lines (46 loc) · 1.49 KB
/
Copy pathPokemon.java
File metadata and controls
55 lines (46 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import java.awt.image.BufferedImage;
/**
* builds a pokemon object, future edits to program should add more fields
* to pokemon object that can be implemented in game
*/
public class Pokemon
{
// instance variables - replace the example below with your own
private String name;
private BufferedImage[] animations;
private int spawnTime;
/**
* Constructor for objects of class Pokemon, used for all pokemon except heart/gold pack
*/
public Pokemon(String name, String loc, boolean b, int x, int y)
{
this.name = name;
if (b){
animations = SpriteSheetCutter.createAnimationBlocks(SpriteSheetCutter.getSheet(loc),4,4);
} else {
animations = SpriteSheetCutter.createAnimationBlocks(SpriteSheetCutter.getSheet(x,y,loc),4,3);
}
spawnTime = 1000;
}
//constructor for heartgold pokemon
public Pokemon(String name, String loc, int x, int y){
this.name = name;
spawnTime = 1000;
animations = SpriteSheetCutter.createAnimationBlocks(SpriteSheetCutter.getHeartGold(x,y,loc));
}
//accessor methods
public String getName(){
return name;
}
public BufferedImage[] getAnimations(){
return animations;
}
public int getSpawnTime(){
return spawnTime;
}
//spawn time is set at default to 1000,
//use mutator to set specialized spawn time
public void setSpawnTime(int time){
spawnTime = time;
}
}