Summit Middle School classes for Andrew Busch
Andrew Busch - Summit
  • Home
  • Algebra 1
    • Alg 1B - Last Week
    • Alg1B 14 HW - Intro to Functions
    • Alg 1B 11 - Rational Expressions
    • Alg 1B 12 - Radical Expressions
    • Alg 1B 10 v2.0 - Quadratic Functions >
      • 10b Graphing with Pennies - Desmos Tutorial
      • 10i Snowboard Quadratic - Alg1B
      • 10 Quadratics Project
    • Alg 1B 10 Book - Factoring Quadratics
    • Alg 1B 9 - Exponential Functions
    • Alg 1B 8.5 - Representing Data
    • Alg 1B 13 - Inequalities
    • Alg 1B 8 - Best Fit Lines and Linear Regression
    • Alg 1B 7 - Linearity
  • Geometry
    • Geom Last Week
    • Geom 12 - Probability
    • Geom 11 - Circumference, Area, Volume
    • Geom 10-Circles
    • Geom 9 - Right Triangles and Trigonometry
    • Geom 8 - Similarity
    • Geom 7 - Quadrilaterals and Other Polygons
    • Geom 6 - Relationships Within Triangles
    • Geom 5 - Congruent Trianlges
    • Geom 4 - Transformations
    • Geometry 3.5 - Constructions
    • Geom 3 - Parallel and Perpendicular Lines
    • Geom 2 - Reasoning and Proofs
    • Geom 1 - Basics of Geometry
  • Programming
    • Directions for Sharing Programs with Me
    • Hour of Code
    • Intro to Python >
      • Installing and Using Portable Python
      • Introduction to Programming
      • Interactive Storyteller
      • Sophisticated Calculator
      • Getting Started with Games
      • Word Length Frequency
      • Substitution Cipher
      • Simple Game of Paddleball
      • Animating Many Objects
      • Accelerator
      • Applying Trigonometry
      • GIFs
      • Programmatic Art
      • Battleship
      • Pong
      • CodeCademy.com Suggested Work
      • Python Resources
    • Advanced Python >
      • Python Installation
      • Review of Intro to Programming
      • Objects and Classes >
        • More on Classes: Functions, Methods, Inheritance
        • Quadrilaterals
      • tkinter >
        • Paddle Ball
        • Light Bike
        • Frogger
        • Snake Game
        • Breakout
      • Reading and Writing Files
      • Directories and Importing Modules
      • Raspberry Pi
      • API's
      • Python Puzzles
  • Clubs
  • Graphing Calculator
  • PARCC Practice

Pong!

If you don't know what Pong is, you need to stop what you are doing and play a few games over at PongGame.org. I'm serious. But please turn down the volume; the sound effects get real old real fast. After you have a decent understanding of how it works, I want you to modify your code from Paddleball to create a 2-player Pong game.

Picture
Some adjustments you'll have to make.
1. You need the paddle to be on the sides of the board not on the bottom.
2. You need two paddles--one on each side.
3. The screen is a rectangle and not a square.
4. There needs to be a way to keep score for each player up to ten points.

Putting text on the screen:
w._can.create_text(250, 250, text="put your text here", fill="put your color choice here", font ="Font Name and Size")

Taking text off the screen:
First, your text needs to be declared as a variable.
text_variable  = w.can.create_text(.....
w.delete(text_variable)
It often helps me to pull out a sheet of paper and figure out the basic structure of the code before I begin. After I understand the skeleton of how I want my program to look, I can flesh it out with the details on the computer.

Extensions:
-Preferably, the ball not only bounces off the paddle but changes both direction AND velocity based on the paddle's location and speed. Notice how when you hit the ball on the corner of the paddle, the ball takes a sharp angle and increases in speed?

    Change the way your ball bounces off each of the paddles based on where the ball hits the paddle. [Hint: compare the center of the ball to the center of the paddle]
-As in any game, the score should be shown on the screen.
-The center of the board should be clearly marked (as in tennis and ping pong) with a vertical dotted line.

-You could try to mod out your Pong game like these people did.
-Try to create a 1-player version. This means you need to make a bot to play against. This is the ultimate extension! Think about how to create a systematic way to tell the computer when and how to move the paddle based on the location of the ball (no teleporting paddles).



Powered by Create your own unique website with customizable templates.