Add: RecordBoard, HistoryBoard, RankingBoard
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
/////////////////////////////
|
||||
// History board
|
||||
|
||||
class HistoryBoard {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
/////////////////////////////
|
||||
// Ranking board
|
||||
|
||||
class RankingBoard {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////
|
||||
// Start
|
||||
// Result
|
||||
|
||||
class Result {
|
||||
|
||||
@@ -26,7 +26,8 @@ class Result {
|
||||
this.printScore();
|
||||
this.makeStartButton();
|
||||
|
||||
this.printRanking();
|
||||
let recordBoard = new RecordBoard();
|
||||
console.log(recordBoard);
|
||||
|
||||
|
||||
// bottom
|
||||
@@ -37,10 +38,10 @@ class Result {
|
||||
screenBottom.printBottomCenterText(playingAppName);
|
||||
screenBottom.printBottomRightText(sessionStorageManager.playerName);
|
||||
|
||||
this.loadHistoryRecords();
|
||||
// this.loadHistoryRecords();
|
||||
|
||||
// this.loadTypingStageData();
|
||||
this.loadRanking();
|
||||
// this.loadRanking();
|
||||
}
|
||||
|
||||
printScore() {
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
<script src="../../game/lib/screen_bottom.js"></script>
|
||||
|
||||
<!-- 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/main.js"></script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user