rem Breakit
rem 
rem A game by Marc Gale (Xalthorn)

gosub initialise

label main
 gosub title
 gosub game
goto main

rem ##########################################
label title
 setdispbuf cb
 setdrawbuf cb
 clear window
 r2=255:g2=255:b2=255

 t$="Breakit - Copyright (c) 2002 Marc Gale (Xalthorn)"
 r1=150:g1=0:b1=0:x=50:y=50:gosub ttext

 t$="____________________________________________________"
 r1=0:g1=150:b1=0:x=50:y=56:gosub ttext

 t$="A familiar game utilising bricks, a bat, and balls."
 r1=0:g1=0:b1=150:x=50:y=100:gosub ttext

 t$="For those that don't know the game, you control a"
 y=140:gosub ttext
 t$="bat using the left and right directions."
 y=160:gosub ttext

 t$="At the start of the game you will have a silver ball"
 y=200:gosub ttext
 t$="resting on your bat.  You release the ball with the"
 y=220:gosub ttext
 t$="cross button."
 y=240:gosub ttext

 t$="You start the game with three balls, and lose one"
 y=280:gosub ttext
 t$="each time it falls off the bottom of the screen. You"
 y=300:gosub ttext
 t$="get an extra ball at every 10,000 points."
 y=320:gosub ttext

 t$="Sometimes when you clear a brick, it will drop a"
 y=360:gosub ttext
 t$="random bonus.  Some bonuses are good, others bad."
 y=380:gosub ttext

 t$="Press X to continue"
 r1=100:g1=100:b1=0:x=200:y=480:gosub ttext

 repeat joy=peek("port1") until (joy=0)
 repeat joy=peek("port1") until (joy=16384)
return

rem ##########################################
label game
 sc$="0" : hi$=sc$
 gosub setupscreen

 for a=1 to maxballs
  ballx(a)=-100
  bally(a)=-100
  oballx(a)=-100
  obally(a)=-100
 next a

 batw=20
 lives=3
 score=0
 nextlife=10000
 level=1
 gosub setuplevel
 gosub leveltitle

 repeat
  gosub drawlives
  gosub startlife
  dir=1
  sticky=0
  bonust=0
  repeat
   setdispbuf cb : cb=1-cb : setdrawbuf cb
   gosub undrawballs
   gosub undrawbat
   gosub redraws
   gosub processinput
   gosub sanitychecks
   gosub drawsides
   gosub drawbonus
   gosub drawballs
   gosub drawbat
   gosub drawstatus
   gosub levelcheck
  until (numballs<1)
  lives=lives-1
  for a=1 to 2
   gosub flipscreen
   gosub undrawbonus
  next a
 until (lives=0)

 r1=150:g1=150:b1=150
 r2=0:g2=0:b2=200
 t$="GAME OVER"
 x=200:y=400
 for z=1 to 2
  gosub flipscreen
  gosub ttext
 next z

 repeat joy=peek("port1") until (joy=0)
 repeat joy=peek("port1") until (joy>0)
return

rem ##########################################
label flipscreen
 setdispbuf cb
 cb=1-cb
 setdrawbuf cb
return

rem ##########################################
label drawsides
  setrgb 1,0,0,100
  setrgb 2,0,0,100
  setrgb 3,100,100,255

' bars
  gtriangle 0,20 to 0,512 to 10,512
  gtriangle 20,20 to 20,512 to 10,512
  gtriangle 480,20 to 480,512 to 490,512
  gtriangle 500,20 to 500,512 to 490,512
  setrgb 2,100,100,255
  gtriangle 0,20 to 10,20 to 10,512
  gtriangle 20,20 to 10,20 to 10,512
  gtriangle 480,20 to 490,20 to 490,512
  gtriangle 500,20 to 490,20 to 490,512
return

