mdinfotech.net  



In class lesson on how to run Python hello world.

Resources
  • Python Quick Reference
  • Online GDB
  • Python Hello World
  • How to setup Python for VSCode
  • In class lesson on how Python variables, operators, and lists(arrays) are different from Java.

    Tutorials
  • Variables and Types
  • Lists
  • Basic Operators
  • In class lesson on String Formatting, String Operations.

    Tutorials
  • Basic String Formatting
  • Basic String Operations
  • In class lesson on User Input and Random Numbers.

    Tutorials
  • User Input
  • Random Integers in Python
  • In class lesson on how conditions (boolean expressions).

    Tutorials
  • Conditions
  • Loops
  • Write an algorithm you know from Java in Python.

  • Closed all.
  • In class lesson on functions (methods).

    Tutorials
  • Functions
  • In class challenge exercises to write some basic algorithms using Python.

    In class lesson on dictionaries.

    Watch this video: https://www.youtube.com/watch?v=daefaLgNkw0

    Try some dictionary programming exercises. Additional Tutorial

  • Dictionaries
  • Complete the 5 exercises at the end of the video.

    Tutorials
  • Pygame Hello World
  • To fully understand how pygame, and computer games in general, work, read this tutorial:

  • Pygame Primer
  • Below is a list of common errors students get during this unit, along with what it means and how to fix it.

    1. Anything in pygame is "not initialized": You did not initialize pygame. The fix: Call pygame.init() first in main.
    2. pygame anything does not exist: Meaning - you probably named your program "pygame.py" or "import pygame.py" and it is overriding the actual pygame library. The fix: Rename your file "hello.py" or something else.
    3. Your program was working, but now it says you have an error on line 1 and the console prompt looks like this: >>>: Meaning - Your console is in python command line instead of windows command line.The fix: Type exit() and hit enter.
    4. Something is not being drawn: The fix: First draw the background. Then blit/draw the images and text. Then call pygame.display.update() only once at the end of the game loop. Do not put update in an if or another loop. Never call it more than once.
    5. blah is not callable: Meaning - you are calling blah like it is a function, but it is not. ie. Suppose foo is a function that requires two parameters, a blah and a tuple, but you forgot the comma like this: foo(blah (x,y)). This will cause this error. The fix: use the comma to separate the parameters to foo: foo(blah, (x,y)).
    6. Tuples cannot be reassigned: Example
                          foo = (1, 'hello', 9.2)
                          foo1 = 'world' 
      . Meaning - Tuples are immutable, which means once they have been assigned, their values cannot be modified. The fix: Use a list instead.
                          foo =  1, 'hello', 9.2
                          foo1 = 'world' 

    Complete the 4 video lessons on Hangman.

    Tutorials
  • Hangman 1
  • Hangman 2
  • Hangman 3
  • Hangman 4
  • Now make the game yours. Have at least 50 different possible puzzles that are all related to a theme. Redesign the background and images used to reflect the theme.

    Assessment

    6/10 - you finished the tutorial.

    8/10 - you added 50 words related to a theme.

    10/10 - you redesigned the graphics to reflect the theme and it looks professionally done.

    Complete this tutorial on how to do a Platformer Game.

  • PyGame Platformer Tutorial
  • With a partner, write a Horse Oriented Platformer Game.

    Before you design your game, you need to know a little bit about horses. Read Horses 101 (Fun Facts, Breeds, Cost, Care, Riding, Etc.).

    Design a platformer game where the main character is a horse. The horse should face the kinds of challenges a real horse might face, however, feel free to use a bit of fiction and anthropomorphism to make the game your own. Start with the base code from the Youtube Platformer tutorials.

    Basic Criteria - all of the following must be added to the game:
    1. Lives or Health: Add a system of lives or health points for the player. The player should lose a life or health when colliding with enemies or hazards. When all lives are lost, the game should end.
    2. Food and Water: Each level must include a hay and a water item that must be picked up before leaving the level.
    3. Multiple Levels: For teams of 2, implement a minimum of 5 new levels. For teams of 3, implement a minimum of 10 new levels. These new levels must NOT BE PART OF THE ORIGINAL GAME. You may use the original game levels if you want, but they don't count Each level should have a unique layout, with increasing difficulty.
    Advanced Criteria - add as many of these criteria as you can in the time you have:
    1. Power-ups: Include power-ups that enhance the player's abilities, such as temporary invincibility, increased speed, or higher jumps. These power-ups should be scattered throughout the levels.
    2. Save/Load Game: Implement a save and load system that allows players to save their progress and resume from where they left off. Note: this will require saving data to a text file
    3. Time Limit: Set a time limit for each level, challenging the player to complete the level within a specified time frame. Display a timer on the screen.
    4. Boss Fight: Create a final boss level where the player must defeat a powerful enemy with specific attack patterns and strategies.
    5. Customization Options: Provide options for players to customize their character's appearance, such as different skins, colors, or accessories.
    6. High Scores: Implement a high score system that keeps track of the top scores achieved by different players. Display the high scores on a dedicated screen. Note: this will require saving data to a text file
    Assessment
    Assessment Rubric

    Milestones
    1. Milestone 1: Thursday May 30 - One basic criteria met
    2. Milestone 2: Monday June 3 - Two basic criteria met
    3. Milestone 3: Friday June 7 - All basic criteria met
    4. Milestone 4: Tuesday June 11 - Sprites, background, and platform graphics are updated to the ones you want in your final game.
    5. Final Game Due Tuesday June 18: In Class Demos of Final Game
    Resources

    Complete this tutorial on how to do a simple Tetris Game. Tetris with Pygame Tutorial

    Now make it your own by adding any, or all, of the following customizations:

    1. Hard dropping blocks
    2. 3 new custom blocks
    3. speed up as game progresses
    4. easy, medium, hard levels
    5. a preview of the next 3 blocks
    6. high scores saved to a file with user name
    7. save current game to file and be able to reload
    8. put a block on hold

    Assessment

    • Emerging: 1 customization
    • Developing: 2-3 customizations
    • Proficient: 4-5 customizations
    • Extending: 6-7 customizations