forked from ThanhTam0908/Bejeweled-2-Game-Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCollectScore.java
More file actions
32 lines (27 loc) · 951 Bytes
/
CollectScore.java
File metadata and controls
32 lines (27 loc) · 951 Bytes
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
package Bejeweled;
import Gems.TextEffects;
import static Bejeweled.InGame.*;
public class CollectScore {
public static boolean collectScore() {
for (TextEffects t : textEffectsArrayList) {
// if mouse hit the text
if (xMouse >= t.x && xMouse <= (t.x + 70) && yMouse >= t.y && yMouse <= (t.y + 70)) {
t.moveScore = true;
t.isDestroyed = true;
// scoredSound.myPlaySound();
if (t.typeScore == 3)
score += 30;
else if (t.typeScore == 4)
score += 40;
else if (t.typeScore == 5)
score += 50;
else if (t.typeScore == 6)
score += 60;
else if (t.typeScore == 7)
score += 70;
return true;
}
}
return false;
}
}