Ask C/C++ Expert


Home >> C/C++

GAME PROJECT - A Simple Graphics-based Game in C++ 

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 Game play 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.

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

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.)

Attachment:- Arcade Game Code.zip

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M91990117

Have any Question?


Related Questions in C/C++

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As