PY-1.4-BP5-MQ10

Our Goal: Put Your Game on the Internet

In this lesson, you will learn how to put your Pygame game on the internet so anyone can play it in their web browser. You will learn about 'static site hosting' and how a tool called 'GitHub Pages' helps you do this. It's like putting your game on a special website for free!

Get Ready to Learn

For this lesson, you will be learning new ideas. There are no computer tests to run for this part. You just need to understand what 'static site hosting' is and how GitHub Pages helps you put your game on the internet.

Learn About Web Hosting

Now, let's learn about how games get on the internet:

  1. Static Site Hosting: This is like a simple website that just shows files. It doesn't do anything fancy, just shows your game files.
  2. GitHub Pages: This is a free tool from GitHub that lets you put your game files on the internet. It's a type of static site hosting.
  3. Pygame for the Web: To put your Pygame game on the internet, you need to change it into special web files (like HTML, which is what websites are made of). A tool helps you do this.
  4. HTML Game: When your game is ready for the web, it will be put inside an HTML file. This file will have a special box called a <canvas> where your game will play, and some <script> tags that help load your game.

Learn About Getting Your Game Online

Now, let's learn about how to get your game online and make sure it works:

  1. Test Locally: Before you put your game on the internet, it's a good idea to test it on your own computer using a special web server. This makes sure it works before everyone else sees it.
  2. GitHub Pages Settings: You will need to tell GitHub to show your game on the internet. This is done in the settings of your GitHub project.
  3. Push to Go Live: Once your game is ready, you will 'push' your game files to GitHub. This will make your game appear on the internet.
  4. Check Online: After you push your game, you will go to a special web address to make sure your game is working for everyone.

Check What You Learned

You've learned about putting your game on the internet! Now, think about what you learned.

Ask yourself:

āœ… Can you explain what 'static site hosting' is? āœ… Can you explain how GitHub Pages helps you put your game online? āœ… Do you know the basic steps to get your Pygame game ready for the web and put it online?

If you answered yes to these questions, you did a great job!

Documentation

Documentation not available for PY-1.4-BP5.