From 9efe75e0ce2c65f02cf07cc7ae96fb3bab15092b Mon Sep 17 00:00:00 2001 From: Robert Chen Date: Sun, 1 Dec 2013 23:06:07 -0800 Subject: [PATCH] Fixed skybug --- js/ui.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/ui.js b/js/ui.js index c565a32..b506cd9 100755 --- a/js/ui.js +++ b/js/ui.js @@ -747,7 +747,8 @@ function WindowUI( stage, gameState ){ dayNight.y=30; var secondCounter = 0; - mood.x = dayNight.x = -(new Date( gameState.currentTime ).getHours()*682.625); + var newpos = -(new Date( gameState.currentTime ).getHours()*682.625); + mood.x = dayNight.x = newpos < -15583 ? 0 : newpos; var ground = new createjs.Bitmap( "res/screens/Window/Ground.png" ); var houses = new createjs.Bitmap( "res/screens/Window/Housefar.png" ); @@ -770,7 +771,7 @@ function WindowUI( stage, gameState ){ // Fast forward, move sky gameState.pubsub.subscribe( "SkipTime", function(){ var newpos = -(new Date( gameState.currentTime ).getHours()*682.625); - dayNight.x = mood.x =newpos < -15583 ? 0 : newpos; + dayNight.x = mood.x = newpos < -15583 ? 0 : newpos; }); stage.addChild( dayNight );