Fix: HistoryRecord, record -> score

This commit is contained in:
2018-05-17 09:01:50 +09:00
parent bdd8316fb5
commit 0f623e954c
4 changed files with 95 additions and 37 deletions
+13 -13
View File
@@ -60,11 +60,11 @@ class Start {
loadHistoryRecords() {
this.historyRecordManager.clear();
this.historyRecordManager.push(new HistoryRecordData("05/10", 15460));
this.historyRecordManager.push(new HistoryRecordData("05/11", 13040));
this.historyRecordManager.push(new HistoryRecordData("05/12", 16460));
this.historyRecordManager.push(new HistoryRecordData("05/13", 15060));
this.historyRecordManager.push(new HistoryRecordData("05/14", 19800));
this.historyRecordManager.push(new HistoryRecord("05/10", 15460));
this.historyRecordManager.push(new HistoryRecord("05/11", 13040));
this.historyRecordManager.push(new HistoryRecord("05/12", 16460));
this.historyRecordManager.push(new HistoryRecord("05/13", 15060));
this.historyRecordManager.push(new HistoryRecord("05/14", 19800));
}
printHistoryRecords(historyRecords) {
@@ -73,7 +73,7 @@ class Start {
for(let i = 0; i < this.historyRecordManager.count; i++) {
let data = this.historyRecordManager.getAt(i);
this.printRecord(i, data.date, data.record, underValue, upperValue);
this.printRecord(i, data.date, data.score, underValue, upperValue);
}
this.chartGraphics.lineStyle(3, 0xffd900, 1);
@@ -81,7 +81,7 @@ class Start {
this.chartGraphics.lineTo(game.world.width - 200, 0);
}
printRecord(index, date, record, min, max) {
printRecord(index, date, score, min, max) {
const CHART_GAP_PX = 180;
const style = { font: "32px Arial", fill: "#fff", align: "left", boundsAlignH: "center", boundsAlignV: "middle" };
@@ -90,15 +90,15 @@ class Start {
dateText.stroke = "#333";
dateText.strokeThickness = 1;
let numberWithCommas = NumberUtil.numberWithCommas(record);
let recordText = game.add.text(100 + index * CHART_GAP_PX, game.world.height - 300, numberWithCommas, style);
recordText.setTextBounds(0, 0, 100, 100);
recordText.stroke = "#333";
recordText.strokeThickness = 1;
let numberWithCommas = NumberUtil.numberWithCommas(score);
let scoreText = game.add.text(100 + index * CHART_GAP_PX, game.world.height - 300, numberWithCommas, style);
scoreText.setTextBounds(0, 0, 100, 100);
scoreText.stroke = "#333";
scoreText.strokeThickness = 1;
this.chartGraphics.lineStyle(50, 0xdddddd, 1);
this.chartGraphics.moveTo(50 + index * CHART_GAP_PX, 0);
this.chartGraphics.lineTo(50 + index * CHART_GAP_PX, -100 * ( (record - min) / (max - min) ));
this.chartGraphics.lineTo(50 + index * CHART_GAP_PX, -100 * ( (score - min) / (max - min) ));
}