Develop code to implement a simple interactive game

Assignment Help C/C++ Programming
Reference no: EM13833303

Assignment

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

Introduction

The goal of this assignment is to allow students to demonstrate their understanding of the features of the C++ language through the design and development of a simple console-based game. To achieve this goal the student will be required to complete the following steps:

i. Design a simple interactive game (can be based on an existing game)

ii. Develop code to implement this game design (primarily your own, original code)

iii. Test your implemented game for functionality and bugs, and

iv. Document the design/implementation/testing process as well as a user/start-up guide.

There are two key dimensions to this assignment: (1) a demonstration of the software design and development process used by the student; and (2) the completed game that meets a minimum set of requirements. The assignment will require the submission of all documentation and source code for the game.

The following sections detail both the required/expected features of the game and the required documentation. A breakdown of marks to be awarded to each component is also given.

Demonstration of C++ Proficiency

To achieve the goal of demonstrating a sufficient understanding of the C++ language, the submitted game software must contain appropriate examples of the following C++ mechanisms and features:

• Demonstration of C++ programming (standard/basic) features. Appropriate use of:

o variable, constant and enumerator types o loops and branch statements o functions and modularisation

o appropriate use of references to variables and functions

• Demonstration of basic OO programming principles. Appropriate use of:

o class declarations to represent game and/or program entities o object instantiation and use

• Console and File I/O - appropriate use of:

o standard Library input/output streams

o accessing external data files for either input or output • Rigorous error checking and handling through:

o validation of input data

o error checking/validation of function arguments o error checking of function return values

Game Concept

The style and setting for this game is left up to you. The type of game you choose must be sufficient to demonstrate the programming features listed above. Our recommendation is for you to constrain your software to a console application using ASCII characters (text) for display. Games suited to this format may include: an adventure game; a simple simulation/strategy game; or a maze/platform style game.
Game Suggestion - Dice game ‘Pigs'

Pigs is a dice game of chance which involves two players trying to be the first to reach a score of 100 to win. The basic rules of the game ‘pigs' is described below (as taken from Pig (dice) Wikipedia page):

Each turn, a player repeatedly rolls a die until either a 1 is rolled or the player holds and scores the sum of the rolls (i.e. the turn total). At any time during a player's turn, the player is faced with two options:

• roll - If the player rolls a o 1: the player scores nothing and it becomes the next player's turn. o 2 - 6: the number is added to the player's turn total and the player's turn continues.

• hold - The turn total is added to the player's score and it becomes the next player's turn.

The first player to score 100 or more points wins.

As you can see there are few rules to the game are and the gameplay is quite simple. An example of the playing of this game, showing only one round - that is each player having one turn - is shown below (also taken from Pig (dice) Wikipedia page):

For example, the first player, Ann, begins a turn with a roll of 5. Ann could hold and score 5 points, but chooses to roll again. Ann rolls a 2, and could hold with a turn total of 7 points, but chooses to roll again. Ann rolls a 1, and must end her turn without scoring. The next player, Bob, rolls the sequence 4-5-3-5-5, after which he chooses to hold, and adds his turn total of 22 points to his score.

The game pigs has a number of variations including the use of two dice. This could be implemented in your program through a menu choice ‘Options' which sets the games parameters (i.e., number of dice, number of players, special Pig number [default is 1], or the winning score to end the game [default 100]).

Examples

The following are simple animated examples (using javascript and flash respectively). In your solution you are expected to only provide a text-based solution. These examples are only provided to support your understanding of how to play the game pigs:

• https://cs.gettysburg.edu/projects/pig/piggame.html

• https://scratch.mit.edu/projects/Paddle2See/1479420.

Other Suggested Games

Some online examples of text-adventure like games that can be used for ‘inspiration', include:

• Hammurabi https://www.hammurabigame.com/hammurabi-game.php

• Zork https://thcnet.net/error/index.php

• Star Trek https://www.vavasour.ca/jeff/level1/entry6_preview.html Also, think of some traditional games that may be used for inspiration:

• Cluedo https://en.wikipedia.org/wiki/Cluedo

• Risk https://en.wikipedia.org/wiki/Risk_(game)

• Battleship https://en.wikipedia.org/wiki/Battleship_game Card and dice games may also be considered:

• Cards - blackjack

• Yacht (dice game) https://en.wikipedia.org/wiki/Yacht_(dice_game) Word/text based games may also be considered:

• Hangman

• Word jumbles

• Word find

PLEASE NOTE:

1) These games are only provided to give you some suggested ideas/themes, please feel free in creating a game of your choice - the requirement is that it must meet the generic features and functionality listed below!

2) Some of the games listed above require two players; in such cases it is not expected that students implement a complex "AI" computer opponent. It is sufficient for the second player can be controlled: manually using a different set of keys (or for each player to have a turn to provide input), or use of random moves/choices as performed in the lecture example of Tic-Tac-Toe.

Required Game Features/Functionality

In providing the required features (listed in the Demonstration of C++ Proficiency section above), the game must also support the following set of programming & gameplay features:

• Game Software Features o Implementation of an appropriate game loop o Changeable game states based on user input
• Basic/Simple User Interface o Accepts user input via keyboard input as commands/directions

