-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtreasure.java
145 lines (83 loc) · 2.33 KB
/
treasure.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import java.awt.*;
/**
* java treasure method
*
* gold - gold give you money
* rock and diamond - give you more money, but stone worth less
* lucky box - randomally give you item
* tnt will explode when your rope touch it
*
*/
//
public class treasure extends object {
static String path_tile = "images/tile/";
static int density = 50;
treasure(){
this.catch_flag = false;
this.x = publics.random(0, window.win_width);
this.y = publics.random(345, 500);
this.width = 40;
this.height = 40;
this.img = Toolkit.getDefaultToolkit().getImage(path_tile + "gold.png");
this.mass = 30;
this.valued = 40;
}
}
class treasure_small extends treasure {
treasure_small(){
this.width = 20;
this.height = 20;
this.img = Toolkit.getDefaultToolkit().getImage(path_tile + "gold_small.png");
this.mass = 15;
this.valued = 20;
}
}
class treasure_big extends treasure {
treasure_big(){
this.img = Toolkit.getDefaultToolkit().getImage(path_tile + "gold_big.png");
this.mass = 60;
this.valued = 100;
}
}
class rock extends treasure {
rock(){
this.img = Toolkit.getDefaultToolkit().getImage(path_tile + "rock.png");
this.mass = 50;
this.valued = 5;
}
}
class diamond extends treasure {
diamond(){
this.img = Toolkit.getDefaultToolkit().getImage(path_tile + "diamond.png");
this.mass = 60;
this.valued = 500;
}
}
class lucky_block extends treasure {
lucky_block(){
this.img = Toolkit.getDefaultToolkit().getImage(path_tile + "lucky_block.png");
this.mass = 40;
this.valued = 0;
this.type = lucky_block;
this.include.add(potion.name);
this.include.add(dynamite.name);
this.include.add("800");
this.include.add("400");
this.include.add("185");
}
int in_box(){
return 0;
}
}
class tnt extends treasure {
tnt(){
this.img = Toolkit.getDefaultToolkit().getImage(path_tile + "tnt.png");
this.mass = 0;
this.valued = 1;
this.type = dynamite_block;
}
static int explode_range = 300; // 300
static int tnt_explode(){
return 0;
}
}