DIM stat$(3)
stat$(1)="Intelligence"
stat$(2)="Strength"
stat$(3)="Speed"
DIM stat(3)
stat(1)=58
stat(2)=96
stat(3)=74
 
`save cpu having to calculate rgb every loop
white=rgb(255,255,255)
red=rgb(255,0,0)
 
`set initial cursor point
place=1
 
gosub make_bar_image
 
sync on
 
`-------------------------
` MAIN LOOP
`-------------------------
DO
   `#Input
   if upkey()=1 then dec place,1
   if downkey()=1 then inc place,1
   if upkey()+downkey()>0 then repeat : until upkey()+downkey()=0 : `single press only
   if place<1 then place=3
   if place>3 then place=1
   rem using arrays makes stats easy to adjust
   if rightkey()=1 then stat(place)=stat(place)+1
   if leftkey()=1 then stat(place)=stat(place)-1
   if stat(place)<0 then stat(place)=0
   if stat(place)>100 then stat(place)=100
 
   `#Display
   for n = 1 to 3
     `set colours depending on whether the stat is selected
     if n=place
       ink red,0 : i=2
     else
       ink white,0 : i=1
     endif
     `draw to screen
     text 50,100+n*20,stat$(n)
     sprite n,150,105+n*20,i
     stretch sprite n,100*stat(n),100
   next n
 
   `update screen and then clear for next loop
   sync:cls
LOOP
 
END
`---------------------------
` GOSUBS
`---------------------------
make_bar_image:
   FOR i= 1 to 2
      `draw 1% image
      ink rgb(75+i*90,0,0),0 : `base colour
      line 0,0,0,6
      ink rgb(31+i*80,0,0),0 : `shade level 1
      dot 0,5
      ink rgb(8+i*60,0,0),0 : `shade level 2
      dot 0,6
      ink rgb(255,255,255),0 : `shine
      dot 0,1
      `grab the image
      get image i,0,0,1,7
   NEXT i
RETURN