Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Produce simple Scrolling Game where a player tries to avoid harm and collect benefit.In the game, your player character will be positioned near the left

Produce simple Scrolling Game where a player tries to avoid "harm" and collect "benefit."In the game, your player character will be positioned near the left edge of the screen and will move up and down based on the user pressing the up and down arrow keys;the player should not be able to move off the edge of the screen.

Harm and benefit characters (at least one of each) will move across the screen from right to left, and upon collision with the player will either reduce game lives or increase score.When lives are gone, the game ends;the loop should stop and a message should be displayed.Your program should have 3)(note that your game must use images, not circles or dots)

Requirements

  1. Characters are represented as images on the screen
  2. Screen should be 500 x 500, with a background image.
  3. Player is near the left edge and "moves" up and down in response to keypresses
  4. Harm and benefit characters (at least 1 each required) continuously move from right to left, looping back to the right edge when hitting the left edge
  5. When characters are looped back to the right edge, they should be set to a random y position.
  6. Game should start with 3 game lives and a score of 0. (but set it to 1 while testing)
  7. When a benefit collides with the player, score should be increased (by some amount you choose.)
  8. When a harm collides with the player, game lives should be reduced by 1.
  9. Score and lives should be displayed on the screen.
  10. When lives are reduced to 0, the game (and the loop) should end, with a Game Over message displayed.

Programming Style

This project is to be written using good programming style. Elements of good programming style include:

Meaningful Variable Names

Proper Indentation of Code

Blank Lines between Code Sections

Use of Functions

In-Line Commenting

Header Comment for the File

Header Comments for each Method.

Submission

######################################################

imports

global vars

function definitions

def main();

main()

Rubric

Missing

Partial

Complete

Uses background image

0

1

2

Uses images for characters in the game

0

1

2

Player moves up and down in response to keypress

0

1

2

Harm and benefit characters move from right to left

0

1

2

Characters looping back to the right side with a random y position when hitting the left edge

0

1

2

Starting with 3 game lives and a score of 0

0

1

2

Benefit increases score

0

1

2

Harm reduces lives

0

1

2

Score and lives displayed on the screen

0

1

2

When lives are reduced to 0, the game ends

0

1

2

Game Over message appears

0

1

2

Programming Style

Variable and function names are meaningful

0

1

2

Variable and function names follow Python standards

0

1

Includes meaningful in-line commenting

0

1

Includes header comment for the file

0

1

Includes comments describing each function

0

1

Total

28

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

How can you defend against SQL injection attacks?

Answered: 1 week ago