Brent_Seraphim - sure here it is
The origional:
cls
sync on : sync rate 100
backdrop on : color backdrop RGB(0,0,0)
newx=rnd(640)
newy=rnd(480)
newx1=rnd(640)
newy1=rnd(480)
newx2=rnd(640)
newy2=rnd(480)
newx3=rnd(640)
newy3=rnd(480)
newx4=rnd(640)
newx4=rnd(480)
xval=rnd(1)
yval=rnd(1)
xval1=rnd(1)
yval1=rnd(1)
xval2=rnd(1)
yval2=rnd(1)
xval3=rnd(1)
yval3=rnd(1)
xval4=rnd(1)
yval4=rnd(1)
movex=2
movey=2
do
if newx>640
xval=0
endif
if newx<0
xval=1
endif
if newy>480
yval=0
endif
if newy<0
yval=1
endif
if xval=1 and yval=1
`circle newx,newy,10
newx=newx+movex
newy=newy+movey
endif
if xval=0 and yval=0
`circle newx,newy,10
newx=newx-movex
newy=newy-movey
endif
if xval=1 and yval=0
`circle newx,newy,10
newx=newx+movex
newy=newy-movey
endif
if xval=0 and yval=1
`circle newx,newy,10
newx=newx-movex
newy=newy+movey
endif
if newx1>640
xval1=0
endif
if newx1<0
xval1=1
endif
if newy1>480
yval1=0
endif
if newy1<0
yval1=1
endif
if xval1=1 and yval1=1
`circle newx1,newy1,10
newx1=newx1+movex
newy1=newy1+movey
endif
if xval1=0 and yval1=0
`circle newx1,newy1,10
newx1=newx1-movex
newy1=newy1-movey
endif
if xval1=1 and yval1=0
`circle newx1,newy1,10
newx1=newx1+movex
newy1=newy1-movey
endif
if xval1=0 and yval1=1
`circle newx1,newy1,10
newx1=newx1-movex
newy1=newy1+movey
endif
if newx2>640
xval2=0
endif
if newx2<0
xval2=1
endif
if newy2>480
yval2=0
endif
if newy2<0
yval2=1
endif
if xval2=1 and yval2=1
`circle newx2,newy2,10
newx2=newx2+movex
newy2=newy2+movey
endif
if xval2=0 and yval2=0
`circle newx2,newy2,10
newx2=newx2-movex
newy2=newy2-movey
endif
if xval2=1 and yval2=0
`circle newx2,newy2,10
newx2=newx2+movex
newy2=newy2-movey
endif
if xval2=0 and yval2=1
`circle newx2,newy2,10
newx2=newx2-movex
newy2=newy2+movey
endif
if newx3>640
xval3=0
endif
if newx3<0
xval3=1
endif
if newy3>480
yval3=0
endif
if newy3<0
yval3=1
endif
if xval3=1 and yval3=1
`circle newx3,newy3,10
newx3=newx3+movex
newy3=newy3+movey
endif
if xval3=0 and yval3=0
`circle newx3,newy3,10
newx3=newx3-movex
newy3=newy3-movey
endif
if xval3=1 and yval3=0
`circle newx3,newy3,10
newx3=newx3+movex
newy3=newy3-movey
endif
if xval3=0 and yval3=1
`circle newx3,newy3,10
newx3=newx3-movex
newy3=newy3+movey
endif
if newx4>640
xval4=0
endif
if newx4<0
xval4=1
endif
if newy4>480
yval4=0
endif
if newy4<0
yval4=1
endif
if xval4=1 and yval4=1
`circle newx4,newy4,10
newx4=newx4+movex
newy4=newy4+movey
endif
if xval4=0 and yval4=0
`circle newx4,newy4,10
newx4=newx4-movex
newy4=newy4-movey
endif
if xval4=1 and yval4=0
`circle newx4,newy4,10
newx4=newx4+movex
newy4=newy4-movey
endif
if xval4=0 and yval4=1
`circle newx4,newy4,10
newx4=newx4-movex
newy4=newy4+movey
endif
line newx,newy,newx1,newy1
line newx1,newy1,newx2,newy2
line newx,newy,newx2,newy2
line newx,newy,newx3,newy3
line newx1,newy1,newx3,newy3
line newx2,newy2,newx3,newy3
line newx4,newy4,newx,newy
line newx4,newy4,newx1,newy1
line newx4,newy4,newx2,newy2
line newx4,newy4,newx3,newy3
remstart
set cursor 0,0
print newx
print newy
print xval
print yval
remend
set cursor 0,0
print "Press up to increase speed"
Print "Press down to decrease speed"
if upkey()=1
movex=movex+1
movey=movey+1
print movex
wait 500
endif
if downkey()=1
movex=movex-1
movey=movey-1
print movex
wait 500
endif
sync
loop
The 'bouncing ball' variation on it
cls
sync on : sync rate 100
backdrop on : color backdrop RGB(0,0,0)
newx=rnd(640)
newy=rnd(480)
newx1=rnd(640)
newy1=rnd(480)
newx2=rnd(640)
newy2=rnd(480)
newx3=rnd(640)
newy3=rnd(480)
newx4=rnd(640)
newx4=rnd(480)
xval=rnd(1)
yval=rnd(1)
xval1=rnd(1)
yval1=rnd(1)
xval2=rnd(1)
yval2=rnd(1)
xval3=rnd(1)
yval3=rnd(1)
xval4=rnd(1)
yval4=rnd(1)
movex=2
movey=2
do
if newx>640
xval=0
endif
if newx<0
xval=1
endif
if newy>480
yval=0
endif
if newy<0
yval=1
endif
if xval=1 and yval=1
circle newx,newy,10
newx=newx+movex
newy=newy+movey
endif
if xval=0 and yval=0
circle newx,newy,10
newx=newx-movex
newy=newy-movey
endif
if xval=1 and yval=0
circle newx,newy,10
newx=newx+movex
newy=newy-movey
endif
if xval=0 and yval=1
circle newx,newy,10
newx=newx-movex
newy=newy+movey
endif
if newx1>640
xval1=0
endif
if newx1<0
xval1=1
endif
if newy1>480
yval1=0
endif
if newy1<0
yval1=1
endif
if xval1=1 and yval1=1
circle newx1,newy1,10
newx1=newx1+movex
newy1=newy1+movey
endif
if xval1=0 and yval1=0
circle newx1,newy1,10
newx1=newx1-movex
newy1=newy1-movey
endif
if xval1=1 and yval1=0
circle newx1,newy1,10
newx1=newx1+movex
newy1=newy1-movey
endif
if xval1=0 and yval1=1
circle newx1,newy1,10
newx1=newx1-movex
newy1=newy1+movey
endif
if newx2>640
xval2=0
endif
if newx2<0
xval2=1
endif
if newy2>480
yval2=0
endif
if newy2<0
yval2=1
endif
if xval2=1 and yval2=1
circle newx2,newy2,10
newx2=newx2+movex
newy2=newy2+movey
endif
if xval2=0 and yval2=0
circle newx2,newy2,10
newx2=newx2-movex
newy2=newy2-movey
endif
if xval2=1 and yval2=0
circle newx2,newy2,10
newx2=newx2+movex
newy2=newy2-movey
endif
if xval2=0 and yval2=1
circle newx2,newy2,10
newx2=newx2-movex
newy2=newy2+movey
endif
if newx3>640
xval3=0
endif
if newx3<0
xval3=1
endif
if newy3>480
yval3=0
endif
if newy3<0
yval3=1
endif
if xval3=1 and yval3=1
circle newx3,newy3,10
newx3=newx3+movex
newy3=newy3+movey
endif
if xval3=0 and yval3=0
circle newx3,newy3,10
newx3=newx3-movex
newy3=newy3-movey
endif
if xval3=1 and yval3=0
circle newx3,newy3,10
newx3=newx3+movex
newy3=newy3-movey
endif
if xval3=0 and yval3=1
circle newx3,newy3,10
newx3=newx3-movex
newy3=newy3+movey
endif
if newx4>640
xval4=0
endif
if newx4<0
xval4=1
endif
if newy4>480
yval4=0
endif
if newy4<0
yval4=1
endif
if xval4=1 and yval4=1
circle newx4,newy4,10
newx4=newx4+movex
newy4=newy4+movey
endif
if xval4=0 and yval4=0
circle newx4,newy4,10
newx4=newx4-movex
newy4=newy4-movey
endif
if xval4=1 and yval4=0
circle newx4,newy4,10
newx4=newx4+movex
newy4=newy4-movey
endif
if xval4=0 and yval4=1
circle newx4,newy4,10
newx4=newx4-movex
newy4=newy4+movey
endif
remstart
set cursor 0,0
print newx
print newy
print xval
print yval
remend
set cursor 0,0
print "Press up to increase speed"
Print "Press down to decrease speed"
if upkey()=1
movex=movex+1
movey=movey+1
print movex
wait 500
endif
if downkey()=1
movex=movex-1
movey=movey-1
print movex
wait 500
endif
sync
loop
And here's a little something that uses the bouncing code
cls
sync on : sync rate 100
backdrop on : color backdrop rgb(0,0,0)
hide mouse
reload:
x=320
newx=x
newy=415
movex=2
movey=2
do
gosub player
gosub ball
gosub collision
set cursor 0,0
print newx
print newy
print xval
print yval
sync
loop
player:
line x+20,430,x-20,430
line x+19,431,x-19,431
line x+18,432,x-18,432
line x+20,30,x-20,30
line x+19,31,x-19,31
line x+18,32,x-18,32
if leftkey()=1 then x=x-5
if rightkey()=1 then x=x+5
return
ball:
if newx>640
xval=0
endif
if newx<0
xval=1
endif
if newy>480
yval=0
endif
if newy<0
yval=1
endif
if xval=1 and yval=1
circle newx,newy,5
newx=newx+movex
newy=newy+movey
endif
if xval=0 and yval=0
circle newx,newy,5
newx=newx-movex
newy=newy-movey
endif
if xval=1 and yval=0
circle newx,newy,5
newx=newx+movex
newy=newy-movey
endif
if xval=0 and yval=1
circle newx,newy,5
newx=newx-movex
newy=newy+movey
endif
return
collision:
if newy=>420 and newx=>x-20 and newx=<x+20
yval=0
endif
if newy=<30 and newx=>x-20 and newx=<x+20
yval=1
endif
if newy=<10 then goto reload
if newy=>450 then goto reload
return
Life is like a hot bath, the longer you're in it, the more wrinkles you get.