Add: RecordUtil

This commit is contained in:
2018-12-03 00:25:16 +09:00
parent 057ac18184
commit eb61871526
12 changed files with 92 additions and 270 deletions
+4 -24
View File
@@ -58,7 +58,7 @@ var Result = {
// bottom ui
var screenBottomUI = new ScreenBottomUI();
screenBottomUI.printLeftTextWithAppHighestRecord(Math.floor(sessionStorageManager.getAppHighestRecord()));
screenBottomUI.printLeftTextWithAppHighestRecord(sessionStorageManager.getAppHighestRecord());
screenBottomUI.printCenterText(sessionStorageManager.getPlayingAppKoreanName());
screenBottomUI.printRightText(sessionStorageManager.getPlayerName());
},
@@ -87,16 +87,6 @@ var Result = {
if(sessionStorageManager.getRecord() === null)
sessionStorageManager.setRecord(0);
var record = 0;
if(sessionStorageManager.getPlayingAppID() == 104) {
var recordTime = sessionStorageManager.getRecord();
record = recordTime.toFixed(3);
} else {
record = NumberUtil.numberWithCommas(Math.floor(sessionStorageManager.getRecord()));
}
style.font = "80px Arial";
if(isTypingPracticeApp() || isTypingTestApp()) {
var animalLevelID = 0;
if(isTypingPracticeApp())
@@ -111,27 +101,17 @@ var Result = {
rightAnimal.startAnimation(Animal.SPECIES_DATA[animalLevelID]);
}
var record = sessionStorageManager.getRecord();
style.font = "80px Arial";
var scoreText = game.add.text(
x, y,
record + StringUtil.getScoreUnit(sessionStorageManager.getPlayingAppID()),
RecordUtil.getRecordValueWithUnit(record, sessionStorageManager.getPlayingAppID()),
style
);
scoreText.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
scoreText.anchor.set(0.5);
},
/*
recordUnit: function() {
var recordUnit = "";
if(sessionStorageManager.getPlayingAppID() == 104)
return "초";
else if(sessionStorageManager.getPlayingAppID() >= 100)
return "점";
else
return "타";
},
*/
printTodayBestRecord: function() {
var newRecordEmitter = game.add.emitter(game.world.centerX, 140, 300);
newRecordEmitter.makeParticles('star');