Chimpunk Aquarius

Simulate Mattel Aquarius in Chipmunk BASIC
cb_GraphicDrawtextChars.png

Download: ChimpunkAquarius.zip
cb_GraphicDrawtextChars.bas
NOTE: Install included font "AQUASevenfiveeight"

90 if done = true then end : REM Prevent double run
99 cls :REM BASIC CLEAR SCREEN
100 print "ChipmunkBASIC Graphic Drawtext"
200 print "Install font AQUASevenfiveeight.ttf"
300 fontURL$="http://aquarius.residenteasel.com/fonts/Aqua758.zip"
400 AQUAFONT$ = "AQUASevenfiveeight"
500 print "fontURL$="+fontURL$
600 crd=true : REM Color randomizing

1000  REM TEST VERSION TO SKIP GRAPHICS
1100 version=instr(fn version$(),"MacOSX")


50000 REM SIMPLE TERMINAL ASCII DRAW
50100 out$ = "" : y = 20 :x=10
51000 for i = 1 to 255
52000 out$ =chr$(i)
52100 if i = 7 then out$ = chr$(32)
53000  print out$;
54000 c=c+1: if c > 39 then print
55000 if c > 39 then c = 0
56000 next i
60000 if version = 0 then end


110000 REM Chipmunk Basic Graphics
111000 b$ = "" : a$ = "" : y = 40 :x=40
112000 fontN = macfunction("GetFNum",AQUAFONT$)
113000 graphics TEXTSETUP fontN,30,1
120000 graphics MOVETO 20,20
130000 graphics WINDOW   600, 40, ((256*33)/18), ((256/23)*40)
140000 graphics COLOR  0,90,90      
150000 graphics FILLRECT 1, 1, (80*32), (72*32) ,1
160000 graphics PENSETUP  8, 8 , 11, 1

200000 REM LOOP THROUGH ASCII CODES
210000 for i = 0 to 255
220000 a$ =chr$(i)
230000 x=x+24 : if x > 420 then y = y+24
240000 if x >  420 then x =10
241000 if crd <> false then gosub 800000 :REM Skip randoming
242000 gosub 760000 : REM Check vals
243000 graphics COLOR  red,green,blue
250000 graphics MOVETO x,y
260000 graphics DRAWTEXT a$
270000 MOVETO x,y
290000 next i


310000 y=y+10: graphics MOVETO 20,Y
311000 graphics TEXTSETUP fontN,10,1
311100 graphics COLOR  0,0,0        
320000 y=y+11: graphics MOVETO 20,Y:graphics DRAWTEXT "SPC = EXIT"
321000 y=y+11: graphics MOVETO 20,Y:graphics DRAWTEXT "R,G,B = add 10 to color"
322000 y=y+11: graphics MOVETO 20,Y:graphics DRAWTEXT "F= Toggle Random Cycle"
323000 y=y+11: graphics MOVETO 20,Y:graphics DRAWTEXT "Click Mouse To Cycle Colors"
330000 graphics 0
 
350000 REM END GRAPHICS WINDOW DRAW

400000 REM check keyboard and
411000 i$=inkey$
412000 if i$ ="" then goto 820000 : REM LOOP BACK TO GRAPHICS DRAWTEXT

413000 REM FUN Random  colors
413100 if i$ ="f" then gosub 850000

420000 REM modify colors with R,G,B keys
421000 if i$="r" then red=red+10
422000 if i$="g" then green=green+10
423000 if i$="b" then blue=blue+10

440000 REM EXIT PROGRAM ON SPACEBAR
451000 if i$=" " then goto 900000

600000 REM cycle drawing graphics
610000 goto  110000  
750000 end :REM EXIT PROGRAM


754000 REM ###########################################
754100 REM #  CHIPMUNK DRAWTEXT PROGRAM SUBROUTINES  #
454200 REM ###########################################


760000 REM   FIX RGB VALS
761000 if red>100 then red = 0
762000 if green>100 then green = 0
763000 if blue>100 then blue = 0
780000 return
789999 REM *****************************************

800000 REM   Color randomize
810000 red=red+((40*rnd(1)+1)-1)
811000  green=green+((40*rnd(1)+1)-1)
812000  blue=blue+((40*rnd(1)+1)-1)  
813000 return :end
814000  REM *****************************************

820000 REM check fun
821000 if crd = false then goto 110000
822000 if mouse(0) = 1 then goto 110000
823000 if crd = true then goto 411000
824000 end
825000 REM *****************************************

850000 REM   Change Color random bool
851000 chkcrd = crd
852000 if chkcrd = false then crd = true
853000 if chkcrd = true  then crd = false
855000 return :end
899000 REM *****************************************


900000 REM END PROGRAM
910000 graphics 0
920000 done = true
930000  print chr$(10)+">exit ok"
999990  end
999998 REM *****************************************