Aurora Wednesday 18:30
Home > Aurora Wednesday 18:30 (Page 8)
Question:
Continue to program the code we made in the class at the bottom of this page. Try to use for loop to create buttons from 1-9, so the tkinter window would display as below:
Hint:
You can use “for i in range(1, 10):” or “for i in ‘123456789’:” to build these 9 buttons,...
Question 1:
Use TKinter to create following window with three buttons:
the “blue” button will print “blue” in the python shell screen
the “red” button will print “red” in the python shell screen
if left mouse button click the “color” button will print “blue” in the...
Question 1:
Use TKinter to create 6 buttons as following picture:
Question 2:
Use TKinter to create login window as following picture:
...
Question:
You are given a string . Suppose a character ‘a’ occurs consecutively n times in the string. Replace these consecutive occurrences of the character ‘a’ with (n, ‘a’) in the string.
Input Format: A single line of input consisting of the string .
Output Format: A single line of...
Question:
Continue modify the program we made in the class:
the game will be restarted if you press the space key.
...
Question:
Continue modify the program we made in the class:
create Shield class. A shield object will be created after the fighter is destroyed.
The shield will last for 2 seconds(60 frames) with animation
...
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:
We have made class Laser and showed you how to load different image to switch costumes.
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...
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...