Jump to content

aking

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. Thanks for taking the time to debug the code I posted and for sharing your findings. Thanks for pointing out the issue; I was under the impress canvas values (i.e. size) could be set via CSS. I certainly plan on using frameworks (like pixi, easel, quintus, etc) but thought it best to first become familiar with the underlying toolset. Of these frameworks do you have any recommendations? FYI: The posted code has other "bugs" and/or warts, for example, I originally wrote the code in object literal syntax but later switched. I can post an acceptable (read more complete), revised version later
  2. Hi, I'm using HTML5 (canvas) and javascript to implement the well-known snake game. I opted to encapsulate the game within the 3 following classes: "renderer", "snake", and "game". I use a "Uint8Array" to store the location (x,y) of each section of the snake, therefore the maximum distance the snake can travel is 255x255. Here lies the issue I'm facing. While the border of the game is set at 255, the snake "visually" seems to meet this border before that value. However, the x coordinate upon debugging does equal 255. I'd appreciate help in understanding why the visual does not match the unde
×
×
  • Create New...