Chapter 8. Building Rat-man!

In this chapter, we will be building a game called Rat-man, which is actually a modified version of the famous game Pac-Man. We will use canvas, JavaScript, CSS, and HTML to build our game.

Let's start with introducing our game's characters:

  • Our game will have one rat. The player will act as the rat.
  • There will be four cats who will try to catch the rat and a lot of cheese for the rat to eat.
  • The main goal of the game is to eat all the cheese without being caught by the monster cats.

Sounds fun, right? Let's get right to it...

Note

To make our code clean, we will keep our JavaScript, CSS, and images files in separate folders. We will have three primary folders named as follows:

  • css
  • img
  • scripts

Game user interface

To start building ...

Get JavaScript Projects for Kids now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.