
The HTML is very simple, and it gives you an anchor point for the Canvas and the rest of the code. You can download the project files from my GitHub repository here.įirst, create the HTML page. If so, this will be a good exercise for you too. You may be familiar with OOP but not used to seeing it implemented in JavaScript.

If you don’t have any experience at all with object-oriented programming, has a great introductory course that goes over the basics of Java and OOP. The inheritance and abstraction are very simple. If you’re just starting out with object-oriented programming, this is a good introduction. The user has to navigate the player through the bugs without getting hit. The object of the game is for the player to bring the gem back from the other side of the road. You can see an example of the game we will be creating here. The complete project files are in GitHub.

In this step by step guide, I’ll show you how to create a game with pure JavaScript and HTML5 Canvas.
