TORONTO KIDS COMPUTER CLUB | Aurora Wednesday Saturday Python Homework 20.05.27.
17566
post-template-default,single,single-post,postid-17566,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

Aurora Wednesday Saturday Python Homework 20.05.27.

28 May Aurora Wednesday Saturday Python Homework 20.05.27.

Question:

Modify the program we made in the class to:

  • Add one missile to your program
  • missile will automatically move from your spaceship to the top of the screen
  • once missile reach the top of the screen, it will re-appear from the location of your fighter

Hint:

  • exam the code of move method in the Missile class and find out the logic of its movement.
  • you can assign the fighter’s location to the the missile’s location like this:
    self.rect = location (when the missile reach out the top of the screen)
  • so far we could consider xxxxx.rect represents for the location, such as myFighter.rect is the location of object myFighter. We could pass the value of myFighter.rect as arguments into to the move method of Missile class.
No Comments

Sorry, the comment form is closed at this time.