Python代写 | CSSE1001 Assignment 3
CSSE1001 Assignment 3
3 Task 1: Basic Gameplay
Task 1 requires you to implement a functional GUI-based version of EndOfDayz. At the end
of this task your game should look like Figure 2. There are three major sections to the GUI; a
heading label at the top, the game map (bottom left), and the inventory (bottom right).
To complete this task you will need to implement various view classes, including a basic
graphical interface, which handles most of the event handling that was previously handled
in TextInterface and its subclasses. You must use the supplied Assignment 2 solution for
most of the modelling, as this solution contains additional functionality that was not required
in your Assignment 2. You may create additional modelling classes if they bene t your solution.
User input events should cause behaviour as per Table 1.
Key Press: `w’ Player moves up one square if the map permits.
Key Press: `a’ Player moves left one square if the map permits.
Key Press: `s’ Player moves down one square if the map permits.
Key Press: `d’ Player moves right one square if the map permits.
Left click on
If the left click occurs anywhere on a row containing an item, the `activated’
status of that item is toggled (see Section 3.2.3 for details). If the left click
occurs elsewhere nothing should happen (in particular no errors should occur).
The player can move independently of the step events. That is, the player can move multiple
times within the space of a single step event for the other entities.
When the player wins or loses the game they should be informed of the outcome via a message-
box, and asked whether they would like to play again. If the user opts to play again, the current
game should be reset to its initial state and the user should be able to replay the game. If they
opt not to play again the program should terminate. Hint: tkinter’s messagebox.askquestion
or messagebox.askyesno may be useful in achieving this.
The following sub-sections outline the recommended structure for your code. You will bene t
from writing these classes in parallel, but you should still test individual methods as you write
them. Within this section we outline some methods that may be useful to write in the view
classes for task 1. Type hints are omitted, as it is up to you to determine what these should
be. These lists are not necessarily complete and you may include additional methods if they
improve the design of your classes. You may also need to add more methods to these classes
for task 2 and/or the CSSE7030 task.
3.1 Model Classes
Model classes should be de ned as per Assignment 2. You may add more modelling classes if
they improve the code. You may modify the classes as you see t, but any changes must be
submitted with your assignment.
3.2 View Classes
You must implement view classes for the game map and the inventory. However, because these
widgets can both be represented by grids of rectangles, you should create an abstract class to
factor out the shared functionality.