# report c++.doc - 1.0 Requirement Our group is asked to...

• 26

This preview shows pages 1–4. Sign up to view the full content.

1.0 Requirement Our group is asked to develop a game using Dev-c++ where it is involved one projectile, graphics and path of the object must take gravity into an account. The game also needs to have at least one obstacle partially obstructing the throwing path according to us how the obstacle is. Furthermore, in the game, there should be at least one other difficulty or stage for the player. 2.0 Analysis We use graphics and text, the purpose of this is to give comfort to our customer and user in a form of size. The size of the screen that we use is 640 x 480 pixels. The graphic that we use are ball, line, bar, circle, polygon, arc, and much more. Besides that, we also use formula especially math which is distance formula for our game. When the user press or key in specific velocity, the ball will shoot according to the velocity where it also set up the angle where the user wants to hit the object which contain marks. The marks will appear after it has hit the object. Our target user is age 3 and above even people that interested to play a simple game because, the game that we develop featuring a part of stress release and educate. The user will learn how to calculate the velocity to reach the highest marks and they will feel a release after getting the marks that they want. 3.0 Specification To develop this game, our group use programming software DEV C++ computer software. A math formula for distance Graphics code and other C++ code. 1

This preview has intentionally blurred sections. Sign up to view the full version.

4.0 Design We showing our game interface by using a computer language as shown below; initwindow (640,480); It will appear game front page that have a height coordinate y=0 to 480 and wide coordinate x=0 to 640. We draw a graphic coordinate x and y. We have determined a line and line color inside our game by using a computer language like showing below: line (0,370,640,370);lower_floor And this code must be insert after initwindow (640,480); so that the line will appear in the window graphic. And in this game, we have used many type of variable. The data table below shows the name and type of each variable that we use: Variable type: Keyword: Character char Integer int Double-precision double When the game start the game will automatically shows instruction to the user. Then, the user will require entering an angle value and velocity. When angle have been adjust by the user, the player in the game will automatically shoot onto the target forward. It will shoot referring to velocity and angle value entered. As it hitting a target, the rewards will appear directly on sub main window. In our game, the marks as the rewards for the user. User can choose the stage that they want to try. 2
5.0 Implementing The Design – The Source Code The ‘Canon Ball Game’ Source Code. #include <iostream.h> #include <conio.h> #include <graphics.h> #include <cmath> #include <fstream> #include <windows.h> #include <string> using namespace std; void ball(int,int,int); void obstacle(); void building (); void popout(); void stickman (); void printresult(); void name (); int hitred(int,int); int hitgreen(int,int); int hityellow(int,int);

This preview has intentionally blurred sections. Sign up to view the full version.

This is the end of the preview. Sign up to access the rest of the document.
• Fall '17
• UNknown
• Ball game, setcolor

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern