Assignment title: Information


1 SIT153 – Assignment #2 GAME PROJECT – A Simple Graphics-based Game in C++ Due Date Assignment must be submitted by 11:59pm Sunday 2nd October 2016 (end of Week 12) Introduction The goal of this assignment is to allow you to demonstrate your understanding of the following game related topics in C++: i. Steps within a Game Loop: input / update / draw. ii. Role of Class Hierarchies (and use of abstract base classes) for simplifying the game loop. ii. The use of Container Objects to store the entities used within a game and their implementation and use within the game loop. iii. How to implement basic Interactive Gameplay Elements such as user input (mouse and/or keyboard) that result in changes to the game scene. iv. Capacity to read, interpret and modify (somewhat complex) existing code projects. You are provided with a C++ project called ArcadeGame that implements a basic 'framework' for a game. This framework code implements the basic game loop, a base abstract Sprite class and a demonstration of a Box class that is derived from the base Sprite class. You are asked to extend and/or modify this code base to demonstrate your proficiency in C++ coding and game element programming. Stages To achieve the goal of demonstrating a sufficient understanding of the C++ language, the submitted game software should achieve these incremental stages: • Stage 1 – Deriving from the Sprite base class Based on the current 'Box Sprite' class, design and implement additional derived classes for 'Circle Sprite' and 'Bitmap Sprite' – which use the lower level API of the WinCanvas class. Use these new classes to create a picture with each of these primary sprites types. Note: The positions of these sprites can be hard-coded into your program and can be static. • Stage 2 – Moving Sprite objects Now that you have the ability to place various sprites within you scene, provide velocity to them and have them move around the screen. This can involve simple movement such as moving in the direction of the x- or y-axis (across or up/down the screen, respectively) and when they leave the edge of the screen they 'wrap' around and return on the other side. • Stage 3 – Scene containing a variety of moving Sprite objects Extend and use the 'Scene' class that provides a container for an arbitrary number of Sprite objects (Note, this is a container of base-class pointers, which allows you to store pointers of various derived classes and access them through the base class pointer!). The Scene object should allow Sprite pointers to be 'added' and 'removed'. Use this container to iterate over and for each element call the objects' respective update() and draw() methods. SIT153 Introduction to Game Programming School of Information Technology © Deakin University, 20142 • Stage 4 – User Input Allow the user to interact with the sprites through simple user input (keyboard and/or mouse input). For example, allow the user to enter 'C' for the creation of a new Circle object, or use the mouse click to alter the state of objects (or even remove them from the scene). • Stage 5 – Controllable Player Sprite Class Design and create a Player class that can be controlled from user input (keyboard W, A S, D for example). The player can be represented by one of the Sprites you have already created, or be altered depending on the input used (for example a different Bitmap for an player moving left to that of a player moving right). Optional Game Features/Functionality – Bonus Marks (up to 10 marks) If you wish, you can provide additional functionality or features that further demonstrate your understanding and knowledge of the C++ language. Areas that could be considered (but not limited to) include: • Improved interaction/collision detection/resolution between objects • File system interaction – for the loading of game scene description data • Bitmap sprite animation • Implementation of appropriate design patterns (eg. object factory, object pools, command pattern, etc.) Submission Requirements • Each file should contain a brief comment block at the beginning indicating the contents of the file, who authored it, date and student declaration, as shown in the example below: /***************************************************************** * NAME: * STUDENT ID: * UNIT CODE: * ASSIGNMENT: * DUE DATE: ***************************************************************** * Plagiarism and collusion * Plagiarism occurs when a student passes off as the student's own * work, or copies without acknowledgment as to its authorship, the * work of any other person. * Collusion occurs when a student obtains the agreement of another * person for a fraudulent purpose with the intent of obtaining an * advantage in submitting an assignment or other work * * Declaration * I certify that the attached work is entirely my own (or where * submitted to meet the requirements of an approved group * assignment is the work of the group), except where work quoted * or paraphrased is acknowledged in the text. I also certify that * it has not been submitted for assessment in any other unit or * course. * * I agree that Deakin University/College may make and retain copies * of this work for the purposes of marking and review, and may * submit this work to an external plagiarism-detection service who * may retain a copy for future plagiarism detection but will not * release it or use it for any other purpose. * * DATE: * * An assignment will not be accepted for assessment if the * declaration appearing above has not been duly completed by the * author. ***************************************************************** * Program Description ... * ***************************************************************** */ • All code should be clearly commented with regards to the assignment question it answers and how it contributes to that answer. • Please ensure that you "Clean" your solution in Visual Studio before submitting it (Under the Build menu, select "Clean Solution") & delete the LARGE (.sdf) file!3 Assignment Submission This assignment must be submitted through the SIT153 Moodle Assignment 2 dropbox and include: The Complete Source Code – a zip file that comprises the complete Visual Studio solution and project. This solution must contain the associated source code folders. It is expected that the source code is fully documented with relevant comments describing and explaining the features of the code. Assignment Marks Assignment is marked out of 50 and is worth 20% of your final mark. Up to 10 marks are awarded for the successful completion of a stage, totalling 50 marks for all 5 stages (or 60 marks if completed the additional bonus work for up to 10 additional marks). Marks will be deducted from your total stage (and bonus) score using the following criteria: • -5 mark penalty for insufficient/unclear commenting • -5 mark penalty for obvious/poor coding practices • -10 mark penalty will be applied if any of the submission requirements are not met. PLEASE NOTE: Clearly indicate in your program the code portions that are not your own (provided in the framework project or from other sources) properly referencing the original source. Your source code should provide a completed 'student declaration' form, this can be represented in a comment of your main code.