Blitz BASIC
Encyclopedia
Blitz BASIC refers to the programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

 dialect that was interpreted by the first Blitz compilers, devised by New Zealand
New Zealand
New Zealand is an island country in the south-western Pacific Ocean comprising two main landmasses and numerous smaller islands. The country is situated some east of Australia across the Tasman Sea, and roughly south of the Pacific island nations of New Caledonia, Fiji, and Tonga...

-based developer Mark Sibly. Being derived from BASIC
BASIC
BASIC is a family of general-purpose, high-level programming languages whose design philosophy emphasizes ease of use - the name is an acronym from Beginner's All-purpose Symbolic Instruction Code....

, Blitz syntax was designed to be easy to pick-up for beginners first learning to program. The languages are game-programming orientated but are often found general-purpose enough to be used for most types of application. The Blitz language evolved as new products were released, with recent incarnations offering support for more advanced programming techniques such as object-orientation
Object-oriented programming
Object-oriented programming is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction,...

 and multi-threading. This led to the languages losing their BASIC
BASIC
BASIC is a family of general-purpose, high-level programming languages whose design philosophy emphasizes ease of use - the name is an acronym from Beginner's All-purpose Symbolic Instruction Code....

 moniker in later years.

History

The first iteration of the Blitz language was created for the Amiga
Amiga
The Amiga is a family of personal computers that was sold by Commodore in the 1980s and 1990s. The first model was launched in 1985 as a high-end home computer and became popular for its graphical, audio and multi-tasking abilities...

 platform and published by the Australia
Australia
Australia , officially the Commonwealth of Australia, is a country in the Southern Hemisphere comprising the mainland of the Australian continent, the island of Tasmania, and numerous smaller islands in the Indian and Pacific Oceans. It is the world's sixth-largest country by total area...

n firm Memory and Storage Technology. Returning to New Zealand
New Zealand
New Zealand is an island country in the south-western Pacific Ocean comprising two main landmasses and numerous smaller islands. The country is situated some east of Australia across the Tasman Sea, and roughly south of the Pacific island nations of New Caledonia, Fiji, and Tonga...

, Blitz2 was published several years later by Acid Software (a local Amiga game publisher). Since then, Blitz compilers have been released on several platforms
Platform (computing)
A computing platform includes some sort of hardware architecture and a software framework , where the combination allows software, particularly application software, to run...

.

BlitzBasic

Idigicon published BlitzBasic for Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 in October 2000. The language included a built-in API for performing basic 2D-graphics and audio operations. Following the release of Blitz3D, BlitzBasic is often synonymously referred to as Blitz2D.

Recognition of BlitzBasic increased when a limited range of "free" versions were distributed on popular UK computer magazines such as PC Format
PC Format
PC Format is a computer magazine published in the United Kingdom by Future Publishing, and licensed to other publishers in countries around the world. In publication since 1991, it is part of Future Publishing's Format series of magazines that include articles about games, entertainment and how to...

. This resulted in a legal dispute between the developer and publisher which was eventually resolved amicably.

Blitz3D

Blitz3D was released for Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 in September 2001, competing with other similar PC game-development languages of the time (such as Dark Basic). Blitz3D extended BlitzBasic's command-set with the inclusion of an API for a DirectX 7-based 3D engine.

Although originally Blitz3D's distribution rights were owned by Idigicon, Blitz Research Ltd. later signed a deal with the firm so as to allow Blitz Research Ltd. to distribute Blitz3D themselves. In return, Idigicon were granted full rights to distribute BlitzBasic and to clear any outstanding stock copies of Blitz3D.

BlitzPlus

In February 2003, Blitz Research Ltd. released BlitzPlus also for Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

. It lacked the 3D engine of Blitz3D, but did bring new features to the 2D side of the language by implementing limited Microsoft Windows control support for creating native GUI
Gui
Gui or guee is a generic term to refer to grilled dishes in Korean cuisine. These most commonly have meat or fish as their primary ingredient, but may in some cases also comprise grilled vegetables or other vegetarian ingredients. The term derives from the verb, "gupda" in Korean, which literally...

s. Backwards compatibility of the 2D engine was also extended, allowing compiled BlitzPlus games and applications to run on systems that might only have DirectX
DirectX
Microsoft DirectX is a collection of application programming interfaces for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with Direct, such as Direct3D, DirectDraw, DirectMusic, DirectPlay,...

 1.

BlitzMax

The first BlitzMax compiler was released in December 2004 for Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

. This made it the first Blitz dialect that could be compiled on *nix platforms. Compilers for Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 and Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

 were subsequently released in May 2005. BlitzMax brought the largest change of language structure to the modern range of Blitz products by extending the type system to include object-oriented
Object-oriented programming
Object-oriented programming is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction,...

 concepts and modifying the graphics API to better suit OpenGL
OpenGL
OpenGL is a standard specification defining a cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics. The interface consists of over 250 different function calls which can be used to draw complex three-dimensional scenes from simple primitives. OpenGL...

. BlitzMax was also the first of the Blitz languages to represent strings internally using UCS2, allowing native-support for strings literals composed of non-ASCII
ASCII
The American Standard Code for Information Interchange is a character-encoding scheme based on the ordering of the English alphabet. ASCII codes represent text in computers, communications equipment, and other devices that use text...

 characters.

BlitzMax's platform-agnostic command-set allows developers to compile and run source code on multiple platforms. However the official compiler and build chain will only generate binaries for the platform that it is executing on. Unofficially, users have been able to get Linux and Mac OS X to cross-compile to the Windows platform.

BlitzMax is also the first modular
Modularity (programming)
Modular programming is a software design technique that increases the extent to which software is composed of separate, interchangeable components called modules by breaking down program functions into modules, each of which accomplishes one function and contains everything necessary to accomplish...

 version of the Blitz languages, improving the extensibility of the command-set. In addition, all of the standard modules shipped with the compiler are open-source and so can be tweaked and recompiled by the programmer if necessary. The official BlitzMax cross-platform
Cross-platform
In computing, cross-platform, or multi-platform, is an attribute conferred to computer software or computing methods and concepts that are implemented and inter-operate on multiple computer platforms...

 GUI
Gui
Gui or guee is a generic term to refer to grilled dishes in Korean cuisine. These most commonly have meat or fish as their primary ingredient, but may in some cases also comprise grilled vegetables or other vegetarian ingredients. The term derives from the verb, "gupda" in Korean, which literally...

 module (known as MaxGUI) allows developers to write GUI interfaces for their applications on Linux (FLTK
FLTK
FLTK is a cross-platform GUI library developed by Bill Spitzak and others. Made with 3D graphics programming in mind, it has an interface to OpenGL, but it is also suitable for general GUI programming....

), Mac (Cocoa
Cocoa (API)
Cocoa is Apple's native object-oriented application programming interface for the Mac OS X operating system and—along with the Cocoa Touch extension for gesture recognition and animation—for applications for the iOS operating system, used on Apple devices such as the iPhone, the iPod Touch, and...

) and Windows. Various user-contributed modules extend the use of the language by wrapping such libraries as wxWidgets
WxWidgets
wxWidgets is a widget toolkit for creating graphical user interfaces for cross-platform applications. wxWidgets enables a program's GUI code to compile and run on several computer platforms with minimal or no code changes...

, Cairo
Cairo (graphics)
cairo is a software library used to provide a vector graphics-based, device-independent API for software developers. It is designed to provide primitives for 2-dimensional drawing across a number of different backends...

, Fontconfig
Fontconfig
Fontconfig is a computer program library designed to provide system-wide font configuration, customization, and application access. Fontconfig is written and was originally maintained by Keith Packard...

 as well as a selection of database modules. There are also a selection of third-party 3D modules available namely MiniB3D - an open-source OpenGL engine which can be compiled and used on all 3 of BlitzMax's supported platforms.

In October 2007, BlitzMax 1.26 was released which included the addition of a reflection
Reflection (computer science)
In computer science, reflection is the process by which a computer program can observe and modify its own structure and behavior at runtime....

 module. BlitzMax 1.32 shipped new threading
