Add: medals and new high score particle

This commit is contained in:
2018-09-12 09:08:04 +09:00
parent d458cedf7a
commit f38e779317
8 changed files with 107 additions and 21 deletions
+37 -18
View File
@@ -7,6 +7,9 @@ class Result {
game.load.image('icon_fullscreen', '../../../resources/image/icon/fullscreen_white.png');
Animal.loadResources();
RankingBoard.loadResources();
game.load.image('star', '../../../resources/image/ui/star_particle.png');
}
create() {
@@ -15,7 +18,6 @@ class Result {
this.game.stage.backgroundColor = '#4d4d4d';
this.chartGraphics = game.add.graphics(100, game.world.height - 120);
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
@@ -33,6 +35,7 @@ class Result {
// contents
this.printRecord();
this.printTodayBestRecord();
this.uploadRecord();
this.makeRestartButton();
@@ -45,6 +48,7 @@ class Result {
let recordBoard = new RecordBoard(RecordBoard.TYPE_DB);
}
// bottom ui
let screenBottomUI = new ScreenBottomUI();
screenBottomUI.printLeftTextWithBestRecord(Math.floor(sessionStorageManager.bestRecord));
@@ -90,27 +94,42 @@ class Result {
);
scoreText.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
scoreText.anchor.set(0.5);
}
recordUnit() {
let recordUnit = "";
if(sessionStorageManager.playingAppID >= 100)
return "점";
else
return "타";
}
if(sessionStorageManager.isNewBestRecrd === true) {
style.font = "32px Arial";
let bestRecordText = game.add.text(game.world.width / 2, 110, "!!! 새로운 최고 기록 !!!", style);
// .setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
bestRecordText.anchor.set(0.5);
bestRecordText.stroke = "#333";
bestRecordText.strokeThickness = 5;
}
/*
if(sessionStorageManager.bestRecord === null)
sessionStorageManager.bestRecord = 0;
let bestRecord = NumberUtil.numberWithCommas(sessionStorageManager.bestRecord);
style.font = "32px Arial";
let bestRecordText = game.add.text(0, 0, "오늘 최고 기록 : " + bestRecord, style)
.setTextBounds(0, posY + 80, game.world.width, 40);
// .setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
printTodayBestRecord() {
let newRecordEmitter = game.add.emitter(game.world.centerX, 140, 300);
newRecordEmitter.makeParticles('star');
newRecordEmitter.gravity = 300;
let style = { font: "32px Arial", fill: "#ff0", align: "left", boundsAlignH: "center", boundsAlignV: "middle" };
let bestRecordText = game.add.text(game.world.centerX, 220, "", style);
bestRecordText.anchor.set(0.5);
bestRecordText.stroke = "#333";
bestRecordText.strokeThickness = 5;
*/
if(sessionStorageManager.bestRecord === null)
sessionStorageManager.bestRecord = 0;
let todayBestRecord = 0;
let flooredBestRecord = Math.floor(sessionStorageManager.bestRecord);
let bestRecordWithCommas = NumberUtil.numberWithCommas(flooredBestRecord);
if(sessionStorageManager.record >= sessionStorageManager.bestRecord) {
sessionStorageManager.bestRecord = sessionStorageManager.record;
bestRecordText.text = "! : . 오늘 최고 기록 . : !";
newRecordEmitter.start(true, 2000, null, 20);
} else {
bestRecordText.text = "";
}
}
uploadRecord() {