Dude With Overalls
- HTML5 Canvas
Clever things I did
One of the greatest challenges of this project was understanding how to detect tile collision, and upon detection, understanding how to handle it. Since this project was divided into classes with different responsibilities following OO approach, having to handle the collision on the Level class was a must! I implemented a unique pattern for iterating through the tiles of the entire level separating each tile based upon where the player intersects with it (either X-axis or Y-axis) and handle each collision based upon where the player is located on the canvas.
I created an Animation class that has the capability to iterate through a sprite image based upon a set value of milliseconds(15) and choose a specific segment of the sprite sheet at any given moment. The sprite sheet is divided into an array with sets of images that are to change according to keydown events as well as the durarion of the event in milliseconds.