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