Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Homework Help/Study Tips Expert

Assignment: Pong

Overview-

The assignment is a variation on the Pong theme. The player controls a game paddle positioned near one edge of the terminal window which moves vertically but not horizontally. A ball flies within the playing area of the game, bouncing off floor and ceiling and one of the walls, but passing through the remaining wall.

645_Figure.png

Requirements-

Your task is to implement the Pong game. Throughout the semester, you have been provided with a number of examples of skeleton code for implementing games with the CAB202 ZDK library. You have also been  shown  a demo  version of the  game  (see the  Topic  3  lecture), which implements  some of the requirements  for the  assignment.  You are not required to use  the  ZDK library, but you are  strongly encouraged to do so. 

Game Specification-

The game has four levels which entail qualitatively distinct modes of play. Pressing the key  labelled 'L' at any time during play advances the level by 1. After Level 4, the level cycles back to Level 1. There is no other way to progress between levels. For all levels, the following basic game functionalities need to be implemented in order for the game to work properly:

1.  The game must adapt itself to occupy the full expanse of the terminal window at the time the program starts.

a. You may assume that the width of the terminal window is at least 60 units and the height of the terminal window is at least 10 units.

b. You may assume that the user will not resize the window while the game is running.

2. Help screen is displayed at commencement of game, prior to moving on to game itself. 

a. Help screen must show the name and student number, plus a list of keyboard commands required to play the game.

b. Help screen exits when user "Presses any key".

c. Also displayed when user presses 'h'.

d. Also displayed after the game over dialogue, if user has selected "Play again", before moving on to restart the game.

e. While the help screen is displayed, all other game dynamics are frozen, including the elapsed game time.

3. After help screen at the start (or restart) of game, borders and game status display is shown. The status display shows:

a. Lives, initially 10 (or 3, or something reasonable).

b. Score, initially 0.

c. Level, initially 1.

d. Elapsed game time, measured in minutes and seconds, initially 00:00.

4. Ball is spawned at the beginning of play, and re-spawns each time it leaves the playing area, unless the game is over. Ball spawns in two stages.

a. Countdown (3, 2, 1...) for 0.3 seconds.

b. During the countdown all other game dynamics are frozen, including the elapsed game time.

c. Launch from centre of screen, travelling towards the player's end of the game in random direction within ±45° of horizontal. The speed of the ball at spawning should be set to some fixed value that yields a playable game, neither too slow nor impossibly fast. 

5.  Game border and info panel during play 

a. Lives are reduced by 1 every time the ball passes out of the play area at the player's end.

b. Score increments by 1 every time the player's paddle strikes the ball (or vice versa).

c. Current level accurately reflects state of game.

d. Ball, paddles and other sprites never pass onto or over the boundaries.

e. Elapsed game time is updated in a timely manner once per second.

f. Elapsed game time records time spent in game. While any dialog (help screen, spawn countdown, or game over) is being displayed, the clock is stopped. After a dialog is cleared, elapsed game time resumes from the value it had at the time the dialog opened. That is, the clock is stopped while the game is paused.

6. The player's game paddle: 

a. The player controls a paddle which is constrained to move vertically at one side of the playing area.

b. The paddle is placed so that there are exactly two columns of empty space between the paddle and the nearest vertical wall of the playing area.

c. The paddle must never protrude beyond the playing area, overlap the boundary, be obscured (in part or whole) by the boundary, or in any other way not fit properly inside the playing area.

d. The paddle must have a width of 1 screen unit and the height must be the minimum of the two values listed below:

1. 7 screen units; or

2. (h - hs - 1)/2 screen units, where h is the height of the screen and hs is the height of the status display. 

When the ball hits the player's paddle, or the computer-controlled paddle (when in play, see Level 2) (NOTE: This section outlines the physics required for criteria on row 42 of the marking spreadsheet): 

a. If the point of contact is not one of  the endpoints of the paddle, the ball is reflected horizontally.

b. If the point of contact is the top endpoint of the paddle: 

i. If ball is moving downward, AND distance from top of paddle to ceiling is greater than height of the ball - ball is reflected vertically, that is, it bounces off the top of the paddle and continues moving with its current horizontal velocity. If necessary, the ball may be shifted to the screen location immediately above the paddle to ensure it does not get stuck.

ii. Otherwise - ball is reflected horizontally, that is, it bounces off the side of the paddle, reversing its horizontal velocity.

c. If the point of contact is the bottom endpoint of the paddle: 

i. If ball is moving upward, AND distance from bottom of paddle to floor is greater than height of the ball - ball is reflected vertically, that is, it bounces off the bottom of the paddle and continues moving with its current horizontal velocity. If necessary, the ball may be shifted to the screen location immediately below the paddle to ensure it does not get stuck.

ii. Otherwise - ball is reflected horizontally, that is, it bounces off the side of the paddle, reversing its horizontal velocity.

d. We are aware that this may occasionally produce slightly unrealistic physics: this is by design.

The assignment is to be done using cygwin. you would ZDK librqry file which i have attached.

Attachment:- Assignment.rar

Homework Help/Study Tips, Others

  • Category:- Homework Help/Study Tips
  • Reference No.:- M91944467

Have any Question?


Related Questions in Homework Help/Study Tips

Plans developmentally appropriate curriculumthis assessment

Plans Developmentally Appropriate Curriculum This Assessment is a Work Product in which you will design a set of learning experiences that could be implemented as part of an effective curriculum for preschool children (a ...

Question in collaboration with your approved course mentor

Question: In collaboration with your approved course mentor, you will identify a specific evidence-based practice proposal topic for the capstone project. Consider the clinical environment in which you are currently work ...

Blume l b amp zembar m j 2007 middle childhood to middle

Blume, L. B., & Zembar, M. J. (2007). Middle childhood to middle adolescence. Upper Saddle River, NJ: Pearson [Vital Source e-reader]. Chapter 3, "Physical Development in Middle Childhood" In this chapter, the author exp ...

Question 1 write a 50- to 175-word e-mail to a student

Question: 1. Write a 50- to 175-word e-mail to a student that discusses the strategies you are learning about this week. Ensure you include answers to the following: - What are some notetaking strategies? - What are some ...

Reflective journalan effective teacher is a reflective

Reflective Journal An effective teacher is a reflective decision-maker who is able to articulate a solid rationale for his or her deliberative teaching practices and professional actions. Your objective in this Assignmen ...

Assignment revise literatureinformation sourcesthis is one

Assignment : Revise Literature/Information Sources This is one last chance, if necessary, to share with your Research Chair any further changes or additions to your completed writing. Review the feedback your Research Ch ...

Question create a 10- to 12-slide powerpointreg

Question: Create a 10- to 12-slide PowerPoint® presentation that discusses Freud, Erikson, and two other psychoanalytic or neo-psychoanalytic theorists. Discuss the following in your presentation: • Why was Freud's work ...

Assignment conducting an environmental analysisfor all

Assignment : Conducting an Environmental Analysis For all assignments assume that you are the administrator of a fictitious organization of your choice. The organization can be any type of health care organization such a ...

Discussionbefore taking this course i have to admit i never

Discussion Before taking this course, I have to admit I never really thought deep into the creation of social statistics and the aspect that go into getting specific statistics. In my view a statistic was an observation ...

Manage remuneration and employee benefits part

Manage remuneration and employee benefits Part -1: Performance objective Demonstrate the skills and knowledge required to analyse strategic and operational plans in order to present remuneration and benefit options to ma ...

  • 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