ECE 4122/6122 Lab #3 solution

$29.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (5 votes)

Problem 1: Buzzy’s Revenge (100 pts)
For this assignment you will be creating a derivation of “Angry Birds” called “Buzzy’s Revenge” using the SFML
API. In this game, the user launches buzzy across the field attempting to hit the evil mascots from other
universities, while avoiding the cute woodland creatures. The game plays out as follows:
1. (10 pts) Your application needs to create the opening screen shown above and have the game start
when the user hits the “Enter” key.
2. (5 pts) The “space” key is used to increase buzzy’s initial velocity. As the user holds down the key the
power indicator advances. You need to determine the minimum and maximum initial velocity that
buzzy will have when launched when the space key is released. You need to setup the game’s
dimensions so that buzzy takes 1-4 secs to travel across the field.
3. (10 pts) Buzzy’s initial launch angle is increased and decreased using the “up” and “down” arrow keys.
The buzzy image needs to be rotated to indicate the changing launch angle.
4. (10 pts) Buzzy flight across the field follows a simple projectile motion path.
4
5. (5 pts) The rotation angle of buzzy should change as he fly across the field.
6. (5 pts) When buzzy hits one of the evil mascots (shown below) you get 25 pts and that column
disappears
7. (5 pts) When both mascots are hit the level is recreated.
8. (10 pts) Creating the columns.
a. Only one evil mascot should be in each column.
b. The vertical placement of the evil mascots should randomly change each time the level is
recreated.
c. The placement of all the other wood land creatures should also change each time the level is
recreated.
9. (5 pts) The bee ( ) should fly from right to left along a random/changing path. If buzzy is able to
intercept the bee then the user gets 75 extra points. The bee disappears until the level is recreated.
10. (5 pts) If the user is able to hit the mad unicorn ( ) then the user gets an extra life up to a
maximum of 5 lives. When hit the mad unicorn disappears and all the images above drop down by
one.
11. (5 pts) Buzzy uses up a life when he is launched and does not hit either
a. An evil mascot
b. The bee
c. The mad unicorn
12. (5 pts) If buzzy hits a woodland creature he immediate reappears back at his launch point.
13. (5 pts) If buzzy does not hit anything then he immediate reappears back at his launch point when the
center of the buzzy image leaves the screen.
14. (5 pts) The game ends when buzzy uses up all his lives.
15. (5 pts) Each time a life is lost one of the life images ( )should disappear.
16. (5 pts) The score needs to be updated when points are won.
Extra Credit:
• Up to 6 points extra credit for adding animation to buzzy hitting objects and sound effects (TA’s
discretion)
o (2pts) If buzzy hits a woodland creature then he falls back spinning to the bottom of the screen
before reappearing.
o (2pts) Instead of just having a column disappear, have the images fall spinning to the bottom of
the screen before disappearing.
o (2pts) Add sound effects.
5
Appendix A: Coding Standards
Indentation:
When using if/for/while statements, make sure you indent 4 spaces for the content inside those. Also make sure that
you use spaces to make the code more readable.
For example:
for (int i; i < 10; i++) { j = j + i; } If you have nested statements, you should use multiple indentions. Each { should be on its own line (like the for loop) If you have else or else if statements after your if statement, they should be on their own line. for (int i; i < 10; i++) { if (i < 5) { counter++; k -= i; } else { k +=1; } j += i; } Camel Case: This naming convention has the first letter of the variable be lower case, and the first letter in each new word be capitalized (e.g. firstSecondThird). This applies for functions and member functions as well! The main exception to this is class names, where the first letter should also be capitalized. Variable and Function Names: Your variable and function names should be clear about what that variable or function is. Do not use one letter variables, but use abbreviations when it is appropriate (for example: “imag" instead of “imaginary”). The more descriptive your variable and function names are, the more readable your code will be. This is the idea behind self-documenting code. 6 File Headers: Every file should have the following header at the top /* Author:
Class: ECE4122 or ECE6122
Last Date Modified:
Description:
What is the purpose of this file?
*/
Code Comments:
1. Every function must have a comment section describing the purpose of the function, the input and output
parameters, the return value (if any).
2. Every class must have a comment section to describe the purpose of the class.
3. Comments need to be placed inside of functions/loops to assist in the understanding of the flow of the code.