Question: Problem 1 (50 XP): Modify the Etch class in EtchASketch.py so that the turtle changes direction towards the position where you click with the mouse

Problem 1 (50 XP): Modify the Etch class in EtchASketch.py so that the turtle changes direction towards the position where you click with the mouse pointer. Problem 2 (50 XP): Modify the Etch class in EtchASketch.py so that the turtle fills with color by pressing on the keyboard key f. Filling with color requires begin_fill() and end_fill() but make sure that a single callback function handles both with the press of the f key. Do not worry about the actual color; it will default to the current color the turtle has. [Hint: use a self.isFilling flag, set it to false and alternate its value upon each press of the f key] Problem 3 (50 XP): Modify the Asteroids game so that there are three different asteroids, a large, a medium and a small asteroid, that move in random directions at the beginning of the game. Do so by using three distinct images, creating 15 random goals (change maxGoals to 15), and making sure that there are 5 of each small, medium and large size asteroids by using three distinct image sizes. [Hint: Find .gif images files online and register them with the turtle) Problem 4 (50 XP): Modify the Asteroids game so that the game ends after the playes loses 3 lives. Create a lives counter, and substract a life every time the players touches a boundary. Problem 5 (50 XP): Modify the spaceinvaders game so that the LaserCanon() object moves sideways using the arrow keys for left and right, without going past the screen boundaries. Prevent the LaserCanon() object from changing direction. It should only fire a Bomb in a straight vertical direction. Use the up arrow key rathen than the s key to fire a bomb. This modification changes the game dynamic so that it mimic space invaders more accurately. from turtle import Turtle, mainloop class Etch(Turtle): def __init__(self): super().__init__() #calls the init of Turtle self.screen = self.getscreen() self.color('blue') self.shape('turtle') self.pensize(2) self.distance = 5 self.turn = 10 self.screen.onkey(self.fwd, "Up") self.screen.onkey(self.bkwd, "Down") self.screen.onkey(self.leftTurn, "Left") self.screen.onkey(self.rightTurn, "Right") self.screen.onkey(self.colorRed, "r") self.screen.onkey(self.colorBlue, "b") self.screen.onkey(self._up, "u") self.screen.onkey(self._down, "d") self.speed("fastest") self.screen.listen() self.main() def _up(self): self.up() def _down(self): self.down() def colorRed(self): self.color("red") def colorBlue(self): self.color("blue") def fwd(self): self.forward(self.distance) def bkwd(self): self.backward(self.distance) def leftTurn(self): self.left(self.turn) def rightTurn(self): self.right(self.turn) def main(self): mainloop() #A way of running the program with an instance of the object Etch if __name__ == '__main__': etch = Etch()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!