-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFruit3.java
49 lines (46 loc) · 1.21 KB
/
Fruit3.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
49
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package foxthefruithunter;
import java.awt.Image;
import java.awt.geom.Rectangle2D;
import java.net.URL;
import javax.swing.ImageIcon;
/**
*
* @author ACER
*/
public class Fruit3 extends Fruit1 {
Image img3;
public Fruit3() {
URL imageURL = this.getClass().getResource("fruit3.png");
img3 = new ImageIcon(imageURL).getImage();
dropper.start();
}
Thread dropper = new Thread(new Runnable() {
public void run() {
while(true){
y += 2;
if(y >= 800){
img = null;
dropper = null;
x = -500;
y = -500;
}
try{
if(check=true){
dropper.sleep(50);
}
if(check=false){
dropper.sleep(10);
}
}catch(InterruptedException e){}
}
}
});
public Image getImage(){
return img3;
}
}