-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEnemy.java~
41 lines (31 loc) · 821 Bytes
/
Enemy.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
import java.awt.*;
import java.awt.Rectangle;
public class Enemy extends GameObject {
public Enemy(int x, int y, ID id) {
super(x, y, id);
<<<<<<< HEAD
velY = 1;
=======
if(Game.time%3 == 0) {
velY = 1;
}
>>>>>>> ab8f7a0d047e9c47516526d23617c6f008308d15
}
public Rectangle getBounds() {
return new Rectangle(x, y, 128, 128);
}
public void update() {
<<<<<<< HEAD
x += Math.cos(-Game.time*.0025)*8 + 0.5;
=======
x += Math.cos(-Game.time*.0025)*8;//+ 0.5;
>>>>>>> ab8f7a0d047e9c47516526d23617c6f008308d15
y += velY;
x = Game.clamp(x, 0, Game.WIDTH-128);
}
public void draw(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
Image img1 = Toolkit.getDefaultToolkit().getImage("128Enemy.gif");
g.drawImage(img1, x, y, null);
}
}