hey BN2, after further inspection of ur comment, i realized that u did give me the code i need, so i put it into my game. It works better, although still not perfect, so once again, I am asking for you to debug. Tnx 4 all ur help
sync on : hide mouse
dim brickhp(40)
dim bricklocations(40,2)
for x=1 to 10
brickhp(x)=1
next x
brick=1
for y = 100 to 200 step 100
for x = 1 to 5
bricklocations(brick,1) = 75+(51*x)
bricklocations(brick,2) = y
inc brick
next x
next y
gosub make_images
plyrx=320 : x#=1 : lives = 3
sprite 1,plyrx,450,4 : offset sprite 1,(sprite width(1)/2),(sprite height(1)/2)
sprite 2,plyrx,435,5 : offset sprite 2,(sprite width(2)/2),(sprite height(2)/2)
for x = 3 to 12
sprite x,bricklocations(x-2,1),bricklocations(x-2,2),brickhp(x)
offset sprite x,(sprite width(x)/2),(sprite height(x)/2)
next x
do
cls
sprite 1,plyrx,450,4
gosub check4coll
for x=3 to 12
delete sprite x
next x
sprite 2,ballx,bally,5
for x = 3 to 12
if brickhp(x)>0 then sprite x,bricklocations(x-2,1),bricklocations(x-2,2),brickhp(x)
next x
if leftkey()=1 then dec plyrx,5
if rightkey()=1 then inc plyrx,5
if plyrx<35 then inc plyrx,5
if plyrx>615 then dec plyrx,5
if spacekey()=1 and ballinmotion=0 then ballinmotion=1 : y=1
if ballinmotion=1
if x#=1 : inc ballx,3 : else : dec ballx,3 : endif
if y#=1 : inc bally,3 : else : dec bally,3 : endif
else
y#=0
ballx=plyrx
bally=435
inc bally,3
endif
for x = 1 to lives
circle 550+(25*x),440,10
next x
if lives = 0 then end
sync
loop
make_images:
ink rgb(250,0,0),1
box 1,1,51,21
get image 1,0,0,51,21
cls
ink rgb(0,250,0),1
box 1,1,51,21
get image 2,0,0,51,21
cls
ink rgb(0,0,250),1
box 1,1,51,21
get image 3,0,0,51,21
cls
ink rgb(250,250,250),1
box 1,1,41,11
get image 4,0,0,41,11
cls
circle 5,5,5
get image 5,0,0,11,11
cls
return
check4coll:
for brick= 3 to 12
if sprite collision(2,brick)>0
brickhp(brick)=brickhp(brick)-1
angle=acos(ballx/35)
if angle<45 or angle>315 then x#=1
if angle>45 and angle<135 then y#=0
if angle>135 and angle<225 then x#=0
if angle>225 and angle<315 then y#=1
endif
next brick
if sprite collision(2,1)>0 then y#=0 : dec bally,3
if sprite x(2)<10 then inc ballx,3 : x#=1
if sprite x(2)>630 then dec ballx,3 : x#=0
if sprite y(2)<10 then inc bally,3 : y#=1
if sprite y(2)>470 then ballinmotion=0 : y#=0 : dec lives : ballx=plyrx : bally=435
return
[Edit]
This is the new code for it, ill quit messing with it for a while to give u some time to work, again tnx a bunch!
sync on : hide mouse
dim brickhp(40)
dim bricklocations(40,2)
for x=1 to 10
brickhp(x)=1
next x
brick=2
for y = 100 to 200 step 100
for x = 1 to 5
inc brick
bricklocations(brick,1) = 75+(51*x)
bricklocations(brick,2) = y
next x
next y
gosub make_images
plyrx=320 : x#=1 : lives = 3
sprite 1,plyrx,450,4 : offset sprite 1,(sprite width(1)/2),(sprite height(1)/2)
sprite 2,plyrx,435,5 : offset sprite 2,(sprite width(2)/2),(sprite height(2)/2)
for x = 3 to 12
sprite x,bricklocations(x-2,1),bricklocations(x-2,2),brickhp(x)
offset sprite x,(sprite width(x)/2),(sprite height(x)/2)
next x
numofbrick=3
repeat
inc numofbrick
until bricklocations(numofbrick,1)=0
do
cls
sprite 1,plyrx,450,4
gosub check4coll
for x=3 to 12
delete sprite x
next x
sprite 2,ballx,bally,5
for x = 3 to numofbrick-1
if brickhp(x)>0 then sprite x,bricklocations(x,1),bricklocations(x,2),brickhp(x)
next x
if leftkey()=1 then dec plyrx,5
if rightkey()=1 then inc plyrx,5
if plyrx<35 then inc plyrx,5
if plyrx>615 then dec plyrx,5
if spacekey()=1 and ballinmotion=0 then ballinmotion=1 : y=1
if ballinmotion=1
if x#=1 : inc ballx,3 : else : dec ballx,3 : endif
if y#=1 : inc bally,3 : else : dec bally,3 : endif
else
y#=0
ballx=plyrx
bally=435
inc bally,3
endif
for x = 1 to lives
circle 550+(25*x),440,10
next x
if lives = 0 then end
sync
loop
make_images:
ink rgb(250,0,0),1
box 1,1,51,21
get image 1,0,0,51,21
cls
ink rgb(0,250,0),1
box 1,1,51,21
get image 2,0,0,51,21
cls
ink rgb(0,0,250),1
box 1,1,51,21
get image 3,0,0,51,21
cls
ink rgb(250,250,250),1
box 1,1,41,11
get image 4,0,0,41,11
cls
circle 5,5,5
get image 5,0,0,11,11
cls
return
check4coll:
for brick= 3 to numofbrick-1
if sprite collision(2,brick)>0
brickhp(brick)=brickhp(brick)-1
angle=acos((ballx-bricklocations(brick,1))/35)
if angle<45 or angle>315 then x#=1
if angle>45 and angle<135 then y#=0
if angle>135 and angle<225 then x#=0
if angle>225 and angle<315 then y#=1
endif
next brick
if sprite collision(2,1)>0 then y#=0 : dec bally,3
if sprite x(2)<10 then inc ballx,3 : x#=1
if sprite x(2)>630 then dec ballx,3 : x#=0
if sprite y(2)<10 then inc bally,3 : y#=1
if sprite y(2)>470 then ballinmotion=0 : y#=0 : dec lives : ballx=plyrx : bally=435
return