rem ##########################################
label levelcheck
 if bricks>0 return

 level=level+1
 if level>numlevels level=1
 gosub leveltitle

 for z=1 to 2
  gosub flipscreen
  clear fill rect 21,21 to 479,512
 next z

 for a=1 to 3
  if balls(a)=2 balls(a)=1
  oballx(a)=-200
  ballx(a)=-200
 next a

 bonust=0
 gosub setuplevel
return

rem ##########################################
label setuplevel
 bricks=0
 for x=1 to 22
  for y=1 to 35
   map(x,y)=levels(level,x,y)
   if map(x,y)>0 and map(x,y)<13 bricks=bricks+1
  next y
 next x

 for z=1 to 2
  gosub flipscreen
  for by=1 to 35
   for bx=1 to 22
    gosub drawblock
   next bx
  next by
 next z
return

rem ##########################################
label bonus
 if bonust>0 return
 bonust=int(ran(numbonus)+1)
 bonusx=x*20+10:bonusy=y*10+20
 br=bonusr(bonust)
 bg=bonusg(bonust)
 bb=bonusb(bonust)
 b$=bonust$(bonust)
return

rem ##########################################
label givebonus
 if bonust=1 gosub addball
 if bonust=2 batwt=min(batwt+8,150)
 if bonust=3 batwt=max(batwt-8,20)
 if bonust=4 sticky=1
 if bonust=5 dir=-dir
return

rem ##########################################
label undrawbonus
 if bonust=0 return 
 tx=bonusx
 ty=bonusy-10
 xx=int((tx)/20)
 yy=int((ty)/10)

 setrgb 1,0,0,0
 fill rect bonusx-2,bonusy-2 to bonusx+21,bonusy+14
 for bx=xx-1 to xx+1
  for by=yy-1 to yy+1
   if bx>0 and bx<23 and by>0 and by<36 then
    gosub drawblock
   fi
  next by
 next bx
return

rem ##########################################
label drawbonus
 if bonust=0 return

 if bonusy>baty+12 or bonusy+12<baty goto nobonusyet
  if bonusx>batx+batw or bonusx+20<batx goto nobonusyet
   gosub givebonus
   bonust=0
   return
 label nobonusyet

 gosub undrawbonus

 setrgb 1,br,bg,bb
 fill rect bonusx,bonusy to bonusx+19,bonusy+12
 bonusy=bonusy+1
 if bonusy>512 bonust=0
 setrgb 1,255,255,255
 text bonusx+4,bonusy+8,b$
return

rem ##########################################
label startlife
 baty=480:bats=6:batwt=40
 for a=1 to maxballs
  balls(a)=0
 next a
 gosub addball
return

rem ##########################################
label addball
 f=0
 for nb=1 to maxballs
  if balls(nb)=0 f=nb
 next nb

 if f=0 return

 balls(f)=1
 ballpos(f)=(batwt/2)+int(ran(7))-3
 numballs=numballs+1
 released=25
return

rem ##########################################
label redraws
 bx=tidyx:by=tidyy
 gosub drawblock
 setdrawbuf 1-cb
 gosub drawblock
 setdrawbuf cb
 tidyx=tidyx+1
 if tidyx<23 return
 tidyx=1
 tidyy=tidyy+1
 if tidyy=36 tidyy=1
return

rem ##########################################
label drawstatus
 if hic=0 goto scoredraw
 clear fill rectangle 510,40 to 627,60
 setrgb 1,255,255,255
 text 620,55,hi$,"rb"
 hic=hic-1
 label scoredraw
 if scc=0 goto donescore
 clear fill rectangle 510,100 to 627,120
 setrgb 1,255,255,255
 text 620,115,sc$,"rb"
 scc=scc-1
 label donescore
return

rem ##########################################
label drawlives
 dlives=min(lives,31)
 for z=0 to 1
  setdrawbuf z
  clear fill rectangle 510,160 to 627,256
  setrgb 1,255,255,255
  setrgb 2,0,0,0
  setrgb 3,0,0,0
  x=520
  y=170:st=30:r=8
  ro=int((dlives-1)/6)
  c=mod(dlives-1,6)
  for a=1 to ro
   for b=1 to 6
    gosub drawsphere
    x=x+19
   next b
   x=x-114
   y=y+19
  next a

  for a=1 to c
   gosub drawsphere
   x=x+20
  next a
 next z
