Date post: | 25-Oct-2014 |
Category: |
Documents |
Upload: | jayati-jaiswal |
View: | 68 times |
Download: | 0 times |
BALLOON SHOOTING GAMEGROUP MEMBERS:ADITYAMANDAHRE101034NITIN CYRIAC101041AKASH PRABHU 101048PUNITLOHANI 101032
Initgraph()
The initgraph function that will intialize the graphics mode on the computer. Initigraph has the following prototype.
Initgraph initializes the graphics system by loading a graphics driver from disk (or validating a registered
driver) then putting the system in to graphics mode.Initgraph also resets all graphics settings (color, palette,
current position, viewport, etc.) to their defaults, then resets graphresult to 0.
*graphdriver Integer that specifies the graphics driver to
be used. You can give graphdriver a value using a constant of the graphics_drivers enumeration type.
Graphicsdriver
*graphmode Integer that specifies the initial graphics
mode (unless *graphdriver = DETECT). If *graphdriver = DETECT, initgraph sets *graphmode to the highest resolution available for the detected driver. You can give *graphmode a value using a constant of the graphics_modes enumeration type.
Graphmode
*pathtdriver Specifies the directory path where initgraph
looks for graphics drivers (*.BGI) first.
Pathdriver
line function is used to draw a line from a point(x1,y1) to point(x2,y2) i.e. (x1,y1) and (x2,y2) are end points of the line.
Declaration :- void line(int x1, int y1, int x2, int y2);
Setcolor function is used to change the current drawing color.e.g. setcolor(RED) or setcolor(4) changes the current drawing color to RED.
Default drawing color is white. Total 16 colors are available.
setcolor
Void * malloc(size_t bytes) Allocates a block of size bytes of memory
returning a pointer to the beginning of the block.
The contents of the newly allocated block is not initialized remaining with indeterminate values.
Parameter-size of the memory block in bytes
malloc
getimage function saves a bit image of specified region into memory, region can be any rectangle.
Declaration:- void getimage(int left, int top, int right, int bottom, void *bitmap);
getimage copies an image from screen to memory. Left, top, right, and bottom define the area of the screen from which the rectangle is to be copied, bitmap points to the area in memory where the bit image is stored.
getimage
putimage function outputs a bit image onto the screen. Declaration:- void putimage(int left, int top, void *ptr,
int op); putimage puts the bit image previously saved with
getimage back onto the screen, with the upper left corner of the image placed at (left, top). ptr points to the area in memory where the source image is stored. The op argument specifies a operator that controls how the color for each destination pixel on screen is computed, based on pixel already on screen and the corresponding source pixel in memory.
For eg-if the operator is XOR_PUT then the pixel is XORed with the pixel already present on the screen.
putimage
kbhit function is used to determine if a key has been pressed or not.
To use kbhit function in your program you should include the header file "conio.h".
If a key has been pressed then it returns a non zero value otherwise returns zero.
Declaration : int kbhit();
kbhit
delay function is used to suspend execution of a program for a particular time.
Here unsigned int is the number of milliseconds (1 second = 1000 milliseconds ).
To use delay function in your program you should include the dos.h header file.
Declaration :- void delay(unsigned int);
delay
Sound function produces the sound of a specified frequency. Used for adding music to c program.
Declaration:- void sound(unsigned frequency);
sound
nosound function turn off the PC speaker. Declaration : void nosound();
nosound
Pointers point to location within the memory.
Pointer declaration- <variable_type>*<name> The keyword new is used to initialize
pointers with memory from free store (a section of memory available to all programs.
Syntax-int *ptr=new int; The & operator is used to assign the
address of a variable to a pointer.
Pointers
This project has been implemented in C++ C++ has an easy to use and easy to modify
code. This project can also be implemented with
various levels. We can also add some balloons which may
decrement your points.
Scope of this project
The speed of arrows can also be increased. We can also multiply the number of
balloons.
Scope of this project