TORONTO KIDS COMPUTER CLUB | Tuesday Python Homework 18:30 – 22.04.05.
20526
post-template-default,single,single-post,postid-20526,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

Tuesday Python Homework 18:30 – 22.04.05.

08 Apr Tuesday Python Homework 18:30 – 22.04.05.

Question:

We have made class explosion and weapon which showed you how to load different image to switch costumes.

1.   Please made a class Planet, it will contains following methods:

__init__(self) - It initials the Planet from a random centerx position, and top = -1000
Since planets has 3 possible images(you could down load planet images from the following link, http://www.torontokidscomputer.com/code/pygame/
you need initialize the planet with a random image.

update(self) - It will move down by 2px every time call the update method. 
If Bottom of the image reaches 1000, the new random planet will starts from a random centerx position, and top = -1000

2.   create planet sprite and call the update() method in the main program. so planet can appear on the screen and start move down.

No Comments

Sorry, the comment form is closed at this time.