Level 5: Online Articles - IncrediCoders/Python1 GitHub Wiki

Intelli_Avatar_8

Intelli-Scents added this page on March 14, 2023


Here are some more articles that will help you with level layout, player movement, and data files. You can skip down to these sections on the page:

More About Level Layout

  • Discover Python and Create Levels - patternsgameprog.com - This site gives you a description of the five steps for layering a created level. The steps that are described are the assets, creating a new level, creating layers, creating the title sets, and finally editing the level.

  • Arcade: Python Game Framework - Real Python - This page gives a brief description of many types of movements, backgrounds and other information on level layout. There are also coded examples for most of these sections, that provide example code on how to create a level layout.

  • Pygame Level Generation - coderslegacy.com - This site goes more into depth about specific aspects of level layout. There are long chunks of code throughout this site that provide examples of what level layout using the strategies that they talk about earlier look like written out.

  • Python Game Programming - Programmer Books - This is a long document about a complete Python game. You do not have to look through all of it, however, look at the table of contents for areas you are stuck on or curious about, and this site will give a good description of that item.

Level Layout Videos

  • Make a 2D Side-Scroller Game - Real Python - This video series shows you an example of a game created used the level layout steps. It is a 2D side scroller game and it provides videos of each of the steps that they did to create the game, allowing you to make or follow along with them as they make the game.

  • Adding a Background Image - buildwithpython - In this video, the creator describes what a background image is, and how to upload one to a Python program. Then, he uses and existing game that he created through pygame and inserts a background image into that program.

  • Scrolling with Python - TokyoEdtech - In this video, the creator describes what a scrolling background is and how to use it in Python. Then, he writes out a written coded examples and incorporates the scrolling background into that program and describing the steps that change what the scrolling background does.

  • Flappy Bird Beginner Tutorial - CodingWithRUss - In this video, he creates a Flappy Bird game using code and then he goes step by step on how to incorporate each command to make this program. He puts an emphasis on the background and how to get the background to follow the bird as it travels across the screen.

Level Layout Examples

  • Pygame Scrolling Background - coderslegacy.com - This site gives you an example of level layout in a program. This game has a scrolling background and this site will take you step by step on how to make that scrolling background. They also write out the code for each step and give a final example of all the code commands together to create that scrolling background.

  • Build a Platform Game - Real Python - This site provides an example of the different types of level layouts, and it gives written out coded examples to show how the description that they gave works. If there are certain parts that you are stuck on, you can click them in the table of contents, and it will lead you right to that section.

More About Player Movement

  • Moving Your Game Character Around - OpenSource.com - This site goes into detail about the different movements that a sprite or character can do in a Python game. After the description, there is written out code that shows an example of the concept being described in that section.

  • Pygame RPG Tutorial: Player Movement - CodersLegacy - This site gives a description of how to make your character run, and also how to you events and the "if key is pressed" function. There is also a section about character warping which will not be talked about in this level, but is still interesting to look at.

  • Python Game Programming - Programmer Books - In Chapter 4. Steering Behaviors, this open-source book shows you how to create fluid movements for characters. This gives you the ability to navigate through the game world.

  • Python: Player Movement - Stack Overflow - This page is a question and answer forum for Python code. The question asked is about player movement and keys pressed functions, the answer provides a very thorough description of player movement, and also has a coded example.

Player Movement Videos

  • Pygame Tutorial: Basic Movement - TechWithTim - This site starts with a YouTube video that describes the different basic movements of a character. Before describing character movement, it shows you how to install Pygame and also open a coding window that will allow you to write your code for this program. There are also coded examples throughout this site showing what certain movements look like.

  • Animations with Sprites - ClearCode - In this video, he describes how to use sprites to create an animation on a button press and also how to control the speed of the animation, all happening in the Python module Pygame. He goes step by step describing each command and animation.

  • Character Animations and Sprites - TechWithTim - In this video, he describes how to use sprites and images in pygame and how to import images into aprogram and how to use them to animate a character while walking, running and jumping using the module pygame.

