batiste / sprite.js

An efficient javascript sprite animation framework
MIT License
871 stars 97 forks source link

surface.update seems to be buggy #27

Open Sektoid opened 12 years ago

Sektoid commented 12 years ago

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

tbbw commented 11 years ago

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.

batiste commented 11 years ago

Do you get any JavaScript error? On Dec 25, 2012 8:08 AM, "tbbw" notifications@github.com 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.

tbbw commented 11 years ago

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 commented 11 years ago

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