TGC Codebase Backup



ASCII WIP by MaPo

16th Aug 2008 10:29
Summary

Sandbox, not completed project. ASCII playing here.



Description

Sandbox, not completed project. ASCII playing here. This is me working on the beginings of an ASCII game in the style of Ultima I-V.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    `--------------------------
`set up the screen and font
`--------------------------
set display mode 640,480,32
set text font "terminal",1
set text size 15
`-------------------
`main screen borders
`-------------------
   `--------------------
   `border around screen
   `--------------------
   `--left upper corner
   drawChar(0,0,201,0,0,255)
   `--right upper corner
   drawChar(79,0,187,0,0,255)
   `--left lower corner
   drawChar(0,39,200,0,0,255)
   `--right lower corner
   drawChar(79,39,188,0,0,255)
   `--both horizontal lines
   for i=1 to 78
      text (i*8),(0*12), chr$(205)
      text (i*8),(39*12), chr$(205)
   next i
   `--both vertical lines
   for i=1 to 38
      text (0*8),(i*12), chr$(186)
      text (79*8),(i*12), chr$(186)
   next i
   `----------------------------------
   `divide the screen to roughly 70/30
   `----------------------------------
   `--top "t"
   drawChar(50,0,203,0,0,255)
   `--bottom "t"
   drawChar(50,39,202,0,0,255)
   `--vertical line connecting the "t"s
   for i=1 to 38
      text (50*8),(i*12), chr$(186)
   next i
   `--------------------------
   `divide for upper right box
   `--------------------------
   `--left "t"
   drawChar(50,12,204,0,0,255)
   `--right "t"
   drawChar(79,12,185,0,0,255)
   `--horizontal line connecting the "t"s
   for i=51 to 78
      text (i*8),(12*12), chr$(205)
   next i
   `--------------------------
   `divide for lower right box
   `--------------------------
   `--left "t"
   drawChar(50,16,204,0,0,255)
   `--right "t"
   drawChar(79,16,185,0,0,255)
   `--horizontal line connecting the "t"s
   for i=51 to 78
      text (i*8),(16*12), chr$(205)
   next i

wait key

function drawChar(x as integer,y as integer,char as integer,r as integer,g as integer, b as integer)
   ink rgb (0,0,0),0
   text (x*8),(y*12), chr$(219)
   ink rgb (r, g, b),0
   text (x*8),(y*12), chr$(char)
endfunction

`function drawHLine(x1 as integer,x2 as integer,y as integer, r as integer,g as integer, b as integer)
`   for i=x1 to x2
`      ink rgb (0,0,0),0
`      text
`endfunction