-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScore.java
More file actions
27 lines (26 loc) · 833 Bytes
/
Copy pathScore.java
File metadata and controls
27 lines (26 loc) · 833 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
import java.awt.*;
public class Score {
protected int mainScore;
public Score(Cloud cloud, Obstacles obstacle){
mainScore = 0;
cloud.getCloudScore();
obstacle.getScore();
mainScore = cloud.cloudScore + obstacle.score;
}
public int getMainScore(){
return mainScore;
}
public void scoreUpdate(Cloud cloud, Obstacles obstacle, int gameState) {
if (gameState == 1) {
cloud.getCloudScore();
obstacle.getScore();
mainScore = obstacle.score + cloud.cloudScore;
}
}
public void drawScore(Graphics g){
g.setColor(Color.decode("#817cc8"));
g.setFont(new Font("Arial", Font.PLAIN, 30));
String mainScoreString = "SCORE: " + getMainScore();
g.drawString(mainScoreString, 960,50);
}
}