Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by mandarin

Hello!

A little while ago I held a 4 day game developer course using ImpactJS, and created a little platform game which the students could use to modify. I have recently uploaded it to my website for all to see and modify/fork for themselves. In the process of cleaning up the code I noticed that when playing the game in Safari 5.1.5 on OS X 10.6.8, I get an error in the console after I have killed the boss.

This is the error:
INVALID_STATE_ERR: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable. Occurs at sound.js:98
INDEX_SIZE_ERR: DOM Exception 1: Index or size was negative, or greater than the allowed value. Occurs at image.js:165

The same game works fine in Google Chrome. Where's the problem? Safari or my code?

Preloading on Safari does also take a small eternity. It's stuck for 10-15 seconds before moving on. Does anyone else get the same behaviour?

You can read about the development course and play the game here: http://mandarin.no/games/noroff/

--
Thomas

1 decade ago by alexandre

Thomas, I'm sorry I can't help (too rushed right now) with this problem but...

I just wanted to say that your blog post was very interesting and reflects very much my own experience here in China, as a foreigner teaching game dev from time to time. Well written and inspiring.

Cheers
Alex

1 decade ago by mandarin

Thank you Alex. Teaching was very inspiring for me too. I'd do it again if I get the chance.

1 decade ago by mkreitler

Hi Thomas,

I experienced a similar problem trying to play a large music file. Sometimes, the game would try to play it before the resource had fully loaded. At least, that's my suspicion, based on some reading I did on the INVALID_STATE_ERR and asynchronous loading.

I worked around it by wrapping the "play" command in a "try-catch" block, which I called from update() for a max of "timeout" seconds (30, in my case). After the timeout, I stop trying to play the resource.

This fixed the problem for me, and I have yet to fully "timeout" and fail to play the music.

Don't know if that will work for your boss fight, but maybe it'll spark another idea for you.
Page 1 of 1
« first « previous next › last »