remstart
Line-Roller by Master Xilo (Hurricane-Eye Entertainment)
http://www.freewebs.com/hurricane-eyeentertainment/index.htm
 
CONTROLS:
- press space-button to start
- press return to "pay" 1 point (score) to reload the level (if not yet started)
- click and hold the mouse button to draw lines
 
Try to get the amount of yellow boxes needed as "target" by drawing lines on wich the ball rolls. 
The end point of a line must be more down and right than the startpoint.
You loose if the ball falls / rolls out of the screen.
 
 
remend
 
``Setup
set display mode 640,480,32
 
Sync on:sync rate 60 
set window off
autocam off
position camera 0,0,0
point camera 0,0,1
set camera fov 45
randomize timer()
ink 0,0
 
 
``Make textures
make memblock 1,12+256*256*4
write memblock dword 1,0,256
write memblock dword 1,4,256
write memblock dword 1,8,32
for y=0 to 255
    for x=0 to 255
        write memblock dword 1,12+(x+y*256)*4,rgb(x,y,255-y)
    next x
next y
make image from memblock 5,1:delete memblock 1
make memblock 1,12+256*256*4
write memblock dword 1,0,256
write memblock dword 1,4,256
write memblock dword 1,8,32
for y=0 to 255
    for x=0 to 255
        write memblock dword 1,12+(x+y*256)*4,rgb(255-y,x,y)
    next x
next y
make image from memblock 6,1:delete memblock 1
make memblock 1,12+256*256*4
write memblock dword 1,0,256
write memblock dword 1,4,256
write memblock dword 1,8,32
for y=0 to 255
    for x=0 to 255
        write memblock dword 1,12+(x+y*256)*4,rgb(x,255-y,y)
    next x
next y
make image from memblock 7,1:delete memblock 1
 
make memblock 1,12+6*1*4
write memblock dword 1,0,6
write memblock dword 1,4,1
write memblock dword 1,8,32
write memblock dword 1,12+4*0,rgb(255, 0, 0)
write memblock dword 1,12+4*1,rgb(255, 128, 0)
write memblock dword 1,12+4*2,rgb(255, 255, 0)
write memblock dword 1,12+4*3,rgb(0, 255, 0)
write memblock dword 1,12+4*4,rgb(0, 0, 255)
write memblock dword 1,12+4*5,rgb(128, 0, 128)
make image from memblock 4,1:delete memblock 1
 
make memblock 1,12+1*1*4
write memblock dword 1,0,1
write memblock dword 1,4,1
write memblock dword 1,8,32
write memblock dword 1,12,rgb(255, 255, 0)
make image from memblock 3,1:delete memblock 1
 
make memblock 1,12+1*1*4
write memblock dword 1,0,1
write memblock dword 1,4,1
write memblock dword 1,8,32
write memblock dword 1,12,rgb(1, 1, 1)
make image from memblock 2,1:delete memblock 1
 
 
``Main Player Sphere
make object sphere 1,15
position object 1,-320,240,580
texture object 1,4
 
make object sphere 3,15
scale object 3,-110,-110,-110
glue object to limb 3,1,0
set object light 3,0
texture object 3,2
 
``Background
backdrop off
Make object plain 2,680,500
position object 2,0,0,600
texture object 2,5
set object light 2,0
set object transparency 2,4:set alpha mapping on 2,40
 
 
 
dim lines(1000,3) as integer
currentline=0
score=0
target=1
current=0
speed#=0
 
gosub SETUPLevel
 
do
 
 
    if started
 
 
    if mouseclick()
        if click=0
            lines(currentline,0)=mousex()
            lines(currentline,1)=mousey()
        endif
        click=1
        lines(currentline,2)=mousex()
        lines(currentline,3)=mousey()
    else
        if click=1 then click=0:if ((lines(i,0)>lines(i,2) or lines(i,1)>lines(i,3))=0) then inc currentline
    endif
 
    for i=0 to currentline-1*(click=0)
        ink 0,0
        if (lines(i,0)>lines(i,2) or lines(i,1)>lines(i,3)) then ink rgb(255,0,0),0
        line lines(i,0),lines(i,1),lines(i,2),lines(i,3)
    next i
 
    for i=100 to 100+target*2
        if object exist (i) then yrotate object i,object angle y(i)+5
    next i
 
    col=OBJECT COLLISION(1,0)
    if col>=100
        delete object col:inc current
    endif
 
 
    position object 1,object position x(1)+1,object position y(1)-speed#,object position z(1)
    zrotate object 1,object angle z(1)-8
    speed#=speed#+0.1
 
    pointcol1=POINT(object position x(1)+321,480-(object position y(1)+240)+5)
    pointcol2=POINT(object position x(1)+321,480-(object position y(1)+240)+6)
    pointcol3=POINT(object position x(1)+321,480-(object position y(1)+240)+7)
    pointcol4=POINT(object position x(1)+321,480-(object position y(1)+240)+8)
    pointcol=(pointcol1=0 or pointcol2=0 or pointcol3=0 or pointcol4=0)
 
    if pointcol
        x=object position x(1)+321
        y=480-(object position y(1)+240)+8
        repeat 
            x=x+1
        until POINT(x,y)>=0 and POINT(x,y-1)>=0 and POINT(x,y-2)>=0 and POINT(x,y-3)>=0
        diff=x-(object position x(1)+321)
        position object 1,object position x(1)+diff,object position y(1),object position z(1)
 
        speed#=-(0.5-diff/20.0)
        if speed<=0 then speed#=0.1
    endif
 
 
 
    if current>=target
        score=score+current
        inc target
        current=0
        started=0
        currentline=0
        click=0
        position object 1,-320,240,580
        gosub SETUPLevel
        speed#=0
    endif
 
    if object position y(1)<-240 or object position x(1)>320
        target=1
        lastscore=score
        score=0
        current=0
        started=0
        gameover=1:
        currentline=0
        click=0
        position object 1,-320,240,580
        gosub SETUPLevel
        speed#=0
    endif
 
    endif
 
    if returnkey() and started=0
        if key=0
        score=score-1
        current=0
        started=0
        currentline=0
        click=0
        position object 1,-320,240,580
        gosub SETUPLevel
        speed#=0
        endif
        key=1
    else 
        key=0
    endif
 
    ink 0,0
    set cursor 32,32:Print "FPS: ";screen fps();" Score: ";score;" Target: ";current;" / ";target
    if spacekey() then started=1:gameover=0
    if started=0 then text 260,220,"Press space to start"
    if gameover then text 280,240,"GAME OVER! Last Score: "+str$(lastscore)
 
    sync
loop
 
SETUPLevel:
    posx=32
    posy=32
 
    delete objects 100,10000
 
 
    for i=100 to 100+target*2
        if object exist (i) then delete object i
        make object cube i,20
 
        position object i,-320+rnd(620),240-rnd(480),580
        posx=posx+rnd(620)/target
        posy=posy+rnd(460)/target
        texture object i,3
    next i
    texture object 2,5+rnd(2)
return