-
Notifications
You must be signed in to change notification settings - Fork 1
/
SpawnedPowerup.java
65 lines (53 loc) · 1.85 KB
/
SpawnedPowerup.java
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
56
57
58
59
60
61
62
63
64
65
/* SpawnedPowerup.java
* Matthew Pechen-Berg and Peter Jang
* January 17th, 2020
* Class is a template for other powerups in the game
*/
//Import necessary classes
import java.awt.image.BufferedImage;
public abstract class SpawnedPowerup extends WorldObject {
//declare private variables
private int spritesheetNumber;
private int row;
private int col;
private BufferedImage sprite;
//Constructor for SpawnedPowerup
SpawnedPowerup(int row, int col, int spritesheetNumber) {
super(col * 32, row * 32, 1, 10, "Images/Powerups.png");
//Required for constructor
this.row = row;
this.col = col;
this.spritesheetNumber = spritesheetNumber;
this.sprite = this.getSprite(0,spritesheetNumber);
}//end of SpawnedPowerup Constructor
/** Gets the sprite image
*@return the sprite
*/
public BufferedImage getSpriteImage() {
return this.sprite;
}//end of getSpriteImage()
/** Placeholder for methods used by the inherited powerup classes
*@param playerGatherer Player who got the powerup
*/
public void getPowerup(Player playerGatherer) {
}//end of getPowerup()
/** Placeholder for methods used by the inherited powerup classes
*@param playerActivator Player the Player who activated Powerup
*@param otherPlayer Player the other Player
*@param gameMap Map the game map
*/
public void activatePowerup(Player playerActivator, Player otherPlayer, Map gameMap) {
}//end of activatePowerup()
/** Gets the int value of the column
*@return the int column value
*/
public int getCol() {
return this.col;
}//end getCol()
/** Gets the int value of the row
*@return the int row value
*/
public int getRow() {
return this.row;
}//end getRow()
}//end of SpawnedPowerup class