Add: RecordBoard, HistoryBoard, RankingBoard

This commit is contained in:
2018-05-16 10:55:10 +09:00
parent c307c69d8b
commit 3ea38a097b
5 changed files with 69 additions and 4 deletions
+6
View File
@@ -0,0 +1,6 @@
/////////////////////////////
// History board
class HistoryBoard {
}
+6
View File
@@ -0,0 +1,6 @@
/////////////////////////////
// Ranking board
class RankingBoard {
}
+49
View File
@@ -0,0 +1,49 @@
/////////////////////////////
// Record board
class RecordBoard {
constructor() {
this.chartGraphics = game.add.graphics(0, 0);
this.printRecordBoardHeader();
}
printRecordBoardHeader() {
let posX = 40;
let posY = game.world.height / 2 + 20;
var bar = game.add.graphics();
bar.beginFill(0x444444);
bar.drawRect(0, posY, game.world.width, RecordBoard.HEADER_BAR_HEIGHT_PX);
const style = { font: "32px Arial", fill: "#ffc", align: "left", boundsAlignH: "center", boundsAlignV: "middle" };
this.printHeader(posX, posY, "최근의 내 기록", style);
posX = 340;
style.fill = "#fff";
this.printHeader(posX, posY, "수업시간 순위", style);
posX = 560;
this.printHeader(posX, posY, "오늘의 순위", style);
posX = 780;
this.printHeader(posX, posY, "이달의 순위", style);
posX = 300;
posY = 480;
this.chartGraphics.lineStyle(3, 0x444444, 1);
this.chartGraphics.moveTo(posX, posY);
this.chartGraphics.lineTo(posX, posY + 200);
}
printHeader(x, y, title, style) {
game.add.text(x, y, title, style)
.setTextBounds(0, 0, 200, RecordBoard.HEADER_BAR_HEIGHT_PX)
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
}
}
RecordBoard.HEADER_BAR_HEIGHT_PX = 60;
+5 -4
View File
@@ -1,5 +1,5 @@
///////////////////////////// /////////////////////////////
// Start // Result
class Result { class Result {
@@ -26,7 +26,8 @@ class Result {
this.printScore(); this.printScore();
this.makeStartButton(); this.makeStartButton();
this.printRanking(); let recordBoard = new RecordBoard();
console.log(recordBoard);
// bottom // bottom
@@ -37,10 +38,10 @@ class Result {
screenBottom.printBottomCenterText(playingAppName); screenBottom.printBottomCenterText(playingAppName);
screenBottom.printBottomRightText(sessionStorageManager.playerName); screenBottom.printBottomRightText(sessionStorageManager.playerName);
this.loadHistoryRecords(); // this.loadHistoryRecords();
// this.loadTypingStageData(); // this.loadTypingStageData();
this.loadRanking(); // this.loadRanking();
} }
printScore() { printScore() {
+3
View File
@@ -24,6 +24,9 @@
<script src="../../game/lib/screen_bottom.js"></script> <script src="../../game/lib/screen_bottom.js"></script>
<!-- source files --> <!-- source files -->
<script src="../../game/result/history_board.js"></script>
<script src="../../game/result/ranking_board.js"></script>
<script src="../../game/result/record_board.js"></script>
<script src="../../game/result/result.js"></script> <script src="../../game/result/result.js"></script>
<script src="../../game/result/main.js"></script> <script src="../../game/result/main.js"></script>