In this programming project, you are to use Code 12 to write a game with specific...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In this programming project, you are to use Code 12 to write a game with specific given requirements. There is also room for creativity and adding extras, but most of your grade will be based on getting the required features working. As a simplified version of the famous and really old Space Invaders video game (also search on YouTube), you will write Space Invader! (singular). In this version of the game, there is only one alien invader (but he's pissed and persistent), and also only one barrier, and other simplifications, as follows: There are only five objects involved in the game play: 1. The alien. There is only one. He zig-zags downward towards you and speeds up as he gets lower. 2. The gun. You move this left and right with the arrow keys, at the bottom of the screen. 3. The barrier. There is one, horizontally centered, and a little above the gun. 4. The bullet. Pressing the space bar fires a bullet straight up from the gun. There can be only one bullet on the screen at a time, so pressing space does nothing if there is already a bullet in flight. 5. The bomb. The alien drops a bomb straight down at the gun when it is over the gun. There can be only one bomb on the screen at a time, so the alien drops one only when passing over the gun and if there is not already a bomb in the air. You can think of the game as a number of behaviors that you need to get working. The required behaviors for full credit are: 1. The alien starts near the upper-left of the screen and starts moving horizontally to the right at a medium-slow speed. When the alien gets to the right edge of the screen, he moves down a step and starts moving back horizontally to the left. When he gets to the left edge, he moves down another step and starts moving horizontally to the right again. Each time the alien makes a step downward, his speed increases by 20% or so. Hint: Use obj.setXSpeed(), obj.getXSpeed(), and obj.y 2. The gun moves smoothly to the left and right when the left and right arrow keys are held down. Hint: Use ct.keyPressed() 3. If there is not already a bullet in the air, pressing the space bar fires one. The bullet starts at the gun position and moves straight up. Hint: Test if the bullet exists first (see Deleting Objects below), then use ct.keyPressed() 4. If the bullet hits the alien, the score increases by one, the alien restarts at the top-left, and the bullet is deleted. Hint: Test if the bullet exists first, then use obj.hit() 5. If the bullet goes off the screen on the top, it is deleted. Hint: See Deleting Objects below and remember that you can't test the position of a deleted object. 6. If the bullet hits the barrier, the bullet is deleted. Hint: Test if the bullet exists first, then use obj.hit() 7. If there is not already a bomb on the screen and the alien is passing over the gun, then the alien drops a bomb. The bomb starts at the alien position and moves straight down at the gun. Hint: Does a bomb already exist? Where is the alien compared to the gun? Note that the alien moves quickly so you can't compare equivalence of the x 8. If the bomb hits the gun, the game is over. Hint: Check if a bomb exists then use obj.hit() 9. If the bomb goes off the screen to the bottom, it is deleted. Hint: Check if a bomb exists, check bomb.y, then see Deleting Objects below. 10. If the bomb hits the barrier, the bomb is deleted. Hint: Check if a bomb exists, use obj.hit(), then see Deleting Objects below. 11. If the alien hits the gun (and thus made it all the way to the bottom), the game is over. Hint: Use obj.hit() 12. When the game is over, the user is asked if they want to play again. If they answer Yes, the game restarts, otherwise it stops. Hint: Use ct.input YesNo(), ct.restart(), and ct.stop() In this programming project, you are to use Code 12 to write a game with specific given requirements. There is also room for creativity and adding extras, but most of your grade will be based on getting the required features working. As a simplified version of the famous and really old Space Invaders video game (also search on YouTube), you will write Space Invader! (singular). In this version of the game, there is only one alien invader (but he's pissed and persistent), and also only one barrier, and other simplifications, as follows: There are only five objects involved in the game play: 1. The alien. There is only one. He zig-zags downward towards you and speeds up as he gets lower. 2. The gun. You move this left and right with the arrow keys, at the bottom of the screen. 3. The barrier. There is one, horizontally centered, and a little above the gun. 4. The bullet. Pressing the space bar fires a bullet straight up from the gun. There can be only one bullet on the screen at a time, so pressing space does nothing if there is already a bullet in flight. 5. The bomb. The alien drops a bomb straight down at the gun when it is over the gun. There can be only one bomb on the screen at a time, so the alien drops one only when passing over the gun and if there is not already a bomb in the air. You can think of the game as a number of behaviors that you need to get working. The required behaviors for full credit are: 1. The alien starts near the upper-left of the screen and starts moving horizontally to the right at a medium-slow speed. When the alien gets to the right edge of the screen, he moves down a step and starts moving back horizontally to the left. When he gets to the left edge, he moves down another step and starts moving horizontally to the right again. Each time the alien makes a step downward, his speed increases by 20% or so. Hint: Use obj.setXSpeed(), obj.getXSpeed(), and obj.y 2. The gun moves smoothly to the left and right when the left and right arrow keys are held down. Hint: Use ct.keyPressed() 3. If there is not already a bullet in the air, pressing the space bar fires one. The bullet starts at the gun position and moves straight up. Hint: Test if the bullet exists first (see Deleting Objects below), then use ct.keyPressed() 4. If the bullet hits the alien, the score increases by one, the alien restarts at the top-left, and the bullet is deleted. Hint: Test if the bullet exists first, then use obj.hit() 5. If the bullet goes off the screen on the top, it is deleted. Hint: See Deleting Objects below and remember that you can't test the position of a deleted object. 6. If the bullet hits the barrier, the bullet is deleted. Hint: Test if the bullet exists first, then use obj.hit() 7. If there is not already a bomb on the screen and the alien is passing over the gun, then the alien drops a bomb. The bomb starts at the alien position and moves straight down at the gun. Hint: Does a bomb already exist? Where is the alien compared to the gun? Note that the alien moves quickly so you can't compare equivalence of the x 8. If the bomb hits the gun, the game is over. Hint: Check if a bomb exists then use obj.hit() 9. If the bomb goes off the screen to the bottom, it is deleted. Hint: Check if a bomb exists, check bomb.y, then see Deleting Objects below. 10. If the bomb hits the barrier, the bomb is deleted. Hint: Check if a bomb exists, use obj.hit(), then see Deleting Objects below. 11. If the alien hits the gun (and thus made it all the way to the bottom), the game is over. Hint: Use obj.hit() 12. When the game is over, the user is asked if they want to play again. If they answer Yes, the game restarts, otherwise it stops. Hint: Use ct.input YesNo(), ct.restart(), and ct.stop()
Expert Answer:
Answer rating: 100% (QA)
Space Invader which is a simplified version of the Space Invaders video game The game involves five objects the alien the gun the barrier the bullet a... View the full answer
Related Book For
Accounting Information Systems
ISBN: 9780132871938
11th Edition
Authors: George H. Bodnar, William S. Hopwood
Posted Date:
Students also viewed these programming questions
-
A Francis turbine has the following specifications. Impeller vanes are backward curved at inlet with anti-clockwise rotation of the runner. Vane Inlet angle = 40 relative to U1 Absolute velocity at...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
1. Hannah is applying for a life policy on her girlfriend Sarahs life. The policy is $500,000 and carries a large premium. Hannah is the main earner, so she is concerned about not being able to pay...
-
A childs grandparents purchase a $10,000 bond fund that matures in 18 years to be used for her college education. The bond fund pays 4% interest compounded semiannually. How much will the bond fund...
-
In a cryogenic experiment you need to keep a container at 125C although it gains 100 W due to heat transfer. What is the smallest motor you would need for a heat pump absorbing heat...
-
Compute b 21 for the inverse matrix B -1 . B: 2 -5 2-6
-
How can quota sampling being applied through a website like www.linkedin.com?
-
Finding Financial Information Refer to the financial statements of American Eagle given in Appendix B at the end of this book. Required: 1. What is the amount of accrued compensation and payroll...
-
If A transfers a building with a value of $ 5 0 0 , 0 0 0 and a basis of $ 6 0 0 , 0 0 0 in exchange for 1 0 0 shares of a corporation's stock. What are the tax consequences of the transfer to Brenda...
-
Three entrepreneurs were looking to start a new brewpub near Sacramento, California, called Roseville Brewing Company (RBC). Brewpubs provide two products to customersfood from the restaurant segment...
-
3. (2pts) What is the output of this code? x [1,2,3,4,5,6] del x[1] del x[2] del x[3] print(x)
-
What is the bid-ask spread?
-
Professional behaviour means that members of the professional body must: a. maintain their knowledge and skill at the required level. b. keep up to date with changes in regulations and standards. c....
-
Economics is said to be the study of choices that implies trade-offs. Viewed broadly, what is the specific trade-off involved when the environment is the focus of an eco- nomic study?
-
Economists view environmental resources or the natural environment, in general, as a scarce resource. In what specific way is the natural environment regarded as a scarce resource?
-
What are the differences between the physical location exchanges and the NASDAQ stock market?
-
Hi CPA, I bought my house in 1980 for $75,000. I talked to realtor, and the realtor believes that my husband and I can sale the property for at least $300,000. Supposing that this is the case and we...
-
The value of a share of common stock depends on the cash flows it is expected to provide, and those flows consist of the dividends the investor receives each year while holding the stock and the...
-
Which of the following systems analysis techniques (i) work measurement analysis, (ii) work distribution analysis, (iii) questionnaire, (iv) logical data flow diagram, (v) interview, (vi) input/...
-
What are the objectives of a fixed- asset or investment accounting system?
-
Identify several components of CIM.
-
Comment on this statement: Dynamic modeling is about interaction.
-
Explain how objects interact by exchanging messages.
-
Describe the relationship between dynamic modeling, behavioral modeling, and structural modeling.
Vaccine Anxieties Global Science Child Health And Society 1st Edition - ISBN: 184407370X - Free Book
Study smarter with the SolutionInn App