moving a line in videomode 320*200
I dont know if this is the right place to ask this question but anyway.
ive got a function called setpix(color,x,y);
this plots one pixel at the x and y co-ordinate with a certain colour
Now the only thing i can come up with to let a line move is this way
this is only a part of the whole coded but i guess you already figured how what im trying to do here
/*wait some millisec*/
Note that this way will only work if the background is also color=0;
Now i just wanna know if this is a "good" way to move something accros the screen or not....
I just know there has to be a better way because now there are small periods where u only see black and no line at all (this is when the loop restarts.....
can somebody help me out cause ive been thinking about this a while and with my little bit of knowledge i was only able to come up with this
IF you ppl need more code to actually see what im trying to say then ill post it (just ask for it).
If you could move this thread to the game board :-)
heres some more code .....
I hope ive cleared things out a bit for now if there are anymore questions about the code just ask..<
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);
int paddle(int color,int x,int y)
/*to move the paddle tothe left*/
paddle(15,x,y); /*paddle white color middle screen*/
paddle(0,x,y); /*paddle blackcolor (else theres a line instead of justthe paddle*/
while(getch()!='b'); /*press Btoexitthe app*/
::edit:: sry bout the wrong indentations (got mixed up while copying pieces of the code)