Towers Assignment python 辅导、辅导python程序
- 首页 >> Python编程1. Introduction
This assignment provides you the opportunity to apply concepts taught throughout the
course to extend the functionality of a basic tower defence game.
The assignment will focus on the concept of Graphical User Interfaces (GUIs) and objectoriented
programming. You will be required to extend the functionality of the base game to
achieve marks.
Students are encouraged to review some tower defence games, to better understand how
this type of game is played and for inspiration on advanced features.
Because this assignment deals with multiple files, while not required, you may wish to
investigate a more sophisticated IDE. One option is PyCharm, which is free for students.
In the first week after this assignment is released, some updates are expected to be made to
improve the quality of the support code. These will be non-breaking changes to the
assignment code and will not be to the file. You can incorporate the changes into
your assignment by overwriting the modified files in the project.
1.1. Game Play
Shortly after this assignment's release, a link to a video overview will be added here.
2. Overview
2.1. Getting Started
The archive contains all the necessary files to start this assignment. A
significant amount of support code has been supplied to make it possible to begin with a
simple application that is almost working.
a3.py
a3_files.zip
The main assignment file is , which contains an incomplete implementation of
, the top-level GUI application class. The other files are support code which
must not be edited. Initially, you do not need to understand much of this code, but as you
progress through the tasks, you will need to understand more of this code. You should add
code to and modify to implement the necessary functionality.
You are permitted to create additional files to simplify the separation of tasks (i.e. task1.py,
task2.py, etc.), although this is not required. If you do this, must be the entry point to
your application. One way to achieve this is to move to a separate file, such
as . Regardless of how you structure your files, the code must all be able to
be demonstrated by running .
3. Assignment Tasks
3.1. Task Overview
This assignment is broken down into three main tasks:
1. The first task involves adding lines of code to clearly marked sections within the main
assignment file
2. The second task involves extending the design to add more interesting functionality to
the game
3. And the third task involves adding sophisticated functionality to further improve the
gameplay experience
For post-graduate students only, there is an extra task that involves doing independent
research.
In general, as the tasks progress, they are less clearly prescribed and increase in difficulty.
3.2. Task Breakdown
CSSE1001 students will be marked out of 20 & CSSE7030 students will be marked out of
26 based on the following breakdown. Tasks may be attempted in any order, but it is
recommended to follow this breakdown, top-down, completing as much as possible of each
task before moving on to the next.
Sub–Task Marks
9 marks
App Class 1 marks
a3.py
TowerGameApp
a3.py TowerGameApp
a3.py
TowerGameApp
base.py
a3.py
Task 1
Basic Features Tower Placement 3 marks
StatusBar Class 2 marks
File Menu & Dialogs 1 marks
Play Controls 2 marks
Task 2
Intermediate Features
7 marks
Sell Tower 1 mark
Custom Tower & Enemy 2 marks
Shop Class 3 marks
High Scores 1 marks
Task 3
Advanced Features
4 marks
Advanced Tower 1.25 marks
Advanced Enemy 1.25 marks
Upgrade Tower 1.5 marks
Post-Graduate Task
Independent Research
6 marks
Selection of Library or Technique 2 marks
Application of Library or Technique 2 marks
Integration into Existing Game 2 marks
Sub–Task Marks
3.3. Mark Breakdown
For each task, marks will scaled according to the following breakdown.
Description Marks
Code Quality
Code is readable. Appropriate and meaningful identifier names
have been used. Simple and clear code structure. Repeated code
has been avoided.
15%
Code has been simplified where appropriate and is not overly
convoluted.
10%
Documented clearly and concisely, without excessive or
extraneous comments.
15%
Functionality
Components are functional, without major bugs or unhandled
exceptions.
Assessed through user testing/playing, not automated testing.
60%
4. Task 1 – Basic GUI
Basic GUI Example
There are a significant number of comments in intended to help you complete this
task.
4.1. App Class
Write a function that launches the GUI. Call this function inside
an block.
Modify so that the title of the window is set to something appropriate (i.e.
Towers).
4.2. Tower Placement
Allow the user to place a tower by clicking a grid cell with the mouse. While their mouse is
being moved over the , show a preview of the tower and its range in the current
cell as well as the new path the enemies would take if a tower were placed there. When the
mouse leaves the , hide the preview.
If placing a tower in the current grid cell would make it impossible for the enemies to move
through the grid, or there is already a tower there, the preview should indicate that this
would not be a legal placement by showing an X shape instead of the tower.
S e e , , ,
4.3. StatusBar Class
Define a class named , which inherits from . This class is used to
display information to the user about their status in the game. The ' s widgets