return

rem ##########################################
label sanitychecks
 if released>0 released=released-1
 if gamepaused>0 gamepaused=gamepaused-1

 if score>hiscore then
  hiscore=score
  hi$=sc$
  hic=2
 fi

 if score>=nextlife then
  nextlife=nextlife+10000
  lives=lives+1
  for z=1 to 2
   gosub drawlives
  next z
 fi

 if batw<batwt batw=batw+1
 if batw>batwt batw=batw-1

 batx=min(batx,480-batw)
 batx=max(batx,20)

 for a=1 to maxballs
  ballx=ballx(a)
  bally=bally(a)
  balls=balls(a)
  ballxv=ballxv(a)
  ballyv=ballyv(a)

  if balls=0 goto skipball

  oballx=ballx
  obally=bally
  ballx=ballx+ballxv
  bally=bally+ballyv
  if ballx+ballxv<30 then
   ballxv=-ballxv
   ballx=30
  fi
  if ballx+ballxv>470 then
   ballxv=-ballxv
   ballx=470
  fi
  if bally+ballyv-8<20 then
   ballyv=-ballyv
  else
   if ballyv>0 and bally+ballyv+8>baty and bally+ballyv+8<baty+10 then
    if ballx>batx-8 and ballx<batx+batw+8 then
     if sticky=1 balls=1
     ballpos(a)=ballx-batx
     ballyv=-ballyv
     xc=batw/2
     xd=ballx-batx
     if xd<xc then
      ch=xc-xd
      ballxv=ballxv-ch/10
     else
      ch=xd-xc
      ballxv=ballxv+ch/10
     fi
    fi
   fi
  fi

  if bally>520 then 
   balls(a)=0
   oballx(a)=-100
   obally(a)=-100
   bally(a)=-100
   numballs=numballs-1
   goto skipball
  fi

  if balls=1 then
   ballx=batx+ballpos(a)
   bally=baty-8
  fi

  gosub checkcollision

  ballx(a)=ballx
  bally(a)=bally
  balls(a)=balls
  ballxv(a)=ballxv
  ballyv(a)=ballyv
  oballx(a)=oballx
  obally(a)=obally
label skipball
 next a
return

rem ##########################################
label collide
 if x<1 or x>22 or y<1 or y>35 return
 if map(x,y)=0 return

   hit=1
   if map(x,y)<13 then
    if mod(map(x,y),2)=0 then
     map(x,y)=map(x,y)-1
     bx=x:by=y
     gosub drawblock
     setdrawbuf 1-cb
     gosub drawblock
     setdrawbuf cb
     score=score+10
     sc$=str$(score)
     scc=2
    else
     if int(ran(10))=1 gosub bonus
     map(x,y)=0
     bricks=bricks-1
     bx=x:by=y
     gosub undrawblock
     score=score+10
     scc=2
     sc$=str$(score)
    fi                 : rem end of mod
   else
    bx=x:by=y
    gosub drawblock    : rem redraw solid block
   fi                  : rem end of <13
return

rem ##########################################
label checkcollision
 tx=ballx-10+ballxv
 ty=bally-20+ballyv
 tty=0:ttx=0
 x1=int((tx)/20)
 x2=int((tx-8)/20)
 x3=int((tx+8)/20)
 x4=int((tx-4)/20)
 x5=int((tx+4)/20)
 y1=int((ty-8)/10)
 y2=int((ty+8)/10)
 y3=int((ty)/10)
 y4=int((ty-4)/10)
 y5=int((ty+4)/10)

' above
 hit=0 : x=x1 : y=y1 : gosub collide : if hit=1 tty=1

' below
 hit=0 : x=x1 : y=y2 : gosub collide : if hit=1 tty=1

' left
 hit=0 : x=x2 : y=y3 : gosub collide : if hit=1 ttx=1

' right
 hit=0 : x=x3 : y=y3 : gosub collide : if hit=1 ttx=1

' top left
 hit=0 : x=x4 : y=y4 : gosub collide
 if hit=1 then
  ttx=1:tty=1
 fi

' top right
 hit=0 : x=x5 : y=y4 : gosub collide
 if hit=1 then
  ttx=1:tty=1
 fi

' bottom left
 hit=0 : x=x4 : y=y5 : gosub collide
 if hit=1 then
  ttx=1:tty=1
 fi

' bottom right
 hit=0 : x=x5 : y=y5 : gosub collide
 if hit=1 then
  ttx=1:tty=1
 fi

 if ttx=1 then
  ballxc=ballxv/20
  ballxv=ballxv-(ran(10)-5)*ballxc
  ballxv=-ballxv
 fi
 if tty=1 then
  ballyv=-ballyv
 fi
return

rem ##########################################
label processinput
 joy=peek("port1")
 if and(joy,128)>0 batx=batx-(bats*dir)
 if and(joy,32)>0 batx=batx+(bats*dir)
 if and(joy,16384)>0 gosub releaseball
 if and(joy,8)>0 and gamepaused=0 gosub gamepause
 if joy=20224 bricks=0
return

rem ##########################################
label gamepause
 r1=0:g1=0:b1=0
 r2=150:g2=150:b2=200
 t$="PAUSED"
 x=200:y=506
 for z=1 to 2
  gosub flipscreen
  gosub ttext
 next z
 gamepaused=20

 repeat joy=peek("port1") until (and(joy,8)=0)
 repeat joy=peek("port1") until (and(joy,8)>0)
return

rem ##########################################
label releaseball
 for a=1 to maxballs
  if balls(a)=1 and released=0 then
   ballxv(a)=(ballpos(a)-(batw/2))/4
   ballyv(a)=-ballspeed
   balls(a)=2
   released=25
  fi
 next a
return

rem ##########################################
label ttext
 setrgb 1,r1,g1,b1
 for yy=y-1 to y+1
  for xx=x-1 to x+1
   text xx,yy,t$
  next xx
 next yy
 setrgb 1,r2,g2,b2
 text x,y,t$
return

rem ##########################################
label pbox
 setrgb 1,r1,g1,b1
 for yy=y-2 to y+2
  for xx=x-2 to x+2
   line xx,yy to xx+w1,yy : line to xx+w1,yy+h1
   line to xx+w2,yy+h1    : line to xx+w2,yy+h2
   line to xx,yy+h2       : line to xx,yy 
  next xx
 next yy

 setrgb 1,r2,g2,b2
 line x,y to x+w1,y : line to x+w1,y+h1
 line to x+w2,y+h1  : line to x+w2,y+h2
 line to x,y+h2     : line to x,y 
return

rem ##########################################
label setupscreen
 for a=1 to 2
  setdispbuf cb : cb=1-cb : setdrawbuf cb
  clear window

' right hand information column
  setrgb 1,50,50,150
  fill rectangle 500,0 to 640,512

' High Score Display Area
  x=505:y=20:w1=112:w2=127:h1=15:h2=45
  r1=0:g1=0:b1=0
  r2=200:g2=200:b2=255
  gosub pbox
  t$="High Score"
  x=510:y=35
  r1=0:g1=0:b1=0
  r2=255:g2=255:b2=255
  gosub ttext

' Score Display Area
  x=505:y=80:w1=65:w2=127:h1=15:h2=45
  r1=0:g1=0:b1=0
  r2=200:g2=200:b2=255
  gosub pbox
  t$="Score"
  x=510:y=95
  r1=0:g1=0:b1=0
  r2=255:g2=255:b2=255
  gosub ttext

' Lives Display Area
  x=505:y=140:w1=65:w2=127:h1=15:h2=120
  r1=0:g1=0:b1=0
  r2=200:g2=200:b2=255
  gosub pbox
  t$="Lives"
  x=510:y=155
  r1=0:g1=0:b1=0
  r2=255:g2=255:b2=255
  gosub ttext

  setrgb 1,0,0,100
  setrgb 2,0,0,100
  setrgb 3,100,100,255

' left corner box
  gtriangle 0,0 to 20,0 to 10,10
  gtriangle 0,0 to 0,20 to 10,10
  gtriangle 0,20 to 20,20 to 10,10
  gtriangle 20,0 to 20,20 to 10,10
' right corner box
  gtriangle 480,0 to 500,0 to 490,10
  gtriangle 480,0 to 480,20 to 490,10
  gtriangle 480,20 to 500,20 to 490,10
  gtriangle 500,0 to 500,20 to 490,10

' bars
  gtriangle 0,20 to 0,512 to 10,512
  gtriangle 20,20 to 20,512 to 10,512
  gtriangle 480,20 to 480,512 to 490,512
  gtriangle 500,20 to 500,512 to 490,512
  gtriangle 20,0 to 480,0 to 480,10
  gtriangle 20,20 to 480,20 to 480,10
  setrgb 2,100,100,255
  gtriangle 0,20 to 10,20 to 10,512
  gtriangle 20,20 to 10,20 to 10,512
  gtriangle 480,20 to 490,20 to 490,512
  gtriangle 500,20 to 490,20 to 490,512
  gtriangle 20,0 to 20,10 to 480,10
  gtriangle 20,20 to 20,10 to 480,10

  hic=1:scc=1:gosub drawstatus
 next a
return

rem ##########################################
label leveltitle
  for a=0 to 1
    setdrawbuf a

    setrgb 1,0,0,100
    setrgb 2,0,0,100
    setrgb 3,100,100,255

    gtriangle 20,0 to 480,0 to 480,10
    gtriangle 20,20 to 480,20 to 480,10
    setrgb 2,100,100,255
    gtriangle 20,0 to 20,10 to 480,10
    gtriangle 20,20 to 20,10 to 480,10

    r1=0:g1=0:b1=0
    r2=255:g2=255:b2=255
    t$=leveln$(level)
    x=250-(len(t$)*10)/2:y=12:gosub ttext
  next a
return

rem ##########################################
label drawblock
 if map(bx,by)=0 return
 x=bx*20+10:y=by*10+20
 brick=map(bx,by)
 r=brickcol(brick,1)
 g=brickcol(brick,2)
 b=brickcol(brick,3)
 setrgb 1,r,g,b
 fill rectangle x,y to x+18,y+8
 setrgb 1,r*1.5,g*1.5,b*1.5
 line x,y to x+18,y
 line to x+18,y+8
 setrgb 1,r*0.5,g*0.5,b*0.5
 line x,y to x,y+8
 line to x+18,y+8
 setrgb 1,255,255,255
 fill rectangle x+16,y+1 to x+17,y+2
return

rem ##########################################
label undrawblock
 x=bx*20+10:y=by*10+20
 setrgb 1,0,0,0
 fill rectangle  x,y to x+19,y+10
 setdrawbuf 1-cb
 fill rectangle  x,y to x+19,y+10
 setdrawbuf cb
return

rem ##########################################
label drawballs
 setrgb 2,0,0,0
 setrgb 3,0,0,0
 for a=1 to maxballs
  if balls(a)>0 then
   x=ballx(a):y=bally(a)
   setrgb 1,255,255,255
   gosub drawsphere
  fi
 next a
return

rem ##########################################
label undrawballs
 for a=1 to 3
  if balls(a)>0 then
   x=oballx(a):y=obally(a)
   setrgb 1,0,0,0
   gosub drawsphere
  fi
 next a
return

