Fix: HTML description for search engine

This commit is contained in:
2018-12-04 21:00:34 +09:00
parent 458b48bcf5
commit 7a64a7035f
22 changed files with 63 additions and 59 deletions
+4 -11
View File
@@ -1,8 +1,8 @@
var Game = {
preload: function() {
game.stage.disableVisibilityChange = true;
},
// preload: function() {
// game.stage.disableVisibilityChange = true;
// },
create: function() {
game.physics.enable(this, Phaser.Physics.ARCADE);
@@ -60,14 +60,7 @@ var Game = {
screenTopUI.makeBackButton( (function() { this.back(); }).bind(this) );
screenTopUI.makeFullScreenButton();
this.stopWatch = new StopWatch(
60, // sec
(function() {
this.setClickEnable(false);
this.gameOver();
}).bind(this)
);
this.stopWatch = new StopWatch(game);
// bottom ui
+20 -13
View File
@@ -1,6 +1,6 @@
function StopWatch() {
this.ellpasedTime = 0;
this.startTime = 0;
this.ellapsedTime = 0;
// this.startTime = 0;
this.isPaused = true;
var fontStyle = StopWatch.DEFAULT_TEXT_FONT;
@@ -24,12 +24,15 @@ function StopWatch() {
StopWatch.prototype.start = function() {
this.isPaused = false;
this.startTime = game.time.totalElapsedSeconds();
// this.startTime = game.time.totalElapsedSeconds();
this.ellapsedTimer = game.time.create(false);
this.timerEvent = this.ellapsedTimer.loop(10, this.updateTimer, this);
this.ellapsedTimer.start();
this.printTime();
if(this.timerEvent === null)
this.timerEvent = game.time.events.loop(Phaser.Timer.SECOND / 100, this.updateTimer, this);
// this.timerEvent = game.time.events.loop(Phaser.Timer.SECOND / 100, this.updateTimer, this);
}
StopWatch.prototype.pause = function() {
@@ -41,31 +44,35 @@ StopWatch.prototype.resume = function() {
}
StopWatch.prototype.stop = function() {
var recordTime = game.time.totalElapsedSeconds() - this.startTime;
// var recordTime = game.time.totalElapsedSeconds() - this.startTime;
this.removeTimer();
if(this.timerEvent)
this.removeTimer();
return recordTime;
// return recordTime;
return this.ellapsedTime;
}
StopWatch.prototype.updateTimer = function() {
if(this.isPaused == true)
return;
this.ellpasedTime = game.time.totalElapsedSeconds() - this.startTime;
// this.ellapsedTime = game.time.totalElapsedSeconds() - this.startTime;
this.ellapsedTime += 0.01;
this.printTime();
}
StopWatch.prototype.printTime = function() {
this.timerText.text = RecordUtil.getRecordValueWithUnit(
this.ellpasedTime, sessionStorageManager.getPlayingAppID()
this.ellapsedTime, sessionStorageManager.getPlayingAppID()
);
}
StopWatch.prototype.removeTimer = function() {
game.time.events.remove(this.timerEvent);
this.timerEvent = null;
if(this.timerEvent)
this.timerEvent = null;
this.ellapsedTimer.stop();
this.ellapsedTimer = null;
}