27 Apr Friday 16:15 Python Practice – 23.04.21.
Question:Continue modify the program we made in the class: use spritecollide to let the fighter collect energy crystals, if the energy crystal is collected, the score will increase ...
Question:Continue modify the program we made in the class: use spritecollide to let the fighter collect energy crystals, if the energy crystal is collected, the score will increase ...
Question: 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...
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 be deleted...
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 choose and download one of the background images base...
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 reaches...
Question: We have learned how to make the pirate ship looping left and right, try the following: How to make the pirate ship move and bounce diagonally when it reaches the edge ( the pirate ship image is 200px by 166px) ...
Question 1: Draw the following picture in the pygame window: (could be different color) Hint: using pygame.draw.circle Question 2: Draw below image using pygame. (could using different color) ...
Question 1: Create a Python class Person with attributes: name and age of type string. Create a display() method that displays the name and age of an object created via the Person class. Create a child class Student which inherits from the Person class and which also has a section attribute. Create a method displayStudent() that displays the name,...
Question: Define a class called Lunch. Its __init__() method should have two arguments: self and menu. Where menu is a string. Add a method called menu_price. It will involve a if statement: – if “menu 1” print(“Your choice:”, menu, “Price 12.00”) – if “menu 2” print(“Your...
Question 1: Create a Student class and make the following methods to : __init__() – Initialize it with name and roll number. __str__() – Display all information of the student. setAge() – It should assign age to student. setMarks() – It should assign marks to the...