
-----------------------------------
Coult.49
Tue Jun 03, 2014 7:50 am

Need Help With My Brick Breaker Turing Game
-----------------------------------
What is it you are trying to achieve?
i am trying to make it so when the ball hits red bricks they disappear 


What is the problem you are having?
when the ball hits the red bricks they do not disapear and everything still stays the same


Describe what you have tried to solve this problem
i have tried to implement a collision detection between the red bricks and the ball 


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)




var x, y : int
var x1, y1 : int
var move : string (1)
var isball : boolean := false
var numball : int := 0
var yball : int := 1
var col, row : int := 0
var bricklist : array 1 .. 5, 1 .. 9 of int
const movement := 22
const dist := 5
var xx := 100
var yy := 15
x := 200
y := 0
x1 := 310
y1 := 20
var ballx, bally, xmod, ymod : int := 200
xmod := 1
ymod := 1
var drawx : int := 10
var drawy : int := 363


for a : 1 .. 5
    for b : 1 .. 9
        bricklist (a, b) := 1
    end for
end for




loop


    drawx := 10
    drawy := 363
    for a : 1 .. 5
        for b : 1 .. 9
            if bricklist (a, b) = 1 then
                drawfillbox (drawx, drawy, drawx + 60, drawy + 17, red)
                drawx := drawx + 70
            end if
        end for
        drawx := 10
        drawy := drawy - 30
    end for

    if hasch then
        getch (move); %Get Input
        if move = chr (203) and x > 5 then
            drawfillbox (x, y, x1, y1, 0)
            x := x - 7
            x1 := x1 - 7
        elsif move = chr (205) and x < 520 then
            drawfilloval (x, y, x1, y1, 0)
            x := x + 7
            x1 := x1 + 7
        end if
    end if
    ballx += xmod
    bally += ymod
    if ballx + 10 >= maxx then
        xmod := -1
    elsif ballx - 10 = maxy then
        ymod := -1
    elsif bally - 10 = maxy then
        ymod := -1
    elsif bally - 10 = 10 and ballx = 80 and ballx 