Jump to content

Urgent problem, help please


Jorge
 Share

Recommended Posts

Hi all,

my sponsor has mailed me because they are having problems with my game. They say it's freezing before the game over screen. They are using Ipad. I'm testing the game in Chromium for linux, Chrome and native browser in Android, and Safari in Ipad 4 with IOS 7 and having no problems at all.

Please, could you try if it freezes for you? 

https://dl.dropboxusercontent.com/u/2914532/HTML5/Sky_translated2/index.html

Thanks for your help!!

Link to comment
Share on other sites

 

Works fine with Chrome on Samsung Galaxy S3.

 

Doesn't work for me in desktop Firefox 25 with the following

ReferenceError: gang_out is not defined    main.js (line 905)ReferenceError: girl_out is not defined    main.js (line 958)

Thanks!! Time to use Firefox for testing!!

Link to comment
Share on other sites

Tested on Mobile Safari on an iPhone 5 with iOS 6.1.4. Froze after I made it to the fourth level and missed one of the bad guys. Screen got a pink tint and locked up.

I use browserstack.com to test the games in different mobile browsers, and it's working fine in every emulated iPhone and iPad, I suppose it's not enough. It seems like on real hardware, there are some problems with nested functions. I changed my code a little to avoid the problem, could you try it again, please? Thanks!

Link to comment
Share on other sites

It seems like on real hardware, there are some problems with nested functions. I changed my code a little to avoid the problem, could you try it again, please? Thanks!

Ran through it again on iOS 6.1.4 on an iPhone 5. Startup time felt snappier (though that could just be image caching). Sadly, saw the same pink overlay and freeze when I got to level four and missed one of the bad guys.

 

Took a look at the source. The only thing that seems off is around line 1039.

if(typeof(Storage)!=="undefined"){  localStorage.setItem("chocolatepixel.skyscraper", hiscore);}

Shouldn't that check be

if(typeof localStorage !== undefined){  localStorage.setItem("chocolatepixel.skyscraper", hiscore);}
Edited by onefrankguy
Link to comment
Share on other sites

 

Ran through it again on iOS 6.1.4 on an iPhone 5. Startup time felt snappier (though that could just be image caching). Sadly, saw the same pink overlay and freeze when I got to level four and missed one of the bad guys.

 

 

 

 

Took a look at the source. The only thing that seems off is around line 1039.

if(typeof(Storage)!=="undefined"){  localStorage.setItem("chocolatepixel.skyscraper", hiscore);}

Shouldn't that check be

if(typeof localStorage !== undefined){  localStorage.setItem("chocolatepixel.skyscraper", hiscore);}

You are right, I copied it from this tutorial: http://www.w3schools.com/html/html5_webstorage.asp

 

Edit: I have changed it. I don't want to steal your time, I'm sorry. It'd be great if you could try for the last time. I'm using Createjs because it's pretty similar to the native tools I've been using for years, but I think if the problem persists, I'll try phaser for my next games.

Link to comment
Share on other sites

It'd be great if you could try for the last time.

More debugging. I'm thinking the localStorage thing might be a red herring. Sometimes it works, like if I get two gang members back to back and just let them shot me. Poking through the code to see if I can figure out why.

 

Okay, here's something else that looks suspicious around line 1023.

function window_active(){  is_enemy[this_index]=0;  allow_change[this_index]=true;}

The window_active() function references the this_index variable, but I'm not seeing that variable defined globally. The closest we get is an argument to the close_window() function at line 1018.

function close_window(this_index){  createjs.Tween.get(win_index[this_index]).to({image:sp_window2},10).wait(animation_speed).to({image:sp_window1},10)    .wait(animation_speed).to({image:sp_window4},10).call(window_active);}

I think window_active needs a this_index argument, and close_window needs to pass this_index into it as .call(window_active, [this_index]).

Edited by onefrankguy
Link to comment
Share on other sites

More debugging. I'm thinking the localStorage thing might be a red herring. Sometimes it works, like if I get two gang members back to back and just let them shot me. Poking through the code to see if I can figure out why.

Maybe it freezes when you actually beat your high score and tries to save? Just guessing.

Edit: I feel a little embarrased as I never thought someone would watch the code. I suppose it`s not very clear :P

Link to comment
Share on other sites

function close_window(this_index){  createjs.Tween.get(win_index[this_index]).to({image:sp_window2},10).wait(animation_speed).to({image:sp_window1},10)    .wait(animation_speed).to({image:sp_window4},10).call(window_active);}

I think window_active needs a this_index argument, and close_window needs to pass this_index into it as .call(window_active, [this_index]).

 

 

Done. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...