So i got this far, with my game
rem blokken
load image "blok.bmp",1
rem balleke
load image "bal.bmp",2
rem paddle
load image "palett.bmp",3
rem images for border
ink rgb(250,250,250),0
box 1,20,637,22
get image 4,1,20,637,22
box 637,20,639,477
get image 5,637,20,639,477
box 1,477,639,479
get image 6,1,477,639,479
box 1,20,3,477
get image 7,1,20,3,477
cls
load sound "pottery.wav",1
rem load sound "liedje.mp3",2
rem set sound volume 2,70
rem load animation "failed.avi",1
hide mouse
if (blokken(t)=1)
sprite t,30+t*55,30,1
endif
sprite 9,ballx,bally,2
set sprite 2,0,1
sprite 10,playerx,playery,3
sprite 11,1,20,4
sprite 12,637,20,5
sprite 13,1,477,6
sprite 14,1,20,7
rem player vars
playerx=280
playery=440
rem ball vars
ballx=320
bally=240
balla=180
balls=4
rem extra vars
randomize timer()
aantal=8
levens=3
wachten=0
links=0
rechts=0
boven=0
rem array for blocks
dim blokken(8)
for t=1 to 8
blokken(t)=1
next t
SET TEXT OPAQUE
TEXT 310,1, "Lives"
sync rate 60
rem loop sound 2
do
rem controls
if leftkey() =1
playerx= playerx-10
endif
if rightkey()=1
playerx=playerx+10
endif
if spacekey()=1
wait key
cls
text 310,1,str$(balla)
text 310,15,str$(playerx-ballx)
wait 1000
wait key
endif
rem paddle niet van het screen af
if playerx <5 then playerx=5
if playerx>535 then playerx=539
rem nieuwe cords voor bal
ballx=newxvalue(ballx,balla,balls)
bally=newzvalue(bally,balla,balls)
rem sprite-int all the images
for t=1 to 8
if blokken(t)=1
sprite t,30+t*55,30,1
endif
next t
sprite 9,ballx,bally,2
sprite 10,playerx,playery,3
rem collision with border
if sprite hit(9,11)
if boven=0
balla=0+(180-balla)
boven=1
endif
else
boven=0
endif
if sprite hit(9,12)
if links=0
balla=360-balla
links=1
endif
else
links=0
endif
rem bottom
if sprite hit(9,13)
levens=levens-1
playerx=300
playery=440
ballx=320
bally=240
balla=180
wachten=1
endif
if sprite hit(9,14)
if rechts=0
rechts=1
balla=360-balla
endif
else
rechts=0
endif
rem collision with paddle
IF SPRITE HIT(9,10) = 1
if playerx-ballx=>-25
balla=360-balla
balla=(180-balla)+(rnd(10)+10)
else
if playerx-ballx<=-75
balla=180-balla-(rnd(10)+10)
else
balla=180-balla
endif
endif
endif
rem collision with blocks
for d=1 to 8
if blokken(d)=1
if sprite hit(d,9)=1
balla=0+(180-balla)
blokken(d)=0
delete sprite d
aantal=aantal-1
play sound 1
endif
endif
next d
fps=screen fps()
TEXT 310,1, "Lives "+str$(levens)+" "+str$(fps)+" "+str$(balla)+" "+str$(playerx-ballx)
rem when live is lost
if wachten=1
delete sprite 9
text 320,240,"3"
wait 1000
text 320,240,"2"
wait 1000
text 320,240,"1"
wait 1000
cls
for t=1 to 8
if (blokken(t)=1)
sprite t,30+t*55,30,1
endif
next t
sprite 9,ballx,bally,2
sprite 10,playerx,playery,3
wachten=0
endif
if aantal=0 then goto eindebl
if levens=0 then goto eindelev
sync
loop
remstart
menuke en levens
links op plalet hoek vernaderen
collision met kader:vastzitten rarely
remend
eindebl:
for t=1 to 14
delete sprite t
next t
cls
TEXT 310,1,"het spel is gedaan, u heeft gewonnen"
wait key
return
eindelev:
for t=1 to 14
delete sprite t
next t
cls
rem play animation 1
text 310,1,"bla"
return
I still got two problems:the second block doesn't get destroyed when the ball hits it. I also still have some problems with the angles: It sometimes goes to a strange angle by just hitting the borders and i don't know why.
So can someone help me or give me some advice?