Wednesday, January 7, 2015
Today's task is to create a basic catching style game. I have uploaded the image files you will need below or you can watch the video on how to find your own. Then just watch the videos and type in the code as you create the game. Remember that you can make changes to the code to make it into what YOU want. Have fun!
Step1: Create folder and download image files:
Create a new folder on your desktop and name it "catching game." Download the "baseball.gif" and "player.gif" files below and drag them into the "catching game" folder that you just created on your desktop.
Step1: Create folder and download image files:
Create a new folder on your desktop and name it "catching game." Download the "baseball.gif" and "player.gif" files below and drag them into the "catching game" folder that you just created on your desktop.
![](http://www.weebly.com/weebly/images/file_icons/image.png)
baseball.gif | |
File Size: | 5 kb |
File Type: | gif |
![](http://www.weebly.com/weebly/images/file_icons/image.png)
player.gif | |
File Size: | 19 kb |
File Type: | gif |
Step 2: Create a canvas "game" window:
Open IDLE and create a new file. Save the file with the name "catch_game.py" and then type in the following lines of code. Run and debug your code when finished typing and then watch the video below for an explanation.
Step 3: Add baseball and a catcher:
Type in some more code below that is in the yellow square boxes. Run and debug your code when finished typing and then watch the video below for an explanation.
Step 4: Make the catcher move:
Type in some more code below that is in the yellow boxes. Run and debug your code when finished typing and then watch the video below for an explanation.
Step 5: Make the ball fall from random coordinates:
Type in more code that is in the yellow boxes. You will need to be extra careful with your typing at this point or you will have many errors to debug.
Step 6: Detect if the ball is caught and keep score:
Type in more code that is in the yellow boxes. You will need to be extra careful with your typing at this point or you will have many errors to debug.
Congratulations, you completed the "catch_game" code!