JavaBASIC
JavaBASIC is a BASIC compiler, written in Java. It compiles its own
version of BASIC into Java classfiles, and includes a special game API.
Although it is simply experimental, potential uses could include the mobile
phone game market which has extreme growth right now.
JavaBASIC is a demonstration of the CSG Bytecode package, and is based
loosely on the exciting educational/hobby work being done at
www.xgamestation.com.
Here's a code sample (from etc/SystemPalette.jbas):
'-----------------------------------------------------------------------------
' Draw the System Color Palette
'
' We have 256 colors, and a 320x240 display resolution. We want to draw each
' color in a solid box so we can see it. If we make the boxes 16 pixels
' across we can fit 20 boxes on a row, which means we have to fit 12.8 rows
' which would be about 208 pixels, so there's room for that.
'-----------------------------------------------------------------------------
const int BOX_SIZE = 16
Display.SetMode (0)
Display.ClearScreen ()
int x = 0, y = 0
for color = 0 to 255
Display.DrawRect (x, y, x + BOX_SIZE - 1, y + BOX_SIZE - 1, 1, color)
x = x + BOX_SIZE
if x >= 320 then x = 0: y = y + BOX_SIZE
next
Display.ShowPage ()
' Loop until user presses ESCAPE
do
if Keyboard.WasPressed (Keyboard.VK_ESCAPE) then break
System.Sleep (500)
end
When run this generates the display seen in the top left image of the table below.
Included Demos
Here are some of the demo programs included in the download.
Sample Program Output
|
The "Remtris" port
|
Classic "Pong"
|
3d Spinning Cubes
|
Downloads
|