heres some more code .....
Code:
int setpix(int color, int x,int y)
{
union REGS regs;
regs.h.ah = 0x0C; /* pixel plot */
regs.h.al = color;
regs.x.cx = x; /* x location 0..319 */
regs.x.dx = y; /* y location 0..199 */
int86(0x10, ®s, ®s);
return 0;
}
int paddle(int color,int x,int y)
{
int i;
for(i=0;i<40;i++){
x+=1;
setpix(color,x,y);
}
return 0;
}
int main()
{
int i;
int x=140,y=199;
paddle(15,x,y);
do{
/*to move the paddle tothe left*/
if(getch()=='q'){
do{
x=x-4;
paddle(15,x,y); /*paddle white color middle screen*/
delay(50);
paddle(0,x,y); /*paddle blackcolor (else theres a line instead of justthe paddle*/
}
while(getch()=='q');
}
}
while(getch()!='b'); /*press Btoexitthe app*/
settext();
return 0;
}
I hope ive cleared things out a bit for now if there are anymore questions about the code just ask..<
::edit:: sry bout the wrong indentations (got mixed up while copying pieces of the code)