SCREEN 640, 480, 16, cbfullscreen 'näytön koko
ClsColor cbyellow 'näytön väri
box1width=(5) 'boxi1
box1heidht=(5)
box2width=(5) 'boxi2
box2height=(5)
box3width=(5) 'boxi3
box3height=(5)
box4width=(5) 'boxi4
box4height=(5)
box5width=(5) ' boxi5
box5height=(5)
radius6=(15) 'ylemmän hahmon ympyrä
box8width=(10) 'boxi8
box8height=(10)
radius7= (15) 'alemman hahmon ympyrä
box12width=(630)
box12height=(10)
box13width=(10)
box13height=(470)
box14width=(10)
box14height=(470)
box15width=(630)
box15height=(10)
x=487: y=430 'boxien (ympyröiden) aloitus kordinaatit
x2=482: y2=425
x3=482: y3=435
x4=492: y4=435
x5=492: y5=425
x6=474: y6=431
x8=50: y8=50
x7=40: y7=54
x12=5: y12=5
x13=5: y13=5
x14=625: y14=5
x15=5: y15=465
Repeat 'pääsilmukan alku
Locate 320,240: Color cbred
If BoxOverlap (x,y,box1width,box1height,x8,y8,box8width,box8height) Then Print "Kiinni": WaitKey: End 'Törmäys komennot
Locate 320,240: Color cbred
If BoxOverlap (x2,y2,box2width,box2height,x8,y8,box8width,box8height) Then Print "Kiinni": WaitKey: End
Locate 320,240: Color cbred
If BoxOverlap (x3,y3,box3width,box3height,x8,y8,box8width,box8height) Then Print "Kiinni": WaitKey:End
Locate 320,240: Color cbred
If BoxOverlap (x4,y4,box4width,box4height,x8,y8,box8width,box8height) Then Print "Kiinni": WaitKey: End
Locate 320,240: Color cbred
If BoxOverlap (x5,y5,box5width,box5height,x8,y8,box8width,box8height) Then Print "kiinni": WaitKey: End
Locate 320,240: Color cbred
If BoxOverlap (x,y,box1width,box1height,x12,y12,box12width,box12height) Then Print "Punainen pelaaja törmäsi seinään": WaitKey: End
Locate 320,240: Color cbred
If BoxOverlap (x,y,box1width,box1height,x13,y13,box13width,box13height) Then Print "Punainen pelaaja törmäsi seinään": WaitKey: End
Locate 320,240: Color cbred
If BoxOverlap (x,y,box1width,box1height,x14,y14,box14width,box14height) Then Print "Punainen pelaaja törmäsi seinään": WaitKey: End
Locate 320,240: Color cbred
If BoxOverlap (x,y,box1width,box1height,x15,y15,box15width,box15height) Then Print "Punainen pelaaja törmäsi seinään": WaitKey: End
Locate 320,240: Color cbred
If BoxOverlap (x8,y8,box8width,box8height,x12,y12,box112width,box12height) Then Print "Vihreä pelaaja törmäsi seinään": WaitKey: End
Locate 320,240: Color cbred
If BoxOverlap (x8,y8,box8width,box8height,x13,y13,box13width,box13height) Then Print "Vihreä pelaaja törmäsi seinään": WaitKey: End
Locate 320,240: Color cbred
If BoxOverlap (x8,y8,box8width,box8height,x14,y14,box14width,box14height) Then Print "Vihreä pelaaja törmäsi seinään": WaitKey: End
Locate 320,240: Color cbred
If BoxOverlap (x8,y8,box8width,box8height,x15,y15,box15width,box15height) Then Print "Vihreä pelaaja törmäsi seinään": WaitKey: End
If KeyDown (cbkeyO) Then ClsColor cbblue 'kun painetaan O niin näytön väri muuttuu
If KeyUp (cbkeyO) Then ClsColor cbyellow
If LeftKey()Then x=x-2:x2=x2-2:x3=x3-2:x4=x4-2:x5=x5-2:x6=x6-2 'ohjaus punainen hahmo
If RightKey () Then x=x+2:x2=x2+2:x3=x3+2:x4=x4+2:x5=x5+2:x6=x6+2
If UpKey () Then y=y-2:y2=y2-2:y3=y3-2:y4=y4-2:y5=y5-2:y6=y6-2
If DownKey () Then y=y+2:y2=y2+2:y3=y3+2:y4=y4+2:y5=y5+2:y6=y6+2
If KeyDown(cbKeyA) Then x8=x8-2:x7=x7-2 'ohjaus vihreä hahmo
If KeyDown(cbKeyD) Then x8=x8+2:x7=x7+2
If KeyDown(cbKeyW) Then y8=y8-2:y7=y7-2
If KeyDown(cbKeyS) Then y8=y8+2:y7=y7+2
Color cbred
Box x,y, box1width, box1heidht, OFF 'Punaisen hahmon osat
Color cbred
Box x2,y2,box2width,box2height,ON
Color cbred
Box x3,y3,box2width,box2height,ON
Color cbred
Box x4,y4,box2width,box2height,ON
Color cbred
Box x5,y5,box2width,box2height,ON
Color cbred
Circle x6-radius1,y6-radius6,radius6*2,OFF
Color cbBlack
Box x12,y12, box12width, box12height, ON ' kentän rajat piirto
Color cbBlack
Box x13,y13, box13width, box13height, ON
Color cbBlack
Box x14,y14, box14width, box14height, ON
Color cbBlack
Box x15,y15, box15width, box15height, ON
Color cbgreen
Circle x7-radius1,y7-radius7,radius7*2,OFF 'vihreän hahmon osat
Color cbgreen
Box x8,y8,box8width, box8height, ON
Color cbwhite 'ylä teksti
Text 100,3,"JahtausPeli vihreä pelaaja koittaa saada punaisen pelaajan kiinni"
DrawScreen ' piirtää näytön
Until EscapeKey ()'kun painetaan esc nii peli loppuuAihe on jo aika vanha, joten et voi enää vastata siihen.