All pastes #333541 Raw Edit

Stuff

public text v1 · immutable
#333541 ·published 2007-01-30 23:34 UTC
rendered paste body
    switch (direction) {
        case SPRITE_LEFT:
            // collision detection
            for (i = y; i <= y2; i++) {
                for (j = 1; j <= SPRITE_SPEED; j++) {
                    if (board[x - j][i] == BOARD_WALL) {
                        collision = true;
                        break;
                    }
                }
            }
            if (!collision) {
                x = x - SPRITE_SPEED;
                x2 = x2 - SPRITE_SPEED;
            }
            break;