o Is able to display/present the current game state in simple text based form (either as descriptive text or simple ASCII graphics)

• Multiple game (software) states o At least 3 game states - (1) menu/start; (2) play; and (3) end game states.

• A single, playable level o This may take the form of a single map/region/level/etc.

• Associated menu items:

o Options - allow the user to modify configurable features of the game (i.e., number of dice used, number of players, difficulty level)

o Instructions - present the player with a description on how to play the game, with the objective and user input detailed.

o Credits/software development process - a description on the design and development of the application. Present details on the variables used, the structure of your program (flow of execution) and the a reflection on the development process highlighting any issues you faced and how you over come them.

• File input/output o Loading of data related to the game (e.g., maps, a level, or descriptive text) o Loading & Saving of a high-score (like) data

• Features appropriate to the game genre o Dialogue to engage the player (interesting/funny) for an RPG style game o Potentially dynamic/random text (e.g., for a text adventure game)

Optional Game Features/Functionality - Bonus Marks

Additional features that you may wish to include for an additional 10% ‘bonus marks' include:

• Use of dynamic memory allocation & pointers

• Advanced object oriented features such as hierarchies, polymorphism, etc.

• Use of log/error streams for debugging purposes

• Multiple levels (game play advances once a level is completed):

o Levels have varied content (entities) or difficulties, for example:

? Level 1 - a single map

? Level 2 - 2 maps (passing through a doorway leads you onto the 2nd map)

? Level 3 - 5 maps in a cross pattern (centre map, with maps above/below and left/right) • Inventory - with collectable items. This will enable gameplay mechanisms such as:

o Collection of game items (e.g., gold, money, keys, swords, armour, etc.) o Ordering of items (e.g., you need to collect the key before opening the chest).

Reference no: EM13833303

Questions Cloud

What about an environmental risk : 1) What about an environmental risk, can these be mitigated?  For example, what if a suppler over in Japan has an earthquake?Expanding a supply chain to the global level has many benefits. The added complexity of a global supply chain comes with addi..
Consumption bundles lies on the same indifference curve : Fisher's utility function for trout (T) and salmon (S) is given by U = ST, where the MUT = S and MUs = T. Which set of consumption bundles lies on the same indifference curve?
Mayan priests interest in astronomy led to the creation of _ : Mayan priests interest in astronomy led to the creation of ____
Analysts have estimated the present values : Analysts have estimated the present values of the following effects over the expected useful life of the pool: PV (million dollars) State grant: 2.2 Construction and maintenance costs: 12.5 Personnel costs: 8.2 Revenue from county residents: 8.6 Reve..
Develop code to implement a simple interactive game : Design a simple interactive game (can be based on an existing game). Develop code to implement this game design (primarily your own, original code). Test your implemented game for functionality and bugs.
Refuses to comply with walmart''s request : Express you personal opinion in the essay below and answer the following questions and put them in the last paragraph and put  it in order or by number.1)  If a vendor or company refuses to comply with Walmart's request, is there anything Walmart?2) ..
Identify at least three audit software that auditors can use : Research to identify at least three audit software that auditors can use during the audit. Discuss (1) each audit software; (2) how the auditors can use the audit software during the audit (i.e. conduct analysis, sample data, collect and track audit ..
What is the most effective way to begin studying a lesson? : What is the most effective way to begin studying a lesson?
Marginal rate of substitution of earrings for necklaces : Cher's marginal rate of substitution of earrings (E) for necklaces (N) is 5 (MRSEN = 5). This information implies that:

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Describe what an attribute or data member of a class

Analyze a basic set of requirements for a problem - Describe what an attribute or data member of a class - Distinguish between pass-by-value and pass-by-reference

  Analyze a basic set of requirements for a problem

Analyze a basic set of requirements for a problem - Compose basic C++ language programs

  First display the smallest volume and then the largest volum

first display the smallest volume and then the largest volume.

  Setup a class to store a book

Setup a class to store a book. The data is to include title, author, year of publication, dewey number and age.

  Write a program that will convert us dollar amounts

Write a program that will convert US dollar amounts to Canadian dollar (1 CND = 0.92 USD). Format your currency amounts in two decimal places and trailing zeros.

  Calculate the modified value of the first character of input

To calculate the modified value of the first character of input we add its mapped value to the mapped value from the first character of the encryption string.

  Write a c++ function that removes and counts all occurrences

Write a C++ function that removes and counts all occurrences of a given string from such a bag. Your function should return this number.

  Our string class always deletes the old character

Our String class always deletes the old character buffer and reallocates a new character buffer on assignment or in the copy constructor. This need not be done if the new value is smaller than the current value

  Write a programme on credit card number check

Credit Card Number Check. The last digit of a credit card number is the check digit, which protects againsttranscription errors such as an error in a single digit or switching two digits

  User that will be asked to input the time

Write a code for the following C++ problem. We will have a user that will be asked to input the time of a train traveling in terms of minutes and this minutes is a non-negative integer.

  Question 1 what basic differences exist between the

question 1 what fundamental differences exist between object-oriented and relational database systems?question 2

  Write test program to call function several times for gcd

Greatest common divisor of two integers is largest integer which will evenly divide both integers. Implement this function in assembly language and write test program which calls function several times, passing it different values.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd