We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>
+ Link For Assignments, GDBs & Online Quizzes Solution
+ Link For Past Papers, Solved MCQs, Short Notes & More
Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion
How to Add New Discussion in Study Group ? Step By Step Guide Click Here.
Assignment No. 04
CS602: Computer Graphics
Total Marks: 20
Please read the following instructions carefully before submitting assignment:
It should be clear that your assignment will not get any credit if:
The objective of this assignment is to;
This assignment is based on our previous assignments. Please see the given startup code for this assignment (in attached folder Startup_Code) which is same as solution of Assignment No.3 with slight modification. Open Assigment4.dev project file in Dev-C++ and after successful compilation and execution, you will see the output. You can see the code in order to understand how coordinates of the Ball and Bar are modified to introduce motion effect. You can see that the Bar’s movement is controlled via keyboard Left and Right arrow keys.
After understanding it’s working, you need to further modify the code as desired in this assignment.
Your task is to slightly modify the provided code to get desired output as shown in the executable “Desired_Output.exe”. This is more like Arkanoid Game. In start-up code, the Bar is moving but its inactive and you have to make it functional i.e. the Ball shall change its direction after hitting the Bar. Player will lose the game if Ball hits the ground and Game will restart by displaying proper message. Play score shall be displayed in the corner and it gets updated each time the Ball hits the Bar.
Hint: You just need to add few lines of code to control movement of Ball by seeing if it hits or miss the Bar.
You are required to submit your solution through LMS in zip format containing two files.
An MS Word document containing screenshot of your program output/execution and your own Student-ID must be visible in the screenshot.
.+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)
+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)+ Click Here to Search (Looking For something at vustudents.ning.com?) + Click Here To Join (Our facebook study Group)
KOI MUJY GRAPHIC AUR LIB KI FILE DY DE ME NE DEV NEW INSTAL KIYA HE PLZ
sis ye files ap ko chae.............
ahan this game.... we r going now to make it ready ...
any idea from how to control the motion of the ball?
Sir har bari ise type ki he assignment q daty ha
PLEAS UPLOD THE CODE PLEAS
my assignment run like vu output but requirements mein likha hua ha on fail py msg b dy or game restart b ho. wo msg reh gea :( kesy ho ga kia wo java k through aa rha ha msg?
plz hint dain kese collison detect ki
will you help us please ? how to detect the collision with the bar?
ye file kdr kdr paste kerni he plz screen shot dy
#include <windows.h> // WinApi header
void drawBall(int x, int y, int col)
void drawBar(int x, int y)
void outScore(int x, int y, int value)
sprintf(digit_string, "%d", value);
outtextxy(x, y, "Score:");
outtextxy(x+100, y, digit_string);
int x =20;
int y =80;
int color = 0;
bool flag_y=true , flag_x = true;
int new_page, old_page; // declare integer variables representing two graphics pages
x = rand ()% getmaxx();
old_page = getvisualpage( ); // set old_page to the number of the visual page
new_page = abs(old_page-1); // set new_page to the visual page number-1
setactivepage(new_page); // set the active page to the value of the new page
cleardevice( ); // erase the active page
settextstyle(DEFAULT_FONT, HORIZ_DIR, 2);
outtextxy(10, 10, "Welcome to Graphics Programming");
outtextxy(10, 30, "My VU-ID is BC123456789");
//on mouse click ball change its color
// will be implemented.
if (ch==75 && bar_x>5)
if (ch==77 && bar_x < getmaxx()-150)
setvisualpage(new_page); // move the activepage to the visual page
//updaing y cordinates.
if (y <= getmaxy()-20 && flag_y)
flag_y = false;
if (y<= 20+60 && !flag_y)
flag_y = true;
//updateing x cordinates
if (x <= getmaxx()-20 && flag_x)
flag_x = false;
if (x<= 20 && !flag_x)
flag_x = true;
plz check it