SWEN20003 Object Oriented Software Development
Object Oriented Software Development
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
SWEN20003 Object Oriented Software Development
Released: Friday, 19th April 2024 at 6:00pm AEDT
Project 2A Due: Monday, 29th April 2024 at 6:00pm AEDT
Project 2B Due: Friday, 17th May 2024 at 6:00pm AEDT
Please read the complete specification before starting on the project, because there
are important instructions through to the end!
Overview
In this project, you will create an arcade game called ShadowMario in the Java programming
language, continuing from your work in Project 1. We will provide a full working solution for
Project 1; you may use all or part of it, provided you add a comment explaining where you found
the code at the top of each file that uses the sample code.
This is an individual project. You may discuss it with other students, but all of the imple-
mentation must be your own work. By submitting the project you declare that you understand
the University’s policy on academic integrity and are aware of consequences of any infringement,
including the use of artificial intelligence.
You may use any platform and tools you wish to develop the game, but we recommend using IntelliJ
IDEA for Java development as this is what we will support in class.
Extensions & late submissions: If you need an extension for the project, please complete the
Extension form in the Projects module on Canvas. Make sure you explain your situation with
some supporting documentation such as a medical certificate, academic adjustment plan, wedding
invitation, etc. You will receive an email saying if the extension was approved or if we need more
information.
If you submit late (either with or without an extension), please complete the Late form in the
Projects module on Canvas. For both forms, you need to be logged in using your university
account. Please do not email any of the teaching team regarding extensions or late submissions.
All of this is explained again in more detail at the end of this specification.
There are two parts to this project, with different submission dates. The first task, Project
2A, requires that you produce a class design demonstrating how you plan to implement the game.
This should be submitted in the form of a UML diagram showing all the classes you plan to im-
plement, the relationships (e.g. inheritance and associations) between them, and their attributes,
as well as their primary public methods. You do not need to show constructors, getters/setters,
dependency, composition or aggregation relationships. If you so choose, you may show the relation-
ship on a separate page to the class members in the interest of neatness, but you must use correct
UML notation. Please submit as a PDF file only on Canvas.
1
SWEN20003 Object Oriented Software Development Project 2, 2024
The second task, Project 2B, is to complete the implementation of the game as described in the
rest of this specification. You do not need to strictly follow your class design from Project 2A;
you will likely find ways to improve the design as you implement it. Submission will be via GitLab
and you must make at least 5 commits throughout your project.
Game Overview
“The aim is simple - move the player to jump over the enemies and collect the coins. To win
each level, you need to reach the end flag. The second level features flying platforms that the
player can jump on to, extra powers such as invincibility and double score. The third level
includes the enemy boss that the player must defeat by shooting fireballs. Can you reach the end
flags and beat the boss to win the game?”
The game features three levels : Level 1, Level 2 and Level 3. In Level 1, the player has to
press the arrow keys to move left, right or jump. The player can collect coins by colliding with
them - collecting one coin, increases the score by one. The player can avoid enemies by jumping
over them. Unlike in Project 1, the enemies will be moving now in a fixed range (this is explained
in detail later). If the player collides with an enemy, they will lose health points. To complete the
level, the player needs to reach the end flag. If the player’s health points reduce to zero, the game
ends.
Level 2 features the same gameplay as above but the player now has to deal with additional features.
Flying platforms are moving entities that the player can jump on to and move on. The player can
gain two new powers by colliding with the invincibility entity and double score entity. Invincibility
makes the player invincible to health loss from enemy collisions for a set period of time and double
score grants the player, double the score from each coin collected for a set period of time. Once
again, to complete the level, the player needs to reach the end flag.
Level 3 is the final level. It includes all of the above as well as an enemy boss at the end of the
level. When the enemy boss and the player come into a fixed distance from each other, they can
both shoot fireballs at each other that cause health points loss. To complete the level and finish
the game, the player must beat the enemy boss and reach the end flag.
Note that the game does not need to be played progressively. You can choose which level to play
from the start screen and also at the end of each level.
An Important Note
Before you attempt the project or ask any questions about it on the discussion forum, it is crucial
that you read through this entire document thoroughly and carefully. We’ve covered every detail
below as best we can without making the document longer than it needs to be. Thus, if there is
any detail about the game you feel was unclear, try referring back to this project spec first, as it
can be easy to miss some things in a document of this size. And if your question is more to do on
how a feature should be implemented, first ask yourself: ‘How can I implement this in a way that
2
SWEN20003 Object Oriented Software Development Project 2, 2024
both satisfies the description given, and helps make the game easy and fun to play?’ More
often than not, the answer you come up with will be the answer we would give you!
Figure 1: Start Screen Screenshot
(a) Completed Level 2 Screenshot (b) Completed Level 3 Screenshot
Figure 2: Level Screenshots
Note : the actual positions of the entities in the levels we provide you may not be the same as in
these screenshots.
3
SWEN20003 Object Oriented Software Development Project 2, 2024
The Game Engine
The Basic Academic Game Engine Library (Bagel) is a game engine that you will use to develop
your game. You can find the offline documentation for Bagel on Canvas under the Projects module.
Coordinates
Every coordinate on the screen is described by an (x, y) pair. (0, 0) represents the top-left of the
screen, and coordinates increase towards the bottom-right. Each of these coordinates is called a
pixel. The Bagel Point class encapsulates this.
Frames
Bagel will refresh the program’s logic at the same refresh rate as your monitor. Each time, the
screen will be cleared to a blank state and all of the graphics are drawn again. Each of these steps
is called a frame. Every time a frame is to be rendered, the update() method in ShadowMario is
called. It is in this method that you are expected to update the state of the game.
Your code will be marked on 120Hz screens. The refresh rate is typically 120 times per second
(Hz) but some devices might have a lower rate of 60Hz. In this case, when your game is running,
it may look different to the demo videos as the constant values in this specification have been
chosen for a refresh rate of 120Hz. For your convenience, when writing and testing your code, you
may change these values to make your game playable (these changes are explained later). If you
do change the values, remember to change them back to the original specification values before
submitting, as your code will be marked on 120Hz screens.
The Levels
Our game will have three levels, each with elements to implement that are described below.
Window and Background
The background (background.png) should be rendered on the screen to completely fill up your
window throughout the game (for the start screen and all the levels). The default window size
should be 1024 * 768 pixels. The background has already been implemented for you in the skeleton
package.
Start Screen
Each level has the same start screen. The screen has a title message that reads SHADOW MARIO
should be rendered in the font provided in res folder (FSO8BITR.ttf), in size 64. The bottom left
corner of this message should be located at (220, 250).
4
SWEN20003 Object Oriented Software Development Project 2, 2024
Additionally, an instruction message consisting of 4 lines:
USE ARROW KEYS TO MOVE
ENTER LEVEL TO START - 1, 2, 3
should be rendered below the title message, in the font provided, in size 24. The bottom left of
the first line in the message should be coded as follows: the x-coordinate should be calculated such
that the whole message looks centered horizontally, and the y-coordinate should be at 400 pixels.
There must be adequate spacing between the 2 lines to ensure readability (you can decide on
the value of this spacing yourself, as long as it’s not small enough that the text overlaps or too big
that it doesn’t fit within the screen). You can align the lines as you wish.
The player chooses which level to play by pressing the corresponding key (1, 2 or 3). Once the level
is over, regardless of whether it was won or lost, the player will be re-directed back to the start
screen.
Properties File
The key values of the game are listed in two properties files which are given in the skeleton pack-
age. The message coordinates, image filenames and other values are given in the app.properties
file. The message strings are given in the message en.properties file. These files shouldn’t be
edited (unless you need to adjust values for any frame rate issues). All properties given in the files
should be read-in and not hard-coded.
To read a value from one of these properties, a Properties object must be created. The
getProperty method can be called on this object with the required value given as the param-
eter. For your reference, the skeleton package contains an example of how to read the background
image filename, window width and window height values.
World File
The entities will be defined in a world file, describing the type and their position in the window.
The world files for each level are level1.csv, level2.csv and level3.csv correspondingly. A
world file is a comma-separated value (CSV) file with rows in one of the following formats:
Type of entity, x-coordinate, y-coordinate
An example of a world file:
PLATFORM,3000,745
PLAYER,100,687
COIN,300,510
FLYING_PLATFORM,400,555
DOUBLE_SCORE,1700,690
ENEMY,400,695
INVINCIBLE_POWER,1800,505
END_FLAG,4100,670
5
SWEN20003 Object Oriented Software Development Project 2, 2024
The given (x, y) coordinates refer to the centre of each image and these coordinates should be
used to draw each image. You must actually load it—copying and pasting the data, for example, is
not allowed. Marking will be conducted on hidden different CSV files of the same format. Note:
You can assume that there will always be at least one of each for all the entities. The total number
of entites in each CSV may vary however.
End Screen
Each level has the same end screen. The end screen has one message - either a win or loss message.
When the player has reached the end flag of a level, this is considered as a win. This differs only
in Level 3, where the player must both reach the end flag and beat the enemy boss (its health
must reduce to 0). For a win, the message has the 2 following lines:
CONGRATULATIONS, YOU WON!
PRESS SPACE TO CONTINUE
It should be rendered, in the font provided, in size 24. The bottom left of the first line in the
message should be coded as follows: the x-coordinate should should be calculated such that the
whole message looks centered horizontally and the y-coordinate should be at 400 pixels.
If the player’s health points reduces to 0 or below, this is considered as a loss and the game ends.
For a loss, the message has the 2 following lines:
GAME OVER, YOU LOST!
PRESS SPACE TO CONTINUE
It should be rendered, in the font provided, in size 24. The bottom left of the first line in the
message should be coded as follows: the x-coordinate should be calculated such that the whole
message looks centered horizontally and the y-coordinate should be at 400 pixels.
When the player presses the space key, the start screen should be rendered again as described in
the Start Screen section and the player can choose to play again. The player can terminate the
game window at any point (by pressing the Escape key or by clicking the Exit button) - the window
will simply close and no message will be shown.