I'm making a breakout game because I decided it's about time I made a complete game (besides pong!).
I'm not getting very far

I have a bat and ball and it works ok but if the ball is hit into the corners it gets "stuck" behind the screen boundaries; how do I solve this?
I don't know how I'm going to store the positions of all the bricks for each level.
I've set up a little collision effect thing for reflecting the ball's angle so that should work ok with the bricks too.
When the ball hits the bat I want the angle reflection to alter depending on where on the bat the ball hits, I can't work this out
remstart
BREAKOUT
-------------
* player bar
* ball
* bricks for collision
* sides and top of screen collisions
* power-ups
remend
`setup
hide mouse
sync on : sync rate 0
`make 8 colours
dim colour(8)
red=0 : orange=1 : yellow=2 : green=3 : cyan=4 : blue=5 : indigo=6 : violet=7 : white=8
colour(0)=rgb(255,0,0)
colour(1)=rgb(255,128,0)
colour(2)=rgb(255,255,0)
colour(3)=rgb(0,255,0)
colour(4)=rgb(0,255,255)
colour(5)=rgb(0,0,255)
colour(6)=rgb(128,0,255)
colour(7)=rgb(255,0,255)
colour(8)=rgb(255,255,255)
`title format
set text size 40
set text font "impact"
set text to italic
`print title
for c = 0 to 7
for sh = 7 to 0 step -1
ink colour(sh),0
a$=mid$("BREAKOUT",c+1)
text 210+c*28+sh,150+sh,a$
next sh
next c
`User prompt
repeat
c#=c#+.025 : if c#>7 then c#=0
s=wrapvalue(s+1)
set text size sin(s)*4.+20
ink colour(c#),0
center text 320,240,"Press Any Key To Begin"
sync
ink 0,0
box 170,238,480,280
until scancode()>0
`-------------------------------
` Initialisation
`-------------------------------
sl=9 : sr=630 : st=9
batx=320 : baty=400 : batr#=20
ballx#=315 : bally#=390 : ballr#=4 : balla#=225 : ballv#=0
sync rate 60
`-------------------------------
` Main Loop
`-------------------------------
DO
`* INPUT
batx=mousex()
if mouseclick() and ballv#=0 then ballv#=6
`* PROCESS
`bind bat
if batx<10+batr# then batx=10+batr#
if batx>630-batr# then batx=630-batr#
`move ball
ballx# = ballx#+sin(balla#)*ballv#
bally# = bally#+cos(balla#)*ballv#
`check ball collision
coll=0
`screen
if ballx#-ballr#<=sl or ballx#+ballr#>=sr then coll=1 : ang=360 : `left and right
if bally#-ballr#<=st or bally#+ballr#>=470 then coll=1 : ang=180 : `top
`bat
if bally#+ballr#+ballv#>=baty and bally#+ballr#<baty and abs(batx-ballx#)<batr#+ballr# then coll=1 : ang=180
`reflect ball angle
if coll then balla#=wrapvalue(ang-balla#)
`* OUTPUT
ink colour(white),0
box batx-batr#,baty,batx+batr#,410 : `bat
circle ballx#,bally#,ballr# : `ball
sync
cls
LOOP
END
`Round up
FUNCTION @Round(n#)
dec# = n# - int(n#)
n = n# + dec#
ENDFUNCTION n
Thanks in advance
"You must be someone's friend to make comments about them." - MySpace lied.
