Blitz BASIC

From Seo Wiki - Search Engine Optimization and Programming Languages
Jump to navigationJump to search

Blitz BASIC is a commercial compiler for the BASIC programming language. Originally developed on the Amiga, Blitz BASIC compilers are now available on several platforms. The Blitz products are mainly designed for programming games but also feature support for graphical user interfaces and general applications. The term Blitz BASIC is often used to refer to the general syntax used in the entire range of Blitz languages, as well as the original product that started them.

History

The first Blitz designed by Mark Sibly was for the Amiga computer and published by the Australian company Memory and Storage Technology.

After returning to New Zealand, Blitz2 was published several years later by Acid Software (a local 90's Amiga game publisher).

Blitz Basic

Otherwise known as Blitz2D, Blitz Basic was released in October 2000 for Microsoft Windows and allowed only 2D graphics. It was published by Idigicon.

Recognition of Blitz Basic increased when a limited range of "free" versions were distributed on popular UK computer magazines such as PC Format. This resulted in a legal dispute between the developer and publisher which was eventually amicably resolved.

Blitz3D

Blitz3D was then released later in September 2001 and was also for Microsoft Windows. It was distributed at first by Idigicon. Blitz3D is Blitz Basic with a built in 3D engine and command list allowing the creation of 3D games for the first time in the Blitz range of languages. It kept all of Blitz BASIC's older commands and incorporated an entirely new set for the movement and rendering of three-dimensional objects. It used DirectX7 to create 3D, and competes with other similar PC game-development languages such as Dark Basic.

Blitz Research Limited later signed a deal with Idigicon giving them full rights to distribute Blitz Basic, to clear their stock of copies of Blitz 3D, and to now allow Blitz Research Limited to distribute Blitz3D themselves.

BlitzPlus

In February 2003 Blitz Research Limited released BlitzPlus, also for Microsoft Windows. It does not have the 3D engine of Blitz3D, but does bring new features to the 2D side of the language by implementing limited Microsoft Windows form/widget functionality. Compatibility of the 2D engine as far back as DirectX 1 was also added.

BlitzMax

BlitzMax
Paradigm object oriented, imperative, modular, reflective
Appeared in 2004
Designed by Mark Sibly
Developer Blitz Research Limited [1]
Stable release v1.37 (January 2010)
Typing discipline Static, Weak/Strong (SuperStrict Mode)
Influenced by BlitzBasic
OS Microsoft Windows, Mac OS X, Linux

The latest in the range of Blitz languages is BlitzMax which, unlike previous Blitz products, is designed to run on multiple operating systems. It was released for Mac OS X first, in December 2004, and then for Microsoft Windows and Linux in May 2005. BlitzMax brought the largest change of language structure to the modern range of Blitz products by adding object-oriented concepts and switching the graphics layer to favour OpenGL.

BlitzMax is also the first modular version of the language, allowing modules/plugins to be written for the language itself. This opened up new possibilities for programmers to configure the language, as well as to purchase additional components from Blitz Research Limited. For instance, the official BlitzMax cross-platform GUI module (known as MaxGUI) was released by Blitz Research Limited, allowing developers to write GUI interfaces for their applications on Linux (FLTK), Mac (Cocoa), and Windows. Various user-contributed modules extend the use of the language by wrapping such libraries as wxWidgets, Cairo, FontConfig as well as a selection of database modules. In addition, there are many third-party 3D modules available for BlitzMax, including MiniB3D[2] - an open-source OpenGL engine which can be compiled and used on all 3 of BlitzMax's supported platforms.

In October 2007, BlitzMax update v1.26 included the addition of a reflection module [1], which further increased the flexibility of the language. As of BlitzMax update v1.32, BlitzMax ships with new threading and Lua Scripting modules and most of the standard library functions have been updated so that they are unicode friendly [2].

Programs written in BlitzMax require compilation on the target platform since BlitzMax is multi-platform but not entirely cross-platform. Compilation for each target CPU (Mac PPC, Mac x86, Linux x86, Windows x86) requires a hardware computer based on that CPU upon which the BlitzMax compiler is run. This allows the creation of an executable binary for that platform. To compile for more than one platform requires the compiler to be run on that platform, and thus requires as many target computer platforms as systems on which sourcecode is to be deployed. However, BlitzMax as a language itself requires very little modification in order to be fully cross-platform compatible and in many cases requires just a recompilation, making cross-platform development quick and easy.

Blitz3D SDK

The latest product from Blitz Research Limited, a 3D graphics engine based on the engine in Blitz3D. It is designed to be used with C++, C#, BlitzMax and PureBasic, however it can be used with other languages.

Max3D module

Blitz Research is currently working on a next-generation 3D engine which will feature an easy-to-use command API similar to but more advanced than that of Blitz3D. The module will be designed to provide a cross-platform 3D graphics API, bringing official 3D support to Mac and Linux. The module is rumored to be initially based on OpenGL with possibly later support for DirectX on Windows. It is also said to be similar to the Blitz3D SDK in that initially it will provide an interface for the BlitzMax language and later provide access from other languages such as C or a derivative thereof.

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 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"
 	;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 your PM dot would be 
         'Left up once the clock rolled 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 Blitz Basic

References

See also

  • Protean IDE - an IDE for blitzbasic/plus/3d
  • IDEal IDE
  • 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

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 1598638432

af:Blitz BASIC de:Blitz Basic es:Blitz BASIC fr:Blitz Basic nl:Blitz Basic no:BlitzBasic pl:Blitz Basic pt:Blitz Basic ru:Blitz BASIC fi:Blitz BASIC sv:Blitz Basic

If you like SEOmastering Site, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...