Catapult 2014 Session 10.

Slides:



Advertisements
Similar presentations
Games in Python – the easy way
Advertisements

Microsoft® Small Basic
Creating Games For Windows, Xbox 360, and Windows Phone 7 Ryan Plemons
DESCRIBING INPUT DEVICES
Code Club Session 3 Shark Eats Fish. Picture of finished product here.
Announcements At the end of your project, you’ll be given an opportunity to make a standalone (.exe) version of your project. For this to work, you’ll.
Vertical Retrace Interval An introduction to VGA techniques for smooth graphics animation.
2 What is pyGame? A set of Python modules to make it easier to write games. –home page: –documentation:
Pygame Dick Steflik.
Guide to Programming with Python
Unit 9 pyGame Special thanks to Roy McElmurry, John Kurkowski, Scott Shawcroft, Ryan Tucker, Paul Beck for their work. Except where otherwise noted, this.
Week 10 Writing Games with Pygame, continued Special thanks to Scott Shawcroft, Ryan Tucker, and Paul Beck for their work on these slides. Except where.
Input devices are hardware components that enable users to interact with a computer. Without input devices, you would not be able to feed instructions.
Input Devices.
Input Devices. What is Input?  Everything we tell the computer is Input.
CSE 219 Computer Science III Images. HW1 Has been posted on Blackboard Making a Game of Life with limited options.
KeyListener and Keyboard Events Just as we can implement listeners to handle mouse events, we can do the same for keyboard events (keypresses) –to implement.
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,
User Input and Collisions COSC 315 Fall 2014 Bridget M. Blodgett.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 7 The Game Loop and Animation Starting Out with Games & Graphics.
XNA An Introduction. What XNA is… Microsoft® XNA™ is composed of industry- leading software, services, resources, and communities focused on enabling.
CSCE 121: Introduction to Program Design and Concepts, Honors Dr. J. Michael Moore Spring 2015 Set 15: GUIs 1.
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Game Maker – Getting Started What is Game Maker?.
Reference: The Game Loop Animation / Game loop 1. Update variables 2. [Get input from the user] (GameLoop only) 3. Draw (using variables)
The Abstract Window Toolkit (AWT) supports Graphical User Interface (GUI) programming. AWT features include: a rich set of user interface components; a.
1 Frisbee Physics Simulation Charles George Advisor: Brian Postow 03/05/05.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
CHAPTER 3 (P.49-53) Importing modules + pygame intro.
1.Begin by opening VB 2.Click New Project or the icon Hello World Tutorial NOTE: depending on your version of VB – the images might be slightly different.
PyGame - Unit 1 PyGame Unit – – Introduction to PyGame.
1 EiffelMedia. 2 Overview Features of the library Documentation Demos Community Stats Roadmap.
1 Computer Science of Graphics and Games MONT 105S, Spring 2009 Session 22 Game Graphics.
3. Drawing Let’s Learn Saengthong School, June – August 2016 Teacher: Aj. Andrew Davison, CoE, PSU Hat Yai Campus
2D Graphics CMT3311. This covers... How to make a transparent sprite How to add a sprite to your project and draw it Properties of sprites and how to.
Reference: What is it? A multimedia python library – Window Management – Graphics geometric shapes bitmaps (sprites) – Input Mouse Keyboard.
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.
Input Devices.
Sound and more Animations
Chp 4: Input and Output Devices
GUI in Python Ismail Abumuhfouz.
MOM! Phineas and Ferb are … Aims:
A look ahead: At the end of your project, you’ll be given an opportunity to make a standalone (.exe) version of your project. For this to work, you’ll.
Catapult 2016.
Part II Reference:
PYGAME.
WITH PYGAME ON THE RASPBERRY PI
Let’s Learn 2. Installing Pygame
8. Installing Pygame
Keyboard Input.
9. Drawing.
Game Loops + Part II Reference:
9. Drawing Let's Learn Python and Pygame
Chapter 5 - Input.
EEL 3705 / 3705L Digital Logic Design
Importing modules + pygame intro
13. Sprites Let's Learn Python and Pygame
Creating games with game editors
8. Starting Pygame Let's Learn Python and Pygame
WICS - Flappy Anteater Python Tutorial
Extend Text Editor to Draw shapes
Game Loop Update & Draw.
Let’s Learn 7. Sprites Saengthong School, June – August 2016
Simple Graphics Package
Nate Brunelle Today: Games
L L Line CSE 420 Computer Games Lecture #6 Game Foundations.
CoE Software Lab II 1. Pygame Intro , Semester 2,
Windows Operating System
Chapter 7 The Game Loop and Animation
Presentation transcript:

Catapult 2014 Session 10

Pygame Pygame is a library designed for programming games using 2D graphics. Compared to zellegraphics, it has: much better mouse and keyboard input much faster drawing commands better image support collision-detection Sound For documentation, see pygame.org/docs (bright green box at the top of window)

Surfaces In Pygame many drawn objects are Surfaces Pygame draws the Surfaces as layers on top of each other. Different surfaces are able to detect collisions with one another based on a “rectangle” that bounds it Pygame.draw draws things ON TOP of a given surface, it does not create a new surface.

Moving objects on screen is much different With zellegraphics, you could do things like circle.move(dx, dy) In pygame, you repeatedly: Change the coordinates of your object Blank out the screen Redraw your item(s) in the new location cause them to display This is done in the event loop (next slide)

Event loop In an infinite loop, get input from the user, using it to change the state of your object (like the location) other code that affects objects (like collisions) blank out the screen redraw your item(s) in the new location cause everything to display

Pygame Documentation http://www.pygame.org/docs

Caution At the end of your project, you’ll be given an opportunity to make a standalone (.exe) version of your project. For this to work, all pygame fonts that you use should be SysFonts (created using pygame.font.SysFont) and the pygame default font should not be used [i.e. don’t use pygame.font.SysFont(None, 12)] pyame.time keeps time in milliseconds not seconds

Demos Controllable Ball (With Instructor) Paddle Ball Moving Smilies (Take 2) Bubble Trouble