Add: print sample - graph, ranking

This commit is contained in:
2018-08-10 18:16:15 +09:00
parent d97dbaa20f
commit ae42c35807
10 changed files with 188 additions and 14 deletions
+30 -4
View File
@@ -11,8 +11,8 @@ class Start {
this.dbConnectManager = new DBConnectManager();
this.game.stage.backgroundColor = '#4d4d4d';
this.chart = new Chart();
this.howToPlay = new HowToPlay();
this.chart = new Chart();
// top
@@ -33,7 +33,13 @@ class Start {
// contents
this.loadHowToPlay(sessionStorageManager.playingAppID);
this.makeStartButton();
this.loadChart();
if(sessionStorageManager.maestroAccountType == 0) { // experience account
this.printSampleChart();
this.announceBox = new AnnounceBox(50, 648);
this.announceBox.drawBox("체험 계정에서는 기록이 저장되지 않습니다.");
} else {
this.loadChart();
}
// bottom
@@ -79,8 +85,6 @@ class Start {
sessionStorageManager.maestroID,
date,
historyRecordManager => {
this.chart.printChartBaseLine();
if(historyRecordManager.count == 0) {
console.log("start - history record : no data");
return;
@@ -105,10 +109,32 @@ class Start {
minValue, maxValue
);
}
this.chart.printChartBaseLine();
}
);
}
calcDate(daysBefore) {
let date = new Date();
date.setDate(date.getDate() - daysBefore);
return date;
}
printSampleChart() {
let minValue = 0;
let maxValue = 1000;
this.chart.drawRecordGraph(0, this.calcDate(1), 980, minValue, maxValue);
this.chart.drawRecordGraph(1, this.calcDate(2), 760, minValue, maxValue);
this.chart.drawRecordGraph(2, this.calcDate(5), 740, minValue, maxValue);
this.chart.drawRecordGraph(3, this.calcDate(7), 690, minValue, maxValue);
this.chart.drawRecordGraph(4, this.calcDate(8), 710, minValue, maxValue);
this.chart.drawRecordGraph(5, this.calcDate(10), 560, minValue, maxValue);
this.chart.drawRecordGraph(6, this.calcDate(20), 480, minValue, maxValue);
this.chart.printChartBaseLine();
}
makeStartButton() {
let setting = new RoundRectButtonSetting(game.world.centerX, game.world.centerY, 200, 100);
setting.fontStyle.fontWeight = "bold";