-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFireCreep.java
More file actions
43 lines (40 loc) · 1.24 KB
/
FireCreep.java
File metadata and controls
43 lines (40 loc) · 1.24 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
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* The class for the fire creeps that the user sends
*
* @author James Lu
* @version 1.0
*/
public class FireCreep extends Creep
{
/**
* The int id is the level of the creep (1/2/3)
*/
public FireCreep(int id){
if (id >= 1 && id <= 3){
if (id == 1){
maxHp = 50;
armor = 10;
speed = 3f;
}else if (id == 2){
maxHp = 500;
armor = 15;
speed = 3.2f;
}else if (id == 3){
maxHp = 1500;
armor = 25;
speed = 4f;
}
bg = new GreenfootImage ("Enemy/fire" + id + ".png");
type = 3;
stringType = "Fire";
name = "Fire Creep " + id;
currentHp = maxHp;
targetHp = maxHp + maxHp/20;
isBoss = false;
flying = false;
hpBar = new HealthBar (maxHp, currentHp);
this.setImage (bg);
}
}
}