Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hey im having trouble with a basic C platform game program. For this program, you will be writing a computer program that emulates a player

Hey im having trouble with a basic C platform game program. For this program, you will be writing a computer program that emulates a player moving through a series of static and moving blocks. The aim of the player is to move/jump between blocks while gaining points and lives. It must be written in C language! A layout can be seen below:image text in transcribed

This assignment is divided into different sections, however you may attempt the sections in any order you see fit. You may attempt other sections even if you have not fully completed the Basic Functionality.

You will submit documentation as per the instructions given below and you will be marked on a combination of your documentation and your program. You will need to do both well to get the full marks. If you submit code without the specified documentation you will be marked down, conversely, if you submit documentation for aspects you have not implemented or documentation that does not accurately reflect your program, you will be marked down.

If your program crashes, you will be marked for the sections your marker was able to test before the program crashed. Please test your code regularly to minimise your chance of this happening. You can make multiple submissions to AMS and you are encouraged to do so.

Basic Functionality

1. The display screen is 5 characters high, located at the top of the screen, is entirely visible at all times (i.e. never occluded in any way) and displays:

a. Student number, b. Lives remaining,

c. Playing time in minutes and seconds format as mm:ss, d. Score,

e. Border that separates the display screen from the game area.

The player initially appears on a starting block in the top row. The players sprite is at least 3

characters high and 3 characters wide.

All blocks are:

a. 2 characters high, b. At least 7 characters wide (unless Advanced Functionality is implemented) and are clearly

distinguished from each other (through characters in bitmap or spacing between sprites), c. Always at least sprite height + 2 characters vertically away from other blocks.

Columns are calculated as visible screen width / max block width + horizontal spacing (if used to distinguish between sprites) and there are:

a. The number of blocks on screen is proportional to the number of columns, to a maximum of 160 safe blocks and 40 forbidden blocks,

b. At least 1 safe block per column denoted by = on the screen at all times, c. At least 2 forbidden block on the screen denoted by x on the screen at all times.

Blocks have no consistent observable pattern and each block: a. Appears in a randomly selected row, b. Appears in a randomly selected column (after there is 1 safe block per column),

c. Does not overlap other blocks or the display screen.

Player movement behaves such that:

a. Pressing the a or d key moves the character left and right respectively, b. The player can not overlap the display screen.

c. When off a block, the player free falls downwards at an appropriate speed, d. No lateral motion occurs during downward motion (unless Advanced Functionality is

implemented).

There is a treasure sprite that:

a. Is no larger than the players sprite and has a clearly distinct image, b. Spawns at the bottom of the screen and moves back and forward along the bottom,

changing horizontal direction when it reaches the edges of the screen, c. Stops moving when t is pressed and starts moving again if t is pressed again (i.e. motion

toggles on and off when t is pressed), d. Disappears when the player collides with it and gives the player 2 more lives and returns

the player to the starting block.

The following game mechanics are present:

a. The player starts with 10 lives. b. A point is scored every time the player lands on a safe block.

c. The player dies when they fall off the bottom of the screen or hit a forbidden block. On death, the player starts from the starting block (unless Advanced Functionality is implemented).

d. When the player loses all their lives, the game over screen is displayed which displays a game over message, total score, and game play time.

e. The game over screen allows the player to restart by pressing r (score, lives, time, and screen all reset) or quit with the q key which ends the game gracefully.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Public Finance

Authors: Harvey Rosen, Ted Gayer

8th Edition

0073511285, 9780073511283

Students also viewed these Databases questions