Graphics in Python On entry: Run Python 2.78 from N: drive/computing and ICT VLE: Computing home page - check your feedback Success criteria: ●Understands.

Slides:



Advertisements
Similar presentations
Noadswood Science,  To understand the flow procedure when writing programs Thursday, January 15, 2015.
Advertisements

Noadswood Science,  To know how to use Python to produce windows and colours along with specified co-ordinates Sunday, April 12, 2015.
Code Club Session 3 Shark Eats Fish. Picture of finished product here.
LO: Learn how to develop your game further to include interactions with the device.
2 What is pyGame? A set of Python modules to make it easier to write games. –home page: –documentation:
Pygame Dick Steflik.
Scratch the Cat. Object Oriented Programing Writing computer programs Based on Objects Instead of Actions Based on Data Instead of Logic.
Meet Pygame Noah Kantrowitz June 8, The Basics Cross-platform Based on SDL (don’t quote me on that) Handle input (keyboard, mouse) and output (graphics,
Welcome to the road safety quiz, click on the start button to begin.
Computer Science 112 Fundamentals of Programming II Graphics Programming.
Scratch Programming Lesson 2 First glance to programming logic.
Art 321 Lecture 7 Dr. J. Parker. Programming In order to ‘make things happen’ on a computer, you really have to program it. Programming is not hard and.
Introduction to TouchDevelop
Python Programming Using Variables and input. Objectives We’re learning to build functions and to use inputs and outputs. Outcomes Build a function Use.
L.O. To understand programming code, to navigate and add objects into Kodu. Start Menu  Primary Applications  ICT  Kodu.
Moving Sprites in Scratch Exploring Computer Science – Lesson 4-4.
CONTROL SYSTEMS Control Systems A command is a directive that performs a specific task An argument is a variable that can be used by the function reveiving.
HOW TO USE HOURS KEEPER IPHONE USER. CLOCK IN This is the opening page on Hours Keeper. This person has put in a participant at 12 dollars an hour. If.
Making Python Pretty!. How to Use This Presentation… Download a copy of this presentation to your ‘Computing’ folder. Follow the code examples, and put.
Standard Grade Programming using VB 1 Programming Visual Basic.
Algorithms Writing instructions in the order they should execute.
Educational PowerPoint Game Sample Created by: Kids Computer Lessons For Students in Grade 8 Next.
Moving Sprites in Scratch Exploring Computer Science – Lesson 4-4.
PyGame - Unit 1 PyGame Unit – – Introduction to PyGame.
Microsoft® Small Basic Conditions and Loops Estimated time to complete this lesson: 2 hours.
ICT/COMPUTING RULES Only use software allowed by the teacher
Intro to Pygame Lecture 05. What is Pygame? It is a set of Python modules designed for writing games. It makes writing games possible for beginners. import.
11. Skier Let’s Learn Saengthong School, June – August 2016 Teacher: Aj. Andrew Davison, CoE, PSU Hat Yai Campus
3. Drawing Let’s Learn Saengthong School, June – August 2016 Teacher: Aj. Andrew Davison, CoE, PSU Hat Yai Campus
5. Animation Let’s Learn Saengthong School, June – August 2016 Teacher: Aj. Andrew Davison, CoE, PSU Hat Yai Campus
Learning to use a ‘For Loop’ and a ‘Variable’. Learning Objective To use a ‘For’ loop to build shapes within your program Use a variable to detect input.
13. Sprites. Outline 1.Game Things in Pygame (again) 2.The Pygame sprite Module 3.The Sprite Class 4.Groups of Sprites 5.Types of Collision Detection.
Scratch Programming Cards
Unit 21: Web Graphics A05: Banner Advert
Computer Programming.
MOM! Phineas and Ferb are … Aims:
Pixels, Colors and Shapes
Computer Science A-level
Catapult 2016.
PYGAME.
WITH PYGAME ON THE RASPBERRY PI
Let’s Learn 2. Installing Pygame
8. Installing Pygame
Scratch Unit Overview We are going to look at computer programming and how to create your very own computer game The piece of software we will be using.
9. Drawing.
Lesson 1 An Introduction
10. User Input.
11. Animation Let's Learn Python and Pygame

Diamond Hunt Mock Programming Project.
9. Drawing Let's Learn Python and Pygame
Introduction to Object-Oriented Programming
Creativity in Algorithms
13. Sprites Let's Learn Python and Pygame
8. Starting Pygame Let's Learn Python and Pygame
10. User Input Let's Learn Python and Pygame
14. Pong.
Introduction to TouchDevelop
Game Loop Update & Draw.
Let’s Learn 7. Sprites Saengthong School, June – August 2016
Go to =>
14. Pong Let's Learn Python and Pygame
11. Animation.
Flowcharts and Pseudo Code
Do it now – PAGE 3 You will find your do it now task in your workbook – look for the start button! Thursday, 23 May 2019.
L L Line CSE 420 Computer Games Lecture #6 Game Foundations.
CoE Software Lab II , Semester 2, Pong.
CoE Software Lab II 1. Pygame Intro , Semester 2,
CoE Software Lab II , Semester 2, Sprites.
Computer Science A-level
Presentation transcript:

Graphics in Python On entry: Run Python 2.78 from N: drive/computing and ICT VLE: Computing home page - check your feedback Success criteria: ●Understands the process of computer animation ●Can use simple Python instructions to draw a shape ●Understand how loops allow shapes to be redrawn Learning Intention: sequencing instructions to make simple animations in Python

What is ‘animation’? How does animation work? Watch video clip from lesson 6

Learning Intention: sequencing instructions to make simple animations in Python Can you translate how we animate into an algorithm for Python? Set position of shape Draw Shape Delete shape Repeat

Learning Intention: sequencing instructions to make simple animations in Python Repeat

Learning Intention: sequencing instructions to make simple animations in Python Repeat """ Sample Python/Pygame Programs Simpson College Computer Science Explanation video: """ import pygame # Define some colours using RGB values BLACK = ( 0, 0, 0) WHITE = ( 255, 255, 255) GREEN = ( 0, 255, 0) RED = ( 255, 0, 0)

Learning Intention: sequencing instructions to make simple animations in Python Repeat pygame.init() # Set the width and height of the screen [width, height] size = (700, 500) screen = pygame.display.set_mode(size) pygame.display.set_caption("My Game") # Loop until the user clicks the close button. done = False # Used to manage how fast the screen updates clock = pygame.time.Clock() # Starting x position of the rectangle rect_x = 50

Learning Intention: sequencing instructions to make simple animations in Python Rep eat # Main Program Loop while not done: # --- Main event loop for event in pygame.event.get(): # User did something if event.type == pygame.QUIT: # If user clicked close done = True # Flag that we are done so we exit this loop # --- Game logic should go here # --- Drawing code should go here # First, clear the screen to black. Don't put other drawing commands # above this, or they will be erased with this command. screen.fill(BLACK) # PUT YOUR CODE FOR ANIMATING BENEATH THIS COMMENT # --- Go ahead and update the screen with what we've drawn. pygame.display.flip() # --- Limit to 60 frames per second clock.tick(60) # Close the window and quit. # If you forget this line, the program will 'hang' # on exit if running from IDLE. pygame.quit() pygame.draw.rect(screen, WHITE, [rect_x, 50, 50, 50]) rect_x += 1

Learning Intention: sequencing instructions to make simple animations in Python Choose your task based on your confidence! Hard Complete the tutorial sections to animate a simple shape. Complete all but the ‘mega- challenges’ sections for an outstanding work award. Harder Work through the tutorials at a snappy pace, completing the mega challenges! Hardest Explore the random element to add a more natural look to your own animations. Mega-challenge ****really hard****: Can you use ‘Def’ to create a function to draw shapes before the while loop, and then use the procedure to draw the shape?

Learning Intention: sequencing instructions to make simple animations in Python Your screen pygame.draw.rect(screen, WHITE, [rect_x, 50, 50, 50])

Learning Intention: sequencing instructions to make simple animations in Python rect_x += 1 What does this line of code do? What does changing the 1 do?

Learning Intention: sequencing instructions to create graphics in Python Plenary What have you learnt? What would you like to learn next? Success criteria: ● Understands the process of computer animation ● Can use simple Python instructions to draw a shape ● Understand how loops allow shapes to be redrawn

Homework Update your blog with code, screenshots and reflections from all lessons. Code academy Final hand in deadline – last Friday of term