Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use c++ to answer this quest Figure 1 depicts a screen shot from a game called Dodge. Dodge consists of: - A single player

image text in transcribedimage text in transcribedplease use c++ to answer this quest

Figure 1 depicts a screen shot from a game called "Dodge". Dodge consists of: - A single player who can only move left and right and is controlled via the keyboard. - Raindrops which appear in random positions in the top quarter of the screen and fall vertically downwards. The number of raindrops on the screen at any one time remains constant - whenever a raindrop disappears off the bottom of the screen, a new one appears at the top of the screen. The objective of the game is to move the player so that he or she does not get wet, that is, the player must dodge the raindrops. If a raindrop touches the player then the game is over. F1gure 1: Dodge screensnot Provide the complete source code for the Dodge game. Your solution must be object-oriented. Certain classes have already been implemented and you should use these, where appropriate, in your solution. The interfaces for these classes are given in Listings 17 and 18 in Appendix 2. You may use very simple graphics for the game elements and you can assume that the player will not move beyond the borders of the screen. You are not required to separate the display logic from the game logic. Listing 17: Screen class I/ The KeyBoardinputHandler class recognises the following keys enum Key \{None, Space, Escape, Leftarrow, RightArrow, UpArrow, DownArrow\}; class KeyBoardinputHandler public: I/ Returns the most recent key that was pressed II Only the keys specified in the enuneration type above are recognised II If no key has been pressed "None" is returned Key getKeypressed() canst; Listing 18: KeyboardInputhandler dass

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

Students also viewed these Databases questions

Question

Explain the process of MBO

Answered: 1 week ago

Question

At what level(s) was this OD intervention scoped?

Answered: 1 week ago