Playing the game

If you correctly integrated the code and your HTML file now looks similar to the following, you can now run the HTML file:

<html>
  <head>
    <link href="css/reset.css" rel="stylesheet"/>
    <link href="css/styles.css" rel="stylesheet"/>
  </head>
  <body>
    <canvas id="main_canvas"></canvas>
    <button id="blackout" onclick="APP.Reset()"></button>
    <script src="scripts/app.constants.js"></script>
    <script src="scripts/app.init.js"></script>
    <script src="scripts/app.display_functions.js"></script>
    <script src="scripts/app.movement_functions.js"></script>
    <script src="scripts/app.key_handler.js"></script>
    <script src="scripts/app.main.js"></script>
  </body>
</html>

After running the HTML file on your browser, you will be able to see the following screen:

Playing the game

Congratulations! You have successfully built Rat-man!

To play the game, click anywhere on the canvas and use the arrow keys for your rat's movement.

If you lose all your lives, you will see the following screen:

Playing the game

If you win, you will see the following screen:

Playing the game
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.60.192