Mail Archives: djgpp/2000/08/03/01:35:09
In comp.os.msdos.djgpp, on Wed, 2 Aug 2000 19:27:24 -0500,
"23yrold3yrold" <cbarry AT pangea DOT ca> wrote:
>
> >Hullo. I would like a little help with something. I've written a simple
> >collision-detection program, but I need a little clarification with
> >something:
> >
> >
> >for(int a = 1; a <= pptest_w; a++){
> > for(int b = 1; b <= pptest_h; b++){
> > pixelcheck = getpixel(pptest_1a, a, b);
> > if(pixelcheck <= 0){
> > }else if(pixelcheck != 0){
> > pixelcheck = getpixel(pptest_2a, a, b);
> > if(pixelcheck <= 0){
> > }else if(pixelcheck != 0){
> > collide = 1;
> > break;
> > }
> > }
> > }
> >}
> >
> >FUNKtion();
how about
collide=0
for(int a = 1; a <= pptest_w && !collide; a++){
for(int b = 1; b <= pptest_h && !collide; b++){
pixelcheck = getpixel(pptest_1a, a, b);
if(pixelcheck <= 0){
}else if(pixelcheck != 0){
pixelcheck = getpixel(pptest_2a, a, b);
if(pixelcheck <= 0){
}else if(pixelcheck != 0){
collide = 1;
}
}
}
}
- Raw text -