-1

I've started learning game development using HTML5/CSS/JS and started with a small game which can be seen in this AWS storage http://oren.com.s3-website-eu-west-1.amazonaws.com/

When you open it and click SPACE you can see the ball starts moving (animating) and there are small stops every so often.

My question: This animation works perfectly when I'm running this locally (index.html and JS files locally on my laptop folder - available in GitHub https://github.com/OrenTa/Advanced-first-game)

What is the reason? what can I do?

Oren T
  • 11
  • 3
  • 1
    I don't see any small stop... – Adriano Repetti Feb 09 '16 at 09:49
  • 1
    you game works fine... – Akshay Gupta Feb 09 '16 at 09:51
  • Don't use `setTimeout`, use `requestAnimationFrame` instead. Also, you may want to check the actual elapsed time since the last update when updating position, rather than rely on it being fixed. – jcaron Feb 09 '16 at 10:56
  • Your game works fine as mentioned above, I'm not experiencing small stops either. – Gerwin Feb 09 '16 at 11:16
  • Thanks. I will try to check it on a different laptop and different network connection. Anyway - as the JS file is downloaded locally I would assume that also with an on-line access the behavior should be network independent. after the initial access the game is working locally - no need for the internet. – Oren T Feb 09 '16 at 12:22

1 Answers1

1

This could be as simple as connection speed. Try opening your game in Chrome and run developer tools (ctrl+shift+i) then click on the 'Network' tab to see what is happening in terms of load times etc. Udacity.com have a good short course on optimisation for browser rendering you might find useful : https://www.udacity.com/courses/ud860

Warren Reilly
  • 344
  • 3
  • 14