TGC Codebase Backup



Painter by Alex Libby

19th Dec 2009 19:33
Summary

this app. is incomplete but still fun to use.



Description

It has a nice GUI and it's simple to use, please give credit.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    rem Beginning setup.
sync rate 60: WHITE1=RGB(255,255,255)
GRAY1=RGB(128,128,128): GRAY2=RGB(190,190,190)
BLACK1=RGB(0,0,0): BLACK2=RGB(100,150,150)
RED1=RGB(255,0,0): RED2=RGB(255,150,150)
GREEN1=RGB(0,255,0): GREEN2=RGB(150,255,150)
BLUE1=RGB(0,0,255): BLUE2=RGB(150,150,255)
_START: box 0,32,588,480,WHITE1,WHITE1,WHITE1,WHITE1

rem Start main loop
do

rem Getting key input.
 if upkey()=1 then sleep 100: MOVE=-1
 if downkey()=1 then sleep 100: MOVE=1
 DATA1=DATA1+MOVE: MOVE=0

rem Making the color selector.
 ink BLACK1,WHITE1
 box 590,30,640,480,GRAY1,GRAY1,GRAY2,GRAY2
 box 588,30,590,480,BLACK1,BLACK1,BLACK1,BLACK1
 line 590,67,640,67
 box 600,100,630,130,BLACK1,BLACK1,BLACK1,BLACK1
 box 601,101,629,129,BLACK1,BLACK1,BLACK2,BLACK2
 text 603,80,"( )"
 line 590,147,640,147
 box 600,180,630,210,BLACK1,BLACK1,BLACK1,BLACK1
 box 601,181,629,209,RED1,RED1,RED2,RED2
 text 603,160,"( )"
 line 590,227,640,227
 box 600,260,630,290,BLACK1,BLACK1,BLACK1,BLACK1
 box 601,261,629,289,GREEN1,GREEN1,GREEN2,GREEN2
 text 603,240,"( )"
 line 590,307,640,307
 box 600,340,630,370,BLACK1,BLACK1,BLACK1,BLACK1
 box 601,341,629,369,BLUE1,BLUE1,BLUE2,BLUE2
 text 603,320,"( )"
 line 590,387,640,387
 box 600,420,630,450,BLACK1,BLACK1,BLACK1,BLACK1
 box 601,421,629,449,BLACK1,RED1,GREEN1,BLUE1
 text 603,400,"( )"
 line 590,467,640,467
 if DATA1=-1 then DATA1=0
 if DATA1=5 then DATA1=4
 if DATA1=0 then text 611,80,"X": NEW=BLACK1
 if DATA1=1 then text 611,160,"X": NEW=RED1
 if DATA1=2 then text 611,240,"X": NEW=GREEN1
 if DATA1=3 then text 611,320,"X": NEW=BLUE1
 if DATA1=4
   text 611,400,"X":
   RANDOM=rnd(4)
   if RANDOM=1 then NEW=BLACK1
   if RANDOM=2 then NEW=RED1
   if RANDOM=3 then NEW=GREEN1
   if RANDOM=4 then NEW=BLUE1
 endif

rem Getting key input.
 if leftkey()=1 then sleep 100: MOVE=-1
 if rightkey()=1 then sleep 100: MOVE=1
 DATA2=DATA2+MOVE: MOVE=0

rem Making the tool selector.
 box 0,0,590,30,GRAY1,GRAY2,GRAY1,GRAY2
 box 0,30,588,32,BLACK1,BLACK1,BLACK1,BLACK1
 box 590,0,640,30,GRAY1,GRAY2,GRAY2,WHITE1
 line 465,23,590,23
 text 15,7,"| ( )pen | ( )paint | ( )spray | ( )box | ( )eraser |    ABL Paint Game"
 if DATA2=-1 then DATA2=0
 if DATA2=5 then DATA2=4
 if DATA2=0 then text 39,7,"X"
 if DATA2=1 then text 111,7,"X"
 if DATA2=2 then text 199,7,"X"
 if DATA2=3 then text 287,7,"X"
 if DATA2=4 then text 359,7,"X"

rem Recording the mouse movements and clicking.
 X1=mousex(): Y1=mousey()
 if mouseclick()=1
  ink NEW,WHITE1
  if DATA2=0 then line X1,Y1,X2,Y2
  if DATA2=1
   line X1+4,Y1,X2+4,Y2
   line X1+2,Y1,X2+2,Y2
   line X1,Y1+4,X2,Y2+4
   line X1,Y1+2,X2,Y2+2
   line X1,Y1,X2,Y2
   line X1-2,Y1,X2-2,Y2
   line X1-4,Y1,X2-4,Y2
   line X1,Y1-2,X2,Y2-2
   line X1,Y1-4,X2,Y2-4
  endif
  if DATA2=2
   dot X1+rnd(20),Y1+rnd(20)
   dot X1-rnd(20),Y1-rnd(20)
   dot X1-rnd(20),Y1+rnd(20)
   dot X1+rnd(20),Y1-rnd(20)
  endif
  if DATA2=3
   box X1-10,Y1-10,X1+10,Y1+10
   ink WHITE1,BLACK1
  endif
  if DATA2=4
   ink WHITE1,BLACK1
   box X1-15,Y1-15,X1+15,Y1+15
   ink BLACK1,WHITE1
  endif
 endif
 if mouseclick()=2 then goto _START:
 X2=mousex(): Y2=mousey()

rem restart main loop
loop