Player Movement Examples

  • Snake Game With Pygame - edureka.co - This site gives you an example of player movement in a program. Of the sections, the fourth one is going to be actually moving the snake. Take a look through this code to see the different movements that the snake is making. Then, for section seven, see what code commands change the length of the snake.

  • Python Pygame Tutorial - coderslegacy.com - This site gives you an example of player movement in a program that has a moving background. The code is using a car that is weaving through traffic on the scrolling background. Take a look at the code commands for the movement of the cars.

  • Python Platformer: Moving the Player Sprite - Real Python - This page gives a coded example of player movement. It also displays the screen of the program, and you can see what lines of code do what on the screen. It also gives a description of how to use the "WASD" and "IJKL" keys which are common key presses for player movement.

  • Move with a Sprite Animation - Python Arcade Library - This page starts with a YouTube video describing the different aspects of player movement in animation. Then, below the video, there is written out code with brief descriptions that show how the concepts in the video can be used to write a coded example of a program using player movements.

  • Build an Asteroids Game - Real Python - This page provides an example of a program that uses player movement. In this case, you are using an asteroid and a space ship, and controlling the space ship to go around the asteroids. This page will show you how to install pygame, open a new window, and then how to get started on making the program.

  • Python Arcade Player Movement - ObjectRocket - This site gives you a description of the different key functions and code lines that can be involved in player movement. Then, it describes what they mean and gives a coded example below it to show that meaning written out.

More About Data Files

  • Reading and Writing Files in Python - Guru99 - This page gives an in depth description of the many functions that come with files. The main ones that it describes are creating the text file, reading it, writing it, opening it, and then finally appending it.

  • Python Data File Formats - DataFlair - This site gives examples of the different types of files that Python code uses. It goes into detail about CSV, JSON, and XLS files. While all these file types do not necessarily show up in these levels, it is still interesting to see the other file types available.

  • Python Reading Data Files - AskPython - This page specifically talks about reading files in Python. It gives brief descriptions of the different parts of how to read a file, as well as coded examples of each of theses steps. There is also a section about .data files and binary files.

Data File Videos

  • Reading/Writing Files - codebasics - In this video, he uses Python programming to clarify about reading and writing files, and how to work with a file, how to open, create and close a file, use of “functions”, “modules” and “flags” and shows an example of each of these concepts.

  • Python Reading Files - Mike Dane - In this video, he describes how to read files in Python. He then creates a written out coded example in a Python program and shows each of the different steps of reading a file, as well as the file types that can be incorporated into the reading file command.

  • Text Files in Python - Socratica - In this video, she describes how to read and write text files in Python. She first describes what a text file is, and how to incorporate it into the Python program, then she creates a written out coded example that includes reading and writing files.

  • Reading and Writing to Files - Corey Schafer - In this video, he describes how to read and write to files. You will likely come into contact with file objects at some point while using Python, so knowing how to read and write from them is extremely important.

  • File Handling - Telusko - In this video, he describes how to do file handling in Python which incorporates all of the elements of files like reading and writing in Python. He then provides a written out coded example showing each of these concepts and how they are used.

Data File Examples

  • Open, Read, and Write Text Files - AdamTheAutomator - This site gives an example of both reading, writing and opening text files. It also provides a description and coded examples of how to read, write, and open CSV files, which is another type of file that is commonly used in coding.

  • Python Programming File Operation - Programiz - This site provides an example of file operation and data files in a YouTube video. It also provides each of the steps, as well as coded examples for both opening and closing a file. There are also other functions of files that have coded examples.

Next Steps

Next, you can take on the two extra challenges to chase the Creeper and learn more! When you're done, you can move on to Level 6, the Boss Battle!

Take the Challenges!

  1. Challenge 1: In this challenge, you are going to write code that will help Paul Python chase the Creeper.

  2. Challenge 2: In this challenge, you are going to add more code to the simulator where Paul Python is chasing the Creeper.

  3. Bonus Challenge: In this extra challenge, you'll see how to make your own levels for Paul to run and jump (and fly) through! Practice your game design skills!

More Level 5 Resources

In addition to this Online Articles page and the instructions for our Level 5 challenges, we also have a Help Page, a Learning Quiz, an Unplugged Activity, and a Rewards article:

  • Level 5: Help - This page helps you complete the instructions in the book, in case you get stuck.

  • Level 5: Learning Quiz - I wrote some questions in case you want to quiz yourself about what you learned. Or you can teach others and quiz them!

  • Level 5: Unplugged Activity - I wrote this page with more details than what you saw in the book. In this game,

  • Level 5: Rewards - If you completed the Creeper Chase program that we talked about, then I set up this page to act as a reward. You can see some illustrations of me and learn more about who I am! You'll also find the **WHAT **Award digital download, to show off your accomplishment!

Level 6

After you're completely done with Level 5 (did you do the challenges?), then it's time to move on to Level 6! While you read through Level 6 in your book, you can check out the resources from Paul Python, as he teaches you how to build the Boss Battle program:

I hope you had fun learning about the Creeper Chase!

--

⚠️ **GitHub.com Fallback** ⚠️