rem ##########################################
label drawbat
 setrgb 1,0,0,255
 fill rectangle batx,baty to batx+batw,baty+12
 setrgb 1,0,0,0
 fill rectangle batx,baty to batx+1,baty+1
 fill rectangle batx+batw-1,baty to batx+batw,baty+1
 fill rectangle batx,baty+11 to batx+1,baty+12
 fill rectangle batx+batw-1,baty+11 to batx+batw,baty+12
 setrgb 1,200,200,255
 line batx+2,baty+1 to batx+batw-3,baty+1
 line batx+batw-2,baty+3 to batx+batw-2,baty+10
return

rem ##########################################
label undrawbat
 setrgb 1,100,0,0
 setrgb 2,100,0,0
 setrgb 3,0,0,0
 gtriangle 20,512 to 480,512 to 480,450
 setrgb 2,0,0,0
 gtriangle 20,512 to 20,450 to 480,450
return

rem ##########################################
label drawsphere
 ang=0
 repeat
  xo1=bcos(ang):yo1=bsin(ang)
  xo2=bcos(ang+30):yo2=bsin(ang+30)
  gtriangle x,y to x+xo1,y+yo1 to x+xo2,y+yo2
  gtriangle x,y to x-xo1,y+yo1 to x-xo2,y+yo2
  gtriangle x,y to x-xo1,y-yo1 to x-xo2,y-yo2
  gtriangle x,y to x+xo1,y-yo1 to x+xo2,y-yo2
  ang=ang+30
 until (ang>90)
return

rem ##########################################
label initialise
 open window 640,512
 dim map(22,35)

 restore levels
 read numlevels
 dim levels(numlevels,22,35)
 dim levelt(numlevels)
 dim leveln$(numlevels)
 for a=1 to numlevels
  read levelt(a)
  read leveln$(a)
  x=1:y=1
  repeat
   read b,c
   if b>-1 then
    for d=1 to c
     levels(a,x,y)=b
     if levelt(a)=1 then
      x=x+1
      if x=23 then
       x=1
       y=y+1
      fi
     else
      y=y+1
      if y=36 then
       y=1
       x=x+1
      fi
     fi
    next d
   fi
  until (b=-1)
 next a

 dim cosines(360),sines(360),bcos(360),bsin(360)
 for a=0 to 360
  cosines(a)=cos(a*(pi/180))
  sines(a)=sin(a*(pi/180))
  bcos(a)=cosines(a)*8
  bsin(a)=sines(a)*8
 next a

 numbricks=13
 dim brickcol(numbricks,3)
 restore brickcolours
 for a=1 to numbricks
  read brickcol(a,1),brickcol(a,2),brickcol(a,3)
 next a

 batx=200:baty=480:batw=40:bats=6
 maxballs=3
 dim ballx(maxballs),bally(maxballs),balls(maxballs)
 dim ballxv(maxballs),ballyv(maxballs),ballpos(maxballs)
 dim oballx(maxballs),obally(maxballs),ballheld(maxballs)
 rem balls=status
 rem     0=inactive
 rem     1=on bat
 rem     2=active

 tidyy=1:tidyy=1
 ballspeed=3

 restore bonuses
 read numbonus
 dim bonusr(numbonus),bonusg(numbonus),bonusb(numbonus)
 dim bonust$(numbonus)
 for a=1 to numbonus
  read bonust$(a),bonusr(a),bonusg(a),bonusb(a)
 next a
return

label brickcolours
data 100,0,0,200,0,0,100,100,0,200,200,0,0,100,0,0,200,0
data 0,0,100,0,0,200,100,0,100,200,0,200,0,100,100
data 0,200,200,100,100,100

label bonuses
' how many bonus types
data 5
' extra ball
data "B",100,100,100
' wider bat
data "W",100,100,200
' narrow bat
data "N",50,150,50
' sticky bat
data "S",150,50,50
' reverse bat
data "R",100,100,0

label levels
' levels are 22 bricks wide, 35 bricks tall
' levels are coded using Run Length Encoding (RLE).
'
' Basically, this is a series of value pairs.  The first
' value being the brick code, and the second value being
' the amount of bricks in that run.
'
' The level is terminated with a -1,-1 value pair.
' Each level is designed with the brick runs going
' horizontally (type 1) or vertically (type 2).

' The bricks are coded as follows:
'  0=No brick
'  1=dark red
'  2=bright red
'  3=dark yellow
'  4=bright yellow
'  5=dark green
'  6=bright green
'  7=dark blue
'  8=bright blue
'  9=dark purple
' 10=bright purple
' 11=dark cyan
' 12=bright cyan
' 13=solid block

' how many levels
data 10

data 1
data "PS2 Logo"
data 0,198,10,6,0,4,10,4,0,1,10,6,0,1,10,6,0,4,10,4,0,1
data 10,6,0,6,10,1,0,4,10,1,0,9,10,1,0,6,10,1,0,4,10,1,0
data 9,10,1,0,6,9,1,0,4,9,1,0,9,9,1,0,6,9,1,0,4,9,1,0,9
data 9,1,0,1,9,6,0,4,9,1,0,4,9,6,0,1,7,6,0,4,7,1,0,4,7,6
data 0,1,7,1,0,9,7,1,0,4,7,1,0,6,7,1,0,9,7,1,0,4,7,1,0,6
data 8,1,0,9,8,1,0,4,8,1,0,6,8,1,0,9,8,1,0,4,8,1,0,6,8,1
data 0,6,8,4,0,4,8,6,0,1,8,1,0,6,8,4,0,4,8,6,-1,-1

data 2
data "Pong"
data 3,36,0,33,3,2,0,21,8,5,0,7,3,2,0,1,4,4,0,28,3,2,0,1
data 4,1,0,2,4,1,0,28,3,2,0,1,4,4,0,28,3,2,0,33,3,2,0,33
data 3,2,0,33,3,2,0,33,3,37,0,33,3,2,0,33,3,2,0,14,2,2
data 0,17,3,2,0,1,4,1,0,2,4,1,0,9,2,2,0,17,3,2,0,1,4,4
data 0,28,3,2,0,4,4,1,0,28,3,2,0,33,3,2,0,33,3,2,0,10,8,5
data 0,18,3,2,0,33,3,36,-1,-1

data 1
data "Two Rings"
data 0,48,1,14,0,8,1,14,0,8,1,14,0,8,1,2,0,10,1,2,0,8,1,2
data 0,10,1,2,0,8,1,2,0,10,1,2,0,8,1,2,0,2,3,6,0,2,1,2,0,8
data 1,2,0,2,3,6,0,2,1,2,0,8,1,2,0,2,3,6,0,2,1,2,0,8,1,2
data 0,2,3,2,0,2,3,2,0,2,1,2,0,8,1,2,0,2,3,2,0,2,3,2,0,2
data 1,2,0,8,1,2,0,2,3,2,0,2,3,2,0,2,1,2,0,8,1,2,0,2,3,6
data 0,2,1,2,0,8,1,2,0,2,3,6,0,2,1,2,0,8,1,2,0,2,3,6,0,2
data 1,2,0,8,1,2,0,10,1,2,0,8,1,2,0,10,1,2,0,8,1,2,0,10
data 1,2,0,8,1,14,0,8,1,14,0,8,1,14,-1,-1

data 1
data "Platformer"
data 0,142,3,2,0,20,3,1,7,1,3,1,0,19,3,3,0,19,3,2,0,19,5,3
data 0,18,5,1,0,1,5,2,0,18,3,1,0,1,5,3,3,1,0,18,1,2,0,11
data 6,5,0,3,1,3,0,5,6,5,0,1,5,5,0,2,7,1,0,2,1,1,0,5,5,5
data 0,1,1,5,0,2,7,2,0,1,7,2,0,4,1,5,0,1,1,5,0,2,6,5,0,4,1
data 5,0,8,5,5,0,17,1,5,0,17,1,5,-1,-1

data 1
data "Horizontal Bars"
data 0,44,1,66,0,44,3,66,0,44,5,66,0,44,7,66,0,44,9,66
data 0,44,11,66,-1,-1

data 2
data "Dragon"
data 0,46,5,5,0,32,5,4,0,26,1,2,0,4,5,3,0,6,5,5,0,14,1,4
data 0,3,5,6,0,2,5,8,0,12,1,2,0,1,1,2,0,4,5,4,0,1,5,4,0,3
data 5,2,0,12,1,2,0,1,1,3,0,3,5,8,0,5,1,1,0,12,1,2,0,1,1,2
data 0,1,1,1,0,1,5,13,0,15,1,2,0,1,1,1,0,1,1,1,0,1,5,15
data 0,14,1,3,0,1,1,2,5,4,3,2,5,3,0,3,5,3,0,9,5,3,0,4,1,2
data 0,1,1,2,5,3,3,4,0,5,5,2,0,9,5,5,0,3,5,1,1,3,5,2,3,4
data 0,7,1,1,0,10,5,8,1,2,5,3,3,3,0,20,5,14,0,20,5,2,3,2
data 5,4,0,4,5,4,0,19,5,2,3,1,0,1,5,6,0,3,5,4,0,18,5,7,1,1
data 5,2,0,4,5,4,1,1,0,18,5,4,0,1,1,1,5,2,0,6,1,2,0,20
data 5,3,0,1,1,1,5,1,0,30,5,2,0,1,1,1,-1,-1

data 2
data "Vertical Bars"
data 1,70,0,70,3,70,0,70,5,70,0,70,7,70,0,70,9,70,0,70
data 11,70,-1,-1

data 2
data "House"
data 0,23,11,3,5,5,0,27,11,3,5,5,0,18,9,1,0,7,12,4,5,5
data 0,14,1,3,9,2,1,11,5,5,0,14,1,2,9,3,1,2,11,3,1,2,11
data 3,1,1,5,5,0,15,9,4,1,2,11,3,1,2,11,3,1,1,5,5,0,14,9
data 5,1,2,11,3,1,2,11,3,1,1,5,5,0,13,9,6,1,11,5,5,0,14
data 9,5,1,2,11,3,1,2,7,4,5,5,0,15,9,4,1,2,11,3,1,2,7,4
data 5,5,0,4,4,1,0,11,9,3,1,2,11,3,1,6,5,5,0,4,4,1,0,3,4,1
data 0,8,9,2,1,11,5,5,0,4,4,1,0,3,4,1,0,9,9,1,0,7,12,4,5
data 5,0,7,4,1,0,4,4,1,0,14,11,3,5,5,0,11,4,1,0,15,11,3,5
data 5,0,4,4,2,0,4,4,1,0,4,4,1,0,10,12,4,5,5,0,4,3,2,4,2,0
data 5,4,2,0,12,11,3,5,5,0,4,3,4,4,1,0,3,4,1,0,14,11,3,5,5
data 0,4,3,5,4,1,0,6,4,2,0,8,12,4,5,5,0,4,3,5,4,1,0,3,4,3
data 0,11,11,3,5,5,0,4,3,6,4,1,0,16,11,3,5,5,0,4,3,6,4,1
data 0,3,4,5,0,7,12,4,5,5,-1,-1

data 1
data "Barrier Bars"
data 1,88,2,22,0,44,3,88,4,22,0,44,5,88,6,22,0,44,7,88
data 8,22,0,44,9,88,10,22,-1,-1

data 1
data "Two Pots"
data 0,110,13,1,1,3,13,1,0,12,13,1,5,3,13,1,13,1,1,3,13,1
data 0,12,13,1,5,3,13,1,13,1,1,3,13,1,0,12,13,1,5,3,13,6
data 0,12,13,5,0,44,2,22,4,22,6,22,8,22,10,22,12,22,0,66
data 1,22,3,22,5,22,7,22,9,22,11,22,-1,-1






