Fix: change score -> record, bestRecord
This commit is contained in:
@@ -32,7 +32,7 @@ class HistoryBoard {
|
||||
break;
|
||||
|
||||
let data = historyRecordManager.getAt(maxIndex);
|
||||
this.printRecord(i, data.date, data.score);
|
||||
this.printRecord(i, data.date, data.bestRecord);
|
||||
maxIndex--;
|
||||
}
|
||||
}
|
||||
@@ -40,14 +40,14 @@ class HistoryBoard {
|
||||
}
|
||||
|
||||
|
||||
printRecord(index, date, score) {
|
||||
printRecord(index, date, bestRecord) {
|
||||
if(sessionStorageManager.playingAppName.indexOf("typing") < 0)
|
||||
this.printMouseAppHistory(index, date, score);
|
||||
this.printMouseAppHistory(index, date, bestRecord);
|
||||
else
|
||||
this.printTypingAppHistory(index, date, appName, score);
|
||||
this.printTypingAppHistory(index, date, appName, bestRecord);
|
||||
}
|
||||
|
||||
printMouseAppHistory(index, date, score) {
|
||||
printMouseAppHistory(index, date, bestRecord) {
|
||||
let posX = 60;
|
||||
let posY = game.world.height / 2 + 90 + 30 * index;
|
||||
|
||||
@@ -59,12 +59,12 @@ class HistoryBoard {
|
||||
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
|
||||
style.boundsAlignH = "right";
|
||||
game.add.text(posX + 80, posY, StringUtil.getScoreTextWithoutUnit(score), style)
|
||||
game.add.text(posX + 80, posY, StringUtil.getRecordTextWithoutUnit(bestRecord), style)
|
||||
.setTextBounds(0, 0, 100, 60)
|
||||
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
}
|
||||
|
||||
printTypingAppHistory(index, date, appName, score) {
|
||||
printTypingAppHistory(index, date, appName, bestRecord) {
|
||||
let posX = 60;
|
||||
let posY = game.world.height / 2 + 90 + 30 * index;
|
||||
|
||||
@@ -80,7 +80,7 @@ class HistoryBoard {
|
||||
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
|
||||
style.boundsAlignH = "right";
|
||||
game.add.text(posX + 120, posY, StringUtil.getScoreTextWithoutUnit(score), style)
|
||||
game.add.text(posX + 120, posY, StringUtil.getRecordTextWithoutUnit(bestRecord), style)
|
||||
.setTextBounds(0, 0, 80, 60)
|
||||
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
}
|
||||
|
||||
@@ -114,10 +114,10 @@ class RankingBoard {
|
||||
.setTextBounds(0, 0, 60, 60)
|
||||
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
|
||||
// score
|
||||
let score = StringUtil.getScoreTextWithoutUnit(data.score);
|
||||
// bestRecord
|
||||
let bestRecord = StringUtil.getRecordTextWithoutUnit(data.bestRecord);
|
||||
style.boundsAlignH = "right";
|
||||
game.add.text(this.getPosX(type) + 120, this.getPosY(index), score, style)
|
||||
game.add.text(this.getPosX(type) + 120, this.getPosY(index), bestRecord, style)
|
||||
.setTextBounds(0, 0, 80, 60)
|
||||
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
}
|
||||
|
||||
+14
-10
@@ -23,7 +23,7 @@ class Result {
|
||||
|
||||
|
||||
// contents
|
||||
this.printScore();
|
||||
this.printRecord();
|
||||
this.makeStartButton();
|
||||
|
||||
let recordBoard = new RecordBoard();
|
||||
@@ -38,28 +38,32 @@ class Result {
|
||||
screenBottom.printBottomRightText(sessionStorageManager.playerName);
|
||||
}
|
||||
|
||||
printScore() {
|
||||
printRecord() {
|
||||
const style = { font: "64px Arial", fill: "#fff", align: "left", boundsAlignH: "center", boundsAlignV: "middle" };
|
||||
game.add.text(0, 0, "결과", style)
|
||||
.setTextBounds(0, 0, game.world.width, 100)
|
||||
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
|
||||
let posY = 120;
|
||||
let score = NumberUtil.numberWithCommas(sessionStorageManager.score);
|
||||
console.log(score);
|
||||
if(sessionStorageManager.record === null)
|
||||
sessionStorageManager.record = 0;
|
||||
let record = NumberUtil.numberWithCommas(sessionStorageManager.record);
|
||||
console.log(record);
|
||||
style.font = "bold 80px Arial";
|
||||
game.add.text(0, 0, score, style)
|
||||
game.add.text(0, 0, record, style)
|
||||
.setTextBounds(0, posY, game.world.width, 60)
|
||||
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
|
||||
let highScore = NumberUtil.numberWithCommas(sessionStorageManager.highScore);
|
||||
console.log(highScore);
|
||||
if(sessionStorageManager.bestRecord === null)
|
||||
sessionStorageManager.bestRecord = 0;
|
||||
let bestRecord = NumberUtil.numberWithCommas(sessionStorageManager.bestRecord);
|
||||
console.log(bestRecord);
|
||||
style.font = "32px Arial";
|
||||
let highScoreText = game.add.text(0, 0, "오늘 최고 기록 : " + highScore, style)
|
||||
let bestRecordText = game.add.text(0, 0, "오늘 최고 기록 : " + bestRecord, style)
|
||||
.setTextBounds(0, posY + 80, game.world.width, 40);
|
||||
// .setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
highScoreText.stroke = "#333";
|
||||
highScoreText.strokeThickness = 5;
|
||||
bestRecordText.stroke = "#333";
|
||||
bestRecordText.strokeThickness = 5;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user