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

sv:Blitz Basic

Navigation

  • Art and Cultures
    • Art (https://academickids.com/encyclopedia/index.php/Art)
    • Architecture (https://academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (https://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (https://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools