Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

surface.update seems to be buggy #27

Open
Sektoid opened this issue Oct 26, 2012 · 4 comments
Open

surface.update seems to be buggy #27

Sektoid opened this issue Oct 26, 2012 · 4 comments

Comments

@Sektoid
Copy link

Sektoid commented Oct 26, 2012

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
Copy link

tbbw commented Dec 25, 2012

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
Copy link
Owner

batiste commented Dec 25, 2012

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//issues/27#issuecomment-11670078.

@tbbw
Copy link

tbbw commented Dec 25, 2012

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
Copy link

tbbw commented Dec 25, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants