Skip to main content
留学咨询

辅导案例-GAME1017-Assignment 1

By May 15, 2020No Comments

GAME1017 – Game Fundamentals II Assignment 1 *** Due February 23rd by Midnight *** Assignment: ‘Completing’ Top-Down Shooter Game You can work in pairs or individually. The goal of this assignment is to expand a simple 2D shooter to include a singleton, state machine and UI buttons to change states. This assignment, worth 20% total, won’t be broken down into different milestones but you’ll have several headings going over each criterion due. Source Project The source project for this assignment could be your GAME1007 Milestone 4 if you had GAME1007 the previous semester OR the A1 start project I have provided in the Assignments folder. The provided source project is setup to include all the libraries we require for GAME1017 including the mixer (sound) and TTF (fonts). Requirements Here’s a summary of the new requirements for this assignment. You’ll need to: • Make the game engine a singleton. • Add a state machine to run the game with: o Title state, game state, pause state, lose state o Optionally a win state • Add a UI button to the states for transitioning to the next. Engine Singleton As in the state machine example posted in Week 2 and that we’ve gone over, you are to take the Game engine object and instead turn the Engine class into a singleton thereby creating a globally-accessible instance you can access from any method of any class. It’s simple and a good place to start. COURSE CODE: GAME1017 – Game Fundamentals II Page 2 of 4 State Machine I’ll briefly go over each state and the requirements in point-form for each. If I don’t mention anything, then please assume that you can have freedom to make your own decision for it. A Title state will: • Be the initial state. • Display an image for the name of the game with size and name of your choice. Keep it profanity free. It can just be a bitmap made in Paint, I don’t care. Use your judgement to determine the size on screen. • Contain a small button with the text ‘Start Game’ on it. You don’t need a mouseover state, but when you click the mouse when the cursor is over the button, the game will start. The Game state will: • Run the main game. • See the headings below for additions to the gameplay. • Parse a key press for ‘P’ that will trigger a transition to the Pause state. o This is already done in my example. • Still be rendered, but not updated, when the Pause state is active. The Pause state will: • Not replace the game state but will run ‘over’ it, like in my example. • Display a transparent rectangle over the game state. • Display a button with ‘Resume’ text on it. Again, you don’t need a mouseover state, but when you click the mouse when the cursor is over the button, the game will resume. • You are allowed to keep the ‘R’ key press parse (from my example) but you MUST add the button as per above. The Lose state will: • Be triggered when the player collides with any of the hazards of the game, including enemies and the enemy bullets. • Display a button with ‘Main Menu’ text on it. Again, you don’t need a mouseover state, but when you click the mouse when the cursor is over the button, the title state will be triggered. • You can display anything else you want in this screen but keep it clean. The optional Win state will: • Be triggered when at a condition of your choice, e.g. if the player destroys a certain number of enemies. • Display a button with ‘Main Menu’ text on it. Again, you don’t need a mouseover state, but when you click the mouse when the cursor is over the button, the title state will be triggered. • You can display anything else you want in this screen but keep it clean. COURSE CODE: GAME1017 – Game Fundamentals II Page 3 of 4 You can implement the state machine however you like so long as you have an abstract State base class, the required derived subclasses and the state machine class itself to manage the states. UI Buttons The few buttons required to change states can be made however you like, even with Paint. Of course, you’ll need to write the code to support whatever method you choose. I won’t be providing sample images though. We will have in-class examples that go over button creation and simple click parsing. Sounds Sounds are provided in the starting project and were part of the requirements for the GAME1007 assignment, but you can add any more that you like including different tracks for the different states. Misc. Notes You can work on this individually or in pairs – preferably the same pairs you had for the assignment of GAME1007. Plagiarism penalties will apply. COURSE CODE: GAME1017 – Game Fundamentals II Page 4 of 4 Assignment 1 Submission: Zip your entire project and submit it through the Blackboard link as I want to make sure you’ve got the proper include/library/other links in your project settings. Name it: GAME1017_A1_LastnameFirstname A1 Marks: 20% of course grade Task Marks Description Game Engine/ State Machine 10 You have an Engine class as the engine, and it executes properly – 1 You create a static method ‘getter’ for the instance – 1 You create a static Engine object and return it from the method – 1 You access the static instance method in your program – 1 You have an abstract State base class – 1 You have a subclass for the title state that works properly – 1 You have a subclass for the game state that works properly – 1 You have a subclass for the pause state that works properly – 1 You have a subclass for the lose (and win) states that work properly – 1 You have a state machine class that controls the states and includes methods for update, render, enter and exit and changing states – 1 UI Buttons 5 You created the button for the title state properly – 1 You created the button for the pause state properly – 1 You created the buttons for the lose state properly – 1 The buttons are rendered over their state – 1 The player can properly click on the buttons and trigger the state change – 1 Aesthetics 5 Your game compiles and executes properly – 1 Your game doesn’t look like complete garbage – 1 The transitions between states work and are smooth – 1 There is no delay in playing sounds when they are triggered – 1 There’s no flickering when the pause state is running – 1 Total: 20

admin

Author admin

More posts by admin