共计 7166 个字符,预计需要花费 18 分钟才能阅读完成。
1. Overview
SWEN20003 Object Oriented Software Development Project 1, 2023Welcome to the first project for SWEN20003, Semester 2, 2023. Across Project 1 and 2, you willdesign and create a music arcade game in Java called ShadowDance (an adaptation of the original90’s arcade game Dance Dance Revolution). In this project, you will create the first level of thefull game that you will complete in Project 2B. This is an individual project. You may discussit with other students, but all of the implementation must be your own work. By submitting theproject you declare that you understand the University’s policy on academic integrity and awareof 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 IntelliJIDEA for Java development as this is what we will support in class.The purpose of this project is to:
• Give you experience working with an object-oriented programming language (Java),
• Introduce simple game programming concepts (2D graphics, input, simple calculations)
• Give you experience working with a simple external library (Bagel)
Extensions & late submissions: If you need an extension for the project, please complete theExtension 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, weddinginvitation, etc. You will receive an email saying if the extension was approved or if we need moreinformation.
If you submit late (either with or without an extension), please complete the Late form in theProjects module on Canvas. For both forms, you need to be logged in using your universityaccount. 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.You must make at least 5 commits (excluding the Initial Submission commit) throughout thedevelopment of the project, and they must have meaningful messages. This is also explained inmore detail at the end of the specification.
2. Game Overview
“The aim is simple : the player has to hit the corresponding musical notes that appear on screenin different lanes on time to score points. Can you beat the target score to win the game?”The game consists of three levels – Project 1 will only feature the first level. The notes willdescend from the top vertically in the 4 lanes. The player has to press the corresponding arrow keywhen the note overlaps with the stationary note symbol at the bottom. The accuracy of how closethe note was to the stationary note when the key was pressed, will determine the points given.There will be special hold notes that require the player to hold down the key. To win, the playerneeds to beat the target score when all the notes have fallen. If the player’s score is lower, thegame ends.Figure 1: Completed Project 1 ScreenshotSWEN20003 Object Oriented Software Development Project 1, 2023
3. The Game Engine
The Basic Academic Game Engine Library (Bagel) is a game engine that you will use to developyour game. You can find the documentation for Bagel here.CoordinatesEvery coordinate on the screen is described by an (x, y) pair. (0, 0) represents the top-left of thescreen, and coordinates increase towards the bottom-right. Eachofthesecoordinates is called apixel. The Bagel Pointclassencapsulates this.FramesBagel will refresh the program’s logicat the same refresh rate as your monitor. Each time, thescreen will be cleared to a blank state and all of the graphics are drawn again. Each of these stepsis called a frame. Every time a frame is to be rendered, the update() method in ShadowDance iscalled. It is in this method that you are expected to update the state of the game.The refresh rate is now typically 120 times per second (Hz) but some devices might have a lowerrate of 60Hz. In this case, when your game is running, it may lookdifferent to the demo videosas the constant values in this specification have been chosen for a refresh rate of 120Hz. For yourconvenience, when writing and testing your code, you may change thesevalues to make your gameplayable (these changes are explained later). If you do change the values, remember to changethem back to the original specification values before submitting, as your code will be marked on120Hz screens.
4. The Game Elements
Below is an outline of the different game elements you will need to implement.Window and BackgroundThe background (background.png) should be rendered on the screen and completely fill up yourwindowthroughout the game. The default window size should be 1024 *768pixels. The background has already been implemented for you in the skeleton package.MessagesAll messages should be rendered with the font provided in the res folder (FSO8BITR.ttf), in size64 (unless otherwise specified). All messages should beroughlycentered both horizontally andvertically (unless otherwise specified).
Hint: The drawString() method in the Font class uses the given coordinates as the bottomleft of the message. So to center the message, you will need to calculate the coordinates using theWindow.getWidth(), Window.getHeight() and Font.getWidth() methods,and also thefont size.SWEN20003 Object Oriented Software Development Project 1, 2023
5.Game Start
When the game is run, a title message that reads SHADOW DANCE should be rendered in the fontprovided. The bottom left corner of thismessage should be located at (220, 250).Additionally, an instruction message consisting of 2 lines:PRESS SPACE TO START
USE ARROW KEYS TO PLAYshould be rendered below the title message, in the font provided, in size 24. The bottom left ofthe first line in the message should be calculated as follows: the x-coordinate should be increasedby 100 pixels and the y-coordinate by 190 pixels.
There must be adequate spacing between the 2 lines to ensurereadability (you can decide onthe value of this spacing yourself, as long as it’s not small enough that the text overlaps ortoo bigthat it doesn’t fit within the screen).To help when testing your game, you can allow the playertopausethegame (i.e. everything in thewindow will stop moving) by pressing the Tab key (this is notassessed but will help you whencoding!)World FileThe lanes and the notes will be defined in a world file, describing the type and their positionor time of appearance in the window. The world file is located at res/level1.csv. (For 60Hzscreens, use the provided res/level1-60.csv file which has all the values halved). A world file isa comma-separated value (CSV) file with rows in one of the following formats:Lane, type of lane, x-coordinate(or)
Type of lane, type of note, frame-numberA
1. Clone the [user-name]-project-1 folder from GitLab.
2. Download the project-1-skeleton.zip package from LMS, under Project 1.
3. Unzip it.
4. Move the contents of the unzipped folder to the [user-name]-project-1 folder in your
local machine.
5. Add, commit and push this change to your remote repository with the commit message
"initial submission".
6. Check that your push to Gitlab was successful and to the correct place.
After completing this, you can start implementing the project byadding code to meet the requirements of this specification. Pleaseremember to add, commit and push your code regularly withmeaningful commit messages as you progress.You must complete the Initial Submission following the above instructions by the due date. Notdoing this will incur a penalty of 3 marks for the project. It is best to do the Initial Submission before starting your project, so you can make regular commits and push to Gitlab since thevery start. However, if you start working on your project locally beforecompleting Initial Submission, that is fine too, just make sure you move all of the contents from your project folder to[user-name]-project-1 in your local machine.
6.Technical requirements
• The program must be written in the Java programming language.
• Comments and class names must be in English only.
• The program must not depend upon any libraries other than the Java standard library and
the Bagel library (as well as Bagel’s dependencies).
• The program must compile fully without errors.
Submission will take place through GitLab. You are to submit to your <username>-project-1
repository. At the bare minimum you are expected to follow the structure below. You can createmore files/directories in your repository if you want.