Animated Game Sprites: an HTML5 Canvas and Typescript Test


I decided to learn how to create an animation loop for canvas games that supports multiple sprites (moving characters and other elements) and also reacts to user input. This typescript game loop example uses the “W”, “A”, “S”, and “D” keys to move the player character through the many intimidating enemies. Though with no hit detection or health tracking, no one can really cause much trouble for anyone else.