Newest Viewed Downloaded

AnnouncementsAt 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 need to do the following: Any images should be in .bmp format (downside: they can’t be transparent) All pygame fonts that you use should be SysFonts (created using pygame.font.sysFont)

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 need to do the following: Any images should be in .bmp format (downside: they can’t be transparent) All pygame fonts that you use should be SysFonts (created using pygame.font.sysFont)

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)

Pygame Documentation

http://www.pygame.org/docs

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

Demos

Controllable Ball (with the instructor) Paddle Ball (a simple, fully-functional game)

Showing 1 - 6 of 6 items Details

Name: 
Session9
Author: 
RHIT
Company: 
Rose-Hulman Institute ...
Description: 
AnnouncementsAt 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 need to do the following: Any images should be in .bmp format (downside: they can’t be transparent) All pygame fonts that you use should be SysFonts (created using pygame.font.sysFont)
Tags: 
pygam | object | use | locat | loop | screen | zellegraph | redraw
Created: 
7/2/2002 3:57:21 PM
Slides: 
6
Views: 
0
Downloads: 
0
Rating: 
0


> Comment



Share this presentation
|

Comments

Share this presentation:

|
Sitemap