Tuesday Python 18:30
Home > Tuesday Python 18:30 (Page 6)
Question:
Eric works in a door mat manufacturing company. One day, he designed a new door mat with the
following specifications:
◦ Mat size must be A x B. (A is an odd natural number, and B is 3 times A.)
◦ The design should have ‘WELCOME’ written in...
Question:
Modify the program, so let the game starts with 3 lives, and have the following picture show at the bottom-right corner to indicate how many more lives:
Every time your fight got destroyed, it will reappear at the bottom center location.
when your life become 0, it...
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...
Question:
Continue modify the program we made in the class:
create Energy class. A new energy crystal object will be created when the enemy spaceship explode
use spritecollide to let the fighter collect energy crystals, if the energy crystal is collected, the score will increase
...
Question:
Modify the program we made in the class. Create a Boss Class
the __init__() method will take three parameters (imgFile, location and speed)
the update() method will move the object, if the top of the object reaches the bottom of the screen, it will disappear...
Question:
Modify the program we made in the class. Try to add hp attribute to the Enemy class and create a method isKilled() to return True if the hp less than 1 otherwise return False.
Add getDamage() method to the Weapon class so it will return the...
Question:
Modify the program we made in the class. Add starting screen as below, the real game will start when play click the mouse in the range of the “PLAY” button. (Scroll down for more hint)
You can download the background images from below:
The size of the...
Question:
We have learned how to create 5 enemy spaceship at once in the class. Try to modify the game we made in the class:
The program will keep creating new enemy spaceship.
the new enemy spaceship always shows on the top of the screen but...
Question:
Make changes of the program by creating Enemy class, so we can create an enemy object in the main program, the enemy spaceship could complete the following tasks:
The enemy could appear at the top of the screen and bounce back and forth when it...
Question:
Make changes of the program by creating Enemy class, so we can create an enemy object in the main program, the enemy spaceship could complete the following tasks:
the enemy could appear at the top of the screen and bounce back and forth when it...