PY-1.4-BP5-MQ30

Our Goal: Look Inside index.html

In this lesson, you will look inside the index.html file that was made when you turned your game into a web game. This file is like the main page of a website. You will find and learn about two important parts: the <canvas> part and the <script> parts. These parts help your game show up and work in a web browser.

Check Your HTML File

Before you look inside the index.html file, let's run a quick test. This test will check if the file is there and if it's ready for you to look at.

Run this command in your terminal:

pytest module-1.4/blueprint-BP5/quest-30

What you should see:

āŒ Some tests will fail. This is okay for now! It means the tests are waiting for you to look at the file and understand it.

Look at the index.html File

Now, you will open the index.html file and look for two important parts:

  1. The <canvas> part: This is like a special drawing board on the web page where your game will appear. It's where all the pictures and movements of your game will be shown.
  2. The <script> parts: These are like instructions that tell the web browser how to load and run your game. They bring in all the game's code so it can play in the browser.

Open your index.html file with a text editor (like Notepad or VS Code) or in your web browser (you can right-click and choose 'View Page Source'). Try to find these two parts and understand what they do.

Check Your Work Again

You've looked at the index.html file! Now, let's run the tests to make sure everything is correct.

Run this command in your terminal:

pytest module-1.4/blueprint-BP5/quest-30

What you should see:

āœ… All tests should pass! This means you successfully looked at the index.html file and understood its parts.

Documentation

Documentation not available for PY-1.4-BP5.