Add: ranking hour, day, month record php

This commit is contained in:
2018-05-18 09:52:58 +09:00
parent 8fe5c72987
commit 60bd151c92
18 changed files with 404 additions and 158 deletions
+10 -8
View File
@@ -14,12 +14,17 @@ class HistoryBoard {
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
this.dbConnectManager.requestPlayerHistory( historyRecordManager => {
let maxIndex = historyRecordManager.count;
if(maxIndex > 6)
maxIndex = 6;
for(let i = 0; i < historyRecordManager.count; i++) {
if(i > 6)
break;
let data = historyRecordManager.getAt(i);
let data = historyRecordManager.getAt(maxIndex);
this.printRecord(i, data.date, data.score);
maxIndex--;
}
});
}
@@ -39,13 +44,12 @@ class HistoryBoard {
var style = { font: "20px Arial", fill: "#ffc", align: "right", boundsAlignH: "right", boundsAlignV: "top" };
style.boundsAlignH = "center";
game.add.text(posX, posY, date, style)
game.add.text(posX, posY, StringUtil.printMonthDay(date), style)
.setTextBounds(0, 0, 100, 60)
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
let numberWithCommas = NumberUtil.numberWithCommas(score);
style.boundsAlignH = "right";
game.add.text(posX + 80, posY, numberWithCommas, style)
game.add.text(posX + 80, posY, StringUtil.getScoreTextWithoutUnit(score), style)
.setTextBounds(0, 0, 100, 60)
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
}
@@ -61,14 +65,12 @@ class HistoryBoard {
.setTextBounds(0, 0, 40, 40)
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
let typingAppName = appName;
game.add.text(posX + 60, posY, typingAppName, style)
game.add.text(posX + 60, posY, appName, style)
.setTextBounds(0, 0, 60, 60)
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
let numberWithCommas = NumberUtil.numberWithCommas(score);
style.boundsAlignH = "right";
game.add.text(posX + 120, posY, numberWithCommas, style)
game.add.text(posX + 120, posY, StringUtil.getScoreTextWithoutUnit(score), style)
.setTextBounds(0, 0, 80, 60)
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
}