sprite.js icon indicating copy to clipboard operation
sprite.js copied to clipboard

surface.update seems to be buggy

Open Sektoid opened this issue 13 years ago • 4 comments

I just want to create a 5x5 moving background and after 5 seconds add 5x5 tiles to existing ones. But it seems like it can properly update surface only once. After that it updates only coordinates changes. Maybe I`m missing something?

https://github.com/Sektoid/sprite.js/blob/master/tests/test_scrolling.html

Sektoid avatar Oct 26 '12 12:10 Sektoid

If you just take the default example and change this line: surface.move(-1 * ticker.lastTicksElapsed, -1 * ticker.lastTicksElapsed); to this: surface.move(ticker.lastTicksElapsed, ticker.lastTicksElapsed); It locks up after a few seconds.

tbbw avatar Dec 25 '12 07:12 tbbw

Do you get any JavaScript error? On Dec 25, 2012 8:08 AM, "tbbw" [email protected] wrote:

If you just take the default example and change this line: surface.move(-1 * ticker.lastTicksElapsed, -1 * ticker.lastTicksElapsed); to this: surface.move(ticker.lastTicksElapsed, ticker.lastTicksElapsed); It locks up after a few seconds.

— Reply to this email directly or view it on GitHubhttps://github.com/batiste/sprite.js/issues/27#issuecomment-11670078.

batiste avatar Dec 25 '12 08:12 batiste

yeah it fails at scrolling.js at row 175.

Uncaught TypeError: Cannot read property 'x' of undefined

Just try the change to the surface.move and it will halt for you too :)

tbbw avatar Dec 25 '12 09:12 tbbw

Ok it's between 4 seconds and up to 60 seconds at longest.

tbbw avatar Dec 25 '12 22:12 tbbw