-
Notifications
You must be signed in to change notification settings - Fork 1
/
Walker.java
48 lines (39 loc) · 1.03 KB
/
Walker.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
import java.util.ArrayList;
import java.awt.Color;
import java.awt.Graphics2D;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
public class Walker extends Lemmings{ //Classe des Walker (elle sera abstraite)
//================== CONSTRUCTEURS ======================
public Walker(int posX, int posY){
super(posX,posY);
}
public Walker(Lemmings l){
super(l);
}
//===================== METHODES =========================
public void move(){
//bouge le lemming selon le world
//plus tard ajout de draw animation
if (!inWorld) return;
if (fall()) return;
if (walk()) return; //tente de grimper
if (climbUp()) return;
if (climbDown()) return;
direction = -direction;
}
public void drawAction(Graphics2D g){}
public BufferedImage getImageRight(){
return imageRight;
}
public BufferedImage getImageRightStep(){
return imageRightStep;
}
public BufferedImage getImageLeft(){
return imageLeft;
}
public BufferedImage getImageLeftStep(){
return imageLeftStep;
}
}