-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCrab.java
33 lines (28 loc) · 892 Bytes
/
Crab.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
import java.awt.Graphics;
import java.io.IOException;
import java.net.UnknownHostException;
import javax.swing.*;
public class Crab extends Enemy
{
public Crab(int x, int y, SpaceInvadersPanel panel)
{
super(x, y, 30, 20, 10, 3, panel);
try {
image = Classes.getImage("crab");
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void draw(Graphics g)
{
//ImageIcon image = new ImageIcon("Assets/Crab1.png");
g.drawImage(image.getImage(), this.x, this.y, this.width, this.height, null);
}
}