Permalink
Browse files

Fixed save game

  • Loading branch information...
gilangcp committed Apr 26, 2012
1 parent d28cc75 commit 8117d842be18ace43c5065438f2916e23f90eea7
Showing with 4 additions and 2 deletions.
  1. +1 −0 stateManager.js
  2. +3 −2 vnEngine.js
View
@@ -141,6 +141,7 @@ function StateManager(){
vnEngine.soundController.playBGM(state.BGM);
self.setScreenStatus("game");
+ console.log(state.BGI);
vnEngine.graphicsManager.changeBackground(state.BGI, function(){
if(self.getOldScreenStatus() == "MAIN_MENU"){
vnEngine.graphicsManager.createDialogBox();
View
@@ -107,7 +107,7 @@ function vnEngine(){
this.stateManager.tempScriptCounter++;
this.parseScript(this.stateManager.tempScriptQueue,this.stateManager.tempScriptCounter);
}
- else{
+ else if(this.stateManager.scriptCounter<script.length){
this.stateManager.scriptCounter++;
this.parseScript(script,this.stateManager.scriptCounter);
}
@@ -761,13 +761,14 @@ function GraphicsManager(){
var res;
if(imageLabel.color == undefined){ //Check Background type if not solid color then get image resource
- vnEngine.stateManager.backgroundImage = imageLabel;
res = vnEngine.resourceManager.getResource(imageLabel);
if(res == false){
alert("script error \nChangeBackground : \nimageLabel : "+imageLabel+" not found \nscript line : "+vnEngine.scriptCounter);
}
}
else res = false;
+
+ vnEngine.stateManager.backgroundImage = imageLabel;
//if we use images as background
if(res){

0 comments on commit 8117d84

Please sign in to comment.