Thread (computer science)
In computer science, a thread of execution is the smallest unit of processing that can be scheduled by an operating system. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process...

 and Lua scripting modules and most of the standard library functions have been updated so that they are unicode
Unicode
Unicode is a computing industry standard for the consistent encoding, representation and handling of text expressed in most of the world's writing systems...

 friendly.

Blitz3D SDK

Blitz3D SDK is a 3D graphics engine based on the engine in Blitz3D. It was marketed for use with C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...

, C#, BlitzMax and PureBasic
PureBasic
PureBasic is a commercially distributed procedural computer programming language and integrated development environment based on BASIC and developed by Fantaisie Software for Windows 32/64-bit, Linux 32/64-bit, and Mac OS X. An Amiga version is available, although it has been discontinued and...

, however it could also be used with other languages that follow compatible calling conventions. As of January 2011, Blitz3D SDK is no longer listed for sale on the official Blitz website.

Max3D module

In 2008, the source code to Max3D - a C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...

-based cross-platform 3D engine - was released under a BSD license. The engine focused on OpenGL
OpenGL
OpenGL is a standard specification defining a cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics. The interface consists of over 250 different function calls which can be used to draw complex three-dimensional scenes from simple primitives. OpenGL...

 but had an abstract backend for other graphics drivers (such as DirectX) and made use of several open-source libraries, namely Assimp, Boost and ODE
Open Dynamics Engine
The Open Dynamics Engine is a physics engine in C/C++. Its two main components are a rigid body dynamics simulation engine and a collision detection engine...

.

Despite the excitement in the Blitz community of Max3D being the eagerly awaited successor to Blitz3D, interest and support died off soon after the source code was released and eventually development came to a halt. There is no indication that Blitz Research will pickup the project again.

Monkey and Mojo

In 2011, BRL released a new cross-platform programming language called Monkey
Monkey (programming language)
Monkey is a cross-platform computer language which translate Monkey code into several target platforms. Currently the target platforms include Windows, Mac OS X, Android, iOS, HTML5 and Flash. Monkey is created by Blitz Research Ltd, the makers of BlitzBasic, Blitz3D and BlitzMax.-Mojo:Mojo is a...

 and its first official module called Mojo. Monkey has a very similar syntax to BlitzMax, but instead of compiling direct to assembly code, translates Monkey source files into source for a chosen language, framework or platform e.g. Windows, Mac OS X, iOS, Android, HTML5 and Flash.

Sample code

The following code creates a windowed application that shows the current time in binary and decimal format. This code is written in Blitz Basic, but will compile and run in both Blitz3D and BlitzPlus. See below for the same example written in BlitzMax.


AppTitle "Binary Clock"
Graphics 150,80,16,3
;Copy, modify and redistribute this source with no limit
;#####################################################
; 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 the PM dot will be
;left up once the clock rolls past midnight!
Cls

Color(0,255,0) ;make the text green for the PM part
If PM = 1 Then Text 5,5,"PM"
;set the text colour back to white for the rest
Color(255,255,255)

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

;make the text red for the decimal time
Color(255,0,0)
Text 5,65,"Decimal: " + CurrentTime$
;set the text back to white for the rest
Color(255,255,255)

;will wait half a second
WaitTimer(secondTimer)
Forever


BlitzMax version of the above clock:


AppTitle = "Binary Clock"
Graphics 145,85

secondtimer = CreateTimer(2)
Repeat

Hour = CurrentTime[..2].ToInt
Minute = CurrentTime[4..6].ToInt
Second = CurrentTime[6..].ToInt

If Hour >= 12 Then PM = 1
If Hour > 12 Then Hour = Hour - 12
If Hour = 0 Then Hour = 12

'should do this otherwise the PM dot will be
'Left up once the clock rolls past midnight!
Cls

SetColor(0,255,0) 'make the text green For the PM part
If PM = 1 Then DrawText "PM",5,5
'set the text colour back To white For the rest
SetColor(255,255,255)

For bit=0 Until 6
xpos=20*(6-bit)
binaryMask=2^bit
'do hours
If (bit<4)
If (hour & binaryMask)
DrawText "1",xpos,5
Else
DrawText "0",xpos,5
EndIf
EndIf

'do the minutes
If (minute & binaryMask)
DrawText "1", xpos,25
Else
DrawText "0", xpos,25
EndIf

'do the seconds
If (second & binaryMask)
DrawText "1",xpos,45
Else
DrawText "0",xpos,45
EndIf
Next

'make the text red For the decimal time
SetColor(255,0,0)
DrawText "Decimal: " + CurrentTime,5,65
'set the text back To white For the rest
SetColor(255,255,255)

Flip

'will wait half a second
WaitTimer(secondTimer)
If KeyHit(KEY_ESCAPE) Then Exit
Forever

Notable software written using BlitzBasic

  • Eschalon: Book I
    Eschalon: Book I
    Eschalon: Book I is an isometric turn-based computer role-playing game by Basilisk Games. In the style of classic computer role-playing games, it features a large and openly explorable game world, comprehensive management of character stats and skills, and a non-linear storyline...

     - BlitzMax
  • Eschalon: Book II
    Eschalon: Book II
    Eschalon: Book II is an isometric, turn-based single player role-playing video game by Basilisk Games. Like the first game in the series, Eschalon: Book I, it features a large and openly explorable game world, a comprehensive management of character statistics and skills, and a non-linear...

     - BlitzMax
  • Fairway Solitaire
    Fairway Solitaire
    Fairway Solitaire is a downloadable casual game, based on the Blitz programming environment, that provides a new twist on the classic card game, solitaire...

     - BlitzMax
  • Grid Wars
    Grid Wars
    Grid Wars is a computer game inspired by Bizarre Creations' Geometry Wars developed by Marco Incitti. The first version of the game was released as freeware on December 21, 2005 on Marco Incitti's Blitz Creations website....

     - BlitzMax
  • Qbix - BlitzMax
  • Platypus
    Platypus (game)
    .The music in both Platypus and Platypus 2 on all platforms except iPhone consists of various remixes of Commodore 64 game tunes by various Commodore 64 composers, and performed by various remixers of Commodore 64 music. They originally appeared on CDs from the C64Audio.com label, and were licenced...

     - Blitz2D (Mac port, BlitzMax)
  • Worms
    Worms (computer game)
    Worms is a series of turn-based computer games developed by British company Team17 Software. Players control a small platoon of earthworms across a deformable landscape, battling other computer- or player-controlled teams...

    - originally titled Total Wormage and developed in Blitz Basic on the Amiga before its commercial release
  • Wonderful Wizard of Oz - BlitzMax
  • Unwell Mel - BlitzMax

See also

  • Protean IDE
    Protean IDE
    Protean IDE is a highly-functional program written by Rob Hutchinson to assist BlitzBasic programmers. It has full functionality with BlitzPlus, Blitz2D and Blitz3D...

     - An IDE for BlitzBasic/Plus/3D
  • IDEal - An advanced IDE for Blitz+ and Blitz3D.
  • BLIde - A .Net IDE for BlitzMax.
  • MaxIDE Community Edition - An open source branch of the default IDE maintained by some members of the BlitzMax community.
  • Project Studio - A discontinued .Net IDE for Blitz3D/Basic and BlitzMax.

External links

Blitz Research, BlitzBasic author, distributor

Books on Blitz Basic

  • Learn to Program 2D Games in Blitz Basic by John "Krylar" Logsdon, (2003)
  • Game Programming for Teens by Maneesh Sethi, (2003), ISBN 1-59200-068-1
  • Games Programming for the Absolute Beginner with BlitzMax by Sloan Kelly, ISBN 0-9553771-0-2
  • 3D Game Programming for Teens by Eric Grebler, (2006) ISBN 1-59200-900-X
  • 3D Game Programming for Teens, 2nd edition by Maneesh Sethi, (2009) ISBN 1-59863-843-2
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK