-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEarthCreep.java
More file actions
43 lines (40 loc) · 1.23 KB
/
EarthCreep.java
File metadata and controls
43 lines (40 loc) · 1.23 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 earth creeps that the user sends
*
* @author James Lu
* @version 1.0
*/
public class EarthCreep extends Creep
{
/**
* The int id is the level of the creep (1/2/3)
*/
public EarthCreep(int id){
if (id > 0 && id < 4){
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/earth"+id+".png");
type = 4;
name = "Earth Creep " + id;
stringType = "Earth";
currentHp = maxHp;
targetHp = maxHp + maxHp/20;
isBoss = false;
flying = false;
hpBar = new HealthBar (maxHp, currentHp);
this.setImage (bg);
}
}
}