Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

lol gamedev

Name: Anonymous 2007-09-20 8:08 ID:ZhhHGPCH

spot the error


    // Object-to-object, reduced bounding-box collision detector:
    short int Sprite_Collide(sprite_ptr object1, sprite_ptr object2) {
     
        int left1, left2;
        int right1, right2;
        int top1, top2;
        int bottom1, bottom2;

        left1 = object1->x + object1->col_x_offset;
        left2 = object2->x + object2->col_x_offset;
        right1 = left1 + object1->col_width;
        right2 = left2 + object2->col_width;
        top1 = object1->y + object1->col_y_offset;
        top2 = object2->y + object1->col_y_offset;
        bottom1 = top1 + object1->col_height;
        bottom2 = top2 + object2->col_height;

        if (bottom1 < top2) return(0);
        if (top1 > bottom2) return(0);
     
        if (right1 < left2) return(0);
        if (left1 > right2) return(0);

        return(1);

    };

Name: Anonymous 2007-09-21 17:18 ID:UZaw9GJ7

>>25
And what of it? They aren't funny in most cases.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List