Blitz BASIC
|
Blitz BASIC is a programming language (BASIC dialect) for the Amiga computer, originally made by Acid Software from New Zealand.
The popular video game Worms was originally written in this language.
Blitz BASIC competed on the Amiga platform with Europress Software's AMOS. Both BASICs differed from other dialects on different platforms, in that they allowed the easy creation of fairly demanding multimedia software.
More recently, a Blitz BASIC compiler has been developed for the PC, coming in three forms - Blitz Basic 2D, BlitzPlus and Blitz3D. Blitz Basic 2D was the debut product, in 2D only, and is now discontinued from the Blitz Research site but still available from publishers Idigicon. BlitzPlus is the recent upgrade, utilising DirectX 1 for 2D graphics, FMOD for sound, and simple Windows controls. Blitz3D is a user-friendly 3D language (utilising DirectX 7 for graphics and sound), and includes most of the 2D commands from Blitz Basic and BlitzPlus.
The next update to the Blitz line of products, BlitzMAX, was released by Blitz Research in December 2004. It is a cross-platform compiler which supports Microsoft Windows, Linux and Mac OS X (Mac version only complete to date; Update: Windows version now available). Whereas earlier Blitz Research products used DirectX as the graphics API, BlitzMAX uses OpenGL instead, owing to the lack of cross-platform support for DirectX. The previous versions of Blitz were exclusively procedural. BlitzMAX adds object-orientated concepts such as inheritance and polymorphism. BlitzMAX is also better suited to large projects than previous Blitz languages because projects can be divided up into separate modules which can then be compiled and linked together. Blitz Research also provided complete source code for the modules which come with BlitzMAX "out of the box", for instance, file input output, audio, 2d gfx, easy opengl use, and compression.
Blitz Basic example code
The following code creates a normal windowed Windows application that shows the current time in binary and decimal format. Click here (http://en.wikipedia.org/wiki/Image:Binary_Clock_Screenshot.jpg) for a screenshot.
AppTitle "Binary Clock" Graphics 150,80,16,3 ;Copy, modify and redistribute this source as much as you like ;##################################################### ; MAIN LOOP ;##################################################### ;create a timer that means the main loop will be executed twice a second secondtimer=CreateTimer(2) Repeat Hour = Left(CurrentTime$(),2) Minute = Mid(CurrentTime$(),4,2) Second = Right(CurrentTime$(),2) If Hour >= 12 Then PM =1 If Hour > 12 Then Hour = Hour - 12 If Hour = 0 Then Hour = 12 ;should do this otherwise your PM dot would be left up once the clock rolled past midnight! Cls Color(0,255,0) ;make the text green for the PM part If PM = 1 Then Text 5,5,"PM" Color(255,255,255) ;set the text colour back to white for the rest For bit=0 To 5 xpos=20*(6-bit) binaryMask=2^bit ;do hours If (bit<4) If (hour And binaryMask) Text xpos,5,"1" Else Text xpos,5,"0" EndIf EndIf ;do the minutes If (minute And binaryMask) Text xpos,25,"1" Else Text xpos,25,"0" EndIf ;do the seconds If (second And binaryMask) Text xpos,45,"1" Else Text xpos,45,"0" EndIf Next Color(255,0,0) ;make the text red for the decimal time Text 5,65,"Decimal: " + CurrentTime$() Color(255,255,255) ;set the text back to white for the rest ;will wait half a second WaitTimer(secondTimer) Forever
External links
- FMOD (http://www.fmod.org/)
- Blitz Research (http://www.blitzbasic.com)
- Blitzcoder (http://www.blitzcoder.com) (Now Closed)
- CodersWorkshop (http://www.codersworkshop.com) New BlitzCoder
- BlitzBasic on dmoz (http://dmoz.org/Computers/Programming/Languages/BASIC/BlitzBasic/)de:BlitzBasic