Chris Torrence - Summit Middle School - BVSD
Home
Library
CNC Router
Robotics
Videos
St. Vrain Robotics
Women in Robotics
Creative Design
Norms
Design Cycle
Lightsabers
Memory Box
Flags
Custom Design
Game Design
Programming
Norms
Python Reference
Introduction
>
0. Robotic Students
1. Introduction to Programming
2. Code Combat
3. Strings, Variables, and User Input
4. Branches
5. Interactive Storytelling
Computer Scientists
Graphics
>
7. Turtle Graphics
8. Python Functions
9. User Interactions
10. Graphics with Processing
11. Breakout Game
12. Processing/Turtle Final Project
Review
Raspberry Pi
>
Minecraft Pi
Using the Pi Wedge
Engineering Lab
Your Name in Lights
SparkFun Inventor's Kit (SIK)
>
SIK 1 - Simple Circuit
SIK 2 - Reading Voltages
SIK 3 - RGB LED
SIK 4 - Multiple LEDs
SIK 5 - Push Buttons
SIK 6 - Photo Resistor
SIK 7 - Temperature Sensor
Balloon Launch
>
Payload Design
Weather + SD Shield
Arduino - Temp and Altitude
Balloon Report
2015 Launch
2016 Launch
Bridge Building
Videos
11. Breakout Game
Now we'll try use Processing to create a "breakout" game.
Python for Processing Reference
Trinket Reference
Learning Targets
I can create a game using the Processing library.
Steps
Start a new Python trinket on
trinket.io
using the "New Trinket" button.
Change the name of your trinket from "Untitled" to something like "Breakout".
Type in the code below, and run it. You should see a blue ball and a yellow paddle.
Try moving the mouse within the window - it should move the paddle
Now, we'll add some movement to the ball.
Type in the "moveBall" function to the right.
Then uncomment the call to "moveBall" in the main "draw" loop.
Run the program - the ball should start to move.
Finally, let's make the ball change color when we click with the mouse or press a key.
Add the functions to the right, just above the "draw" function. Then run your program and try it!
Other things to try:
Make the ball move faster or slower.
Make the paddle get smaller as time goes on.
Add bricks for the ball to run into and destroy.
Use the text commands to add a score:
textSize(32);
text("Score: ", 10, 30);
Home
Library
CNC Router
Robotics
Videos
St. Vrain Robotics
Women in Robotics
Creative Design
Norms
Design Cycle
Lightsabers
Memory Box
Flags
Custom Design
Game Design
Programming
Norms
Python Reference
Introduction
>
0. Robotic Students
1. Introduction to Programming
2. Code Combat
3. Strings, Variables, and User Input
4. Branches
5. Interactive Storytelling
Computer Scientists
Graphics
>
7. Turtle Graphics
8. Python Functions
9. User Interactions
10. Graphics with Processing
11. Breakout Game
12. Processing/Turtle Final Project
Review
Raspberry Pi
>
Minecraft Pi
Using the Pi Wedge
Engineering Lab
Your Name in Lights
SparkFun Inventor's Kit (SIK)
>
SIK 1 - Simple Circuit
SIK 2 - Reading Voltages
SIK 3 - RGB LED
SIK 4 - Multiple LEDs
SIK 5 - Push Buttons
SIK 6 - Photo Resistor
SIK 7 - Temperature Sensor
Balloon Launch
>
Payload Design
Weather + SD Shield
Arduino - Temp and Altitude
Balloon Report
2015 Launch
2016 Launch
Bridge Building
Videos