0% found this document useful (0 votes)
24 views2 pages

Wiki - Week Eight - An Introduction To Interactive Programming in Python

The document discusses sets and sprite animation in interactive Python programming. It covers sets, set differences, animated sprite drawing by striding through a tiled image, and controlling animation with sprite age and size. Examples include asteroids and explosion animation.

Uploaded by

leekiangyen
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views2 pages

Wiki - Week Eight - An Introduction To Interactive Programming in Python

The document discusses sets and sprite animation in interactive Python programming. It covers sets, set differences, animated sprite drawing by striding through a tiled image, and controlling animation with sprite age and size. Examples include asteroids and explosion animation.

Uploaded by

leekiangyen
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

12/9/13

Wiki - Week eight | An Introduction to Interactive Programming in Python

Week eight
Sets Groups of sprites Sets are unordered collections of unique objects. The initializer for Python sets is the function s e t ( ). Items can be added to and removed from a set using the methods a d d ( )a n dr e m o v e ( ), respectively. The item membership test for a set uses the keyword i n. The methods d i f f e r e n c e ( ) and d i f f e r e n c e _ u p d a t e ( ) remove a set of items from a set and returns a new set or a mutated versions of the original set, respectively. Lecture examples - Sets, Set differences More examples - Set Structure Animation Sprite animation An animated sprite is drawn by striding the center of the source rectangle in d r a w _ i m a g e through the animated sprite's associated tiled image. This stride is typically controlled by the sprite's age and size. This sprite's lifespan is used to terminate the animation. For the Spaceship and Asteroids mini-projects, the stride is always horizontal from left to right. Lecture examples - Asteroid animation, Explosion animation More examples - Running Bunny Other Examples Balloon Pop (collisions), Project Template

Created Thu 6 Sep 2012 3:55 AM MYT Last Modified Sat 8 Dec 2012 6:14 AM MYT

https://class.coursera.org/interactivepython-003/wiki/view?page=week8

1/2

12/9/13

Wiki - Week eight | An Introduction to Interactive Programming in Python

https://class.coursera.org/interactivepython-003/wiki/view?page=week8

2/2

You might also like