
In this lab, you will design a program using top down design and implement an abstract class.
Create a Project11 folder on your computer where you store CS151 projects and labs, hopefully somewhere that is backed up (e.g. in Dropbox, Google Drive, Microsoft One Drive, etc.)
Open up a Terminal (e.g. Control+` in VS Code) and change the directory (cd) to the Project11 folder.
Implement a game other than Asteroids, using inheriting from the provided Abstract Class Game. The more detail, gameplay elements, and/or complexity the more extension credit. As usual, code organization and design play a big role and you should follow the standard best practices.
Your game should inherit from the Abstract Class Game. From a grading perspective, I should not see lots of duplicate code in Game and your other game class. Make use of inheritance and extend the basic game mechanics if it makes sense!
You can implement a standard game, a different game, or your own game.
You can choose to implement a standard game for up to 27/30 for the base game. To receive 30/30, you can add extensions like additional levels or the ability to replay your game.
You can choose to implement an advanced game for up to 28.5/30 for the base game. To receive 30/30, you can add extensions like additional levels or the ability to replay your game.
You can choose to implement a game that is not listed above. Please meet with Professor Wolfe during their office hours to have your game approved. They will determine if it is a "standard" or "advanced" game.
You can choose to design your own game. Please meet with Professor Wolfe during their office hours to have your game approved. They will determine if it is a "standard" or "advanced" game.
Game classYour game should inherit from the Abstract Class Game. Download a copy of the file and put it in your project directory.
Create a new file titled the name of your game [your game].py and in it define a class called [your game] which inherits from the Game class.
Read the Game class.
In your [your game] class, write method headers for all the abstract methods in the Game class. For each method add a print statement that prints the name of the method to the terminal.
Test your code. Create a main function where you create an instance of your class and call its play method. A black 800x800 pixel screen should appear.
Write a constructor that will override the Game Abstract class' constructor. The constructor is where you will include any code that is setting up your program. At a minimum it should call the Game's' constructor with arguments for the title and a new background color.
Test your code. A 800x800 pixel screen should appear with the title and background color you provided.
The Game class has an instance variable screen. That instance variable should be used for all turtle screen methods. The Game class has a instance variable called drawer that is a turtle. Use the drawer to draw the following on the screen.
Update your titleScreen method to fulfill the following requirements:
drawer to write the name of your game on the screen.drawer and the subclass Button to create a start button that calls createGameScreen when clicked.drawer and the subclass Button to create a quit button that calls self.screen.bye() when clicked.Test your code. A 800x800 pixel screen should appear with the title and background color you provided. On the screen should be the title of the game and 2 buttons. When you click the start button "createGameScreen" should be printed to the terminal. When you click the quit button the screen should close.
Update your createGameScreen method to fulfill the following requirements:
Game class method self.clear. This should clear the buttons and title from the screen.createGameScreenEvents.Test your code. When you click the start button "createGameScreen" the buttons should disapear from the screen, the background color should change and "createGameScreenEvents" should print to the terminal.
Update your createMainPlayer method to fulfill the following requirements:
Update your createGameScreen method to create an instance variable player using your createMainPlayer method.
Test your code. When you click the start button your player turtle should appear.
This is where you would write the event callbacks for your game. For right now, create a timer that will call createResultScreen after 5 seconds. When you implement your game, you should call createResultScreen when the game ends.
Test your code. When you click the start button and wait 5 seconds "createResultScreen" should print to the terminal.
This is where you would draw your results screen.
Update your createResultScreen method to fulfill the following requirements:
Game class method self.clear. This should clear anything that was drawn to the screen using the drawer instance variable.player turtle.Test your code. When you click the start button and wait 5 seconds the player should disapear and screen change to the results screen's background color.
How will someone play your game? Does it involve using specific key presses or clicking on specific buttons or areas of the screen? Plan out the interface for the game.
Update your start screen so there are instructions on how to play the game.
Your check-in report should include:
Include in your check-in submission a maximum 60 seconds screen recording video of you showing what you have implemented so far. This should include the start screen with instructions, game screen, and results screen.
Upload and submit your code, video and report on Google Classroom.
Once you are done with each of the check-in tasks, you may start on the project.
© 2021 Hannen Wolfe and Oliver Layton