Blitz BASIC

Last updated

BlitzBasic
Developer(s) Blitz Research
Written inCompiled to C++, but the languages are dialects of BASIC
Operating system AmigaOS
Microsoft Windows
Available in English
Type Game creation system
License zlib license
Website www.blitzbasic.com [ dead link ]

Blitz BASIC is the programming language dialect of the first Blitz compilers, devised by New Zealand-based developer Mark Sibly. Being derived from BASIC, Blitz syntax was designed to be easy to pick up for beginners first learning to program. The languages are game-programming oriented 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 and multithreading. This led to the languages losing their BASIC moniker in later years. [1]

Contents

History

The first iteration of the Blitz language was created for the Amiga platform and published by the Australian firm Memory and Storage Technology. Returning to New Zealand, Blitz BASIC 2 was published several years later (around 1993 according this press release [2] ) by Acid Software (a local Amiga game publisher). Since then, Blitz compilers have been released on several platforms. Following the demise of the Amiga as a commercially viable platform, the Blitz BASIC 2 source code was released to the Amiga community. Development continues to this day under the name AmiBlitz. [3]

BlitzBasic

Idigicon published BlitzBasic for Microsoft Windows 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 in popular UK computer magazines such as PC Format . This resulted in a legal dispute between the developer and publisher which was eventually resolved amicably.

BlitzPlus

In February 2003, Blitz Research Ltd. released BlitzPlus also for Microsoft Windows. 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 GUIs. Backwards compatibility of the 2D engine was also extended, allowing compiled BlitzPlus games and applications to run on systems that might only have DirectX 1.

BlitzMax

BlitzMax
Paradigm imperative, object-oriented, modular, reflective
Designed by Mark Sibly
Developer Blitz Research Ltd.
First appeared2004
Final release
1.51 / 21 September 2015;8 years ago (2015-09-21)
Typing discipline Static, Weak, Strong (optional)
OS Microsoft Windows, Mac OS X, Linux
Website www.blitzbasic.com
Dialects
Official BlitzMax, bmx-ng
Influenced by
BlitzBasic
Influenced
Monkey

The first BlitzMax compiler was released in December 2004 for Mac OS X. This made it the first Blitz dialect that could be compiled on *nix platforms. Compilers for Microsoft Windows and Linux 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 concepts and modifying the graphics API to better suit OpenGL. BlitzMax was also the first of the Blitz languages to represent strings internally using UCS-2, allowing native-support for string literals composed of non-ASCII 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 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 GUI module (known as MaxGUI) allows 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, and Fontconfig as well as a selection of database modules. There are also a selection of third-party 3D modules available namely MiniB3D [4] - an open-source OpenGL engine which can be compiled and used on all three of BlitzMax's supported platforms.

In October 2007, BlitzMax 1.26 was released which included the addition of a reflection module. [5] BlitzMax 1.32 shipped new threading and Lua scripting modules and most of the standard library functions have been updated so that they are unicode friendly. [6]

Blitz3D SDK

Blitz3D SDK is a 3D graphics engine based on the engine in Blitz3D. It was marketed for use with C++, C#, BlitzMax, and PureBasic, however it could also be used with other languages that follow compatible calling conventions.

Max3D module

In 2008, the source code to Max3D - a C++-based cross-platform 3D engine - was released under a BSD license. This engine focused on 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.

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 pick up the project again.

Open-source release

BlitzPlus was released as open-source on 28 April 2014 under the zlib license on GitHub. [7] [8] Blitz3D followed soon after and was released as Open Source on 3 August 2014. [9] [10] BlitzMax was later released as Open Source on 21 September 2015. [11]

Examples

Hello World program that prints to the screen, waits until a key is pressed, and then terminates:

Print"Hello World"; Prints to the screen.WaitKey(); Pauses execution until a key is pressed.End; Ends Program.

Program that demonstrates the declaration of variables using the three main data types (strings, integers and floats) and printing them onto the screen:

name$="John"; Create a string variable ($) age=36; Create an integer variable (No Suffix)temperature#=27.3; Create a float variable (#)print"My name is "+name$+" and I am "+age+" years old."print"Today, the temperature is "+temperature#+" degrees."Waitkey(); Pauses execution until a key is pressed.End; Ends program.


Program that creates a windowed application that shows the current time in binary and decimal format. See below for the BlitzMax and BlitzBasic versions:

BlitzBasic versionBlitzMax version
AppTitle"Binary Clock"Graphics150,80,16,3;create a timer that means the main loop will be;executed twice a secondsecondtimer=CreateTimer(2)RepeatHour=Left(CurrentTime$(),2)Minute=Mid(CurrentTime$(),4,2)Second=Right(CurrentTime$(),2)IfHour>=12ThenPM=1IfHour>12ThenHour=Hour-12IfHour=0ThenHour=12;should do this otherwise the PM dot will be;left up once the clock rolls past midnight!ClsColor(0,255,0);make the text green for the PM partIfPM=1ThenText5,5,"PM";set the text colour back to white for the restColor(255,255,255)Forbit=0To5xpos=20*(6-bit)binaryMask=2^bit;do hoursIf(bit<4)If(hourAndbinaryMask)Textxpos,5,"1"ElseTextxpos,5,"0"EndIfEndIf;do the minutesIf(minuteAndbinaryMask)Textxpos,25,"1"ElseTextxpos,25,"0"EndIf;do the secondsIf(secondAndbinaryMask)Textxpos,45,"1"ElseTextxpos,45,"0"EndIfNext;make the text red for the decimal timeColor(255,0,0)Text5,65,"Decimal: "+CurrentTime$();set the text back to white for the restColor(255,255,255);will wait half a secondWaitTimer(secondTimer)Forever
AppTitle="Binary Clock"Graphics145,85'create a timer that means the main loop will be'executed twice a secondsecondtimer=CreateTimer(2)RepeatHour=CurrentTime()[..2].ToInt()Minute=CurrentTime()[4..6].ToInt()Second=CurrentTime()[6..].ToInt()IfHour>=12ThenPM=1IfHour>12ThenHour=Hour-12IfHour=0ThenHour=12'should do this otherwise the PM dot will be'Left up once the clock rolls past midnight!ClsSetColor(0,255,0)'make the text green For the PM partIfPM=1ThenDrawText"PM",5,5'set the text colour back To white For the restSetColor(255,255,255)Forbit=0Until6xpos=20*(6-bit)binaryMask=2^bit'do hoursIf(bit<4)If(hour&binaryMask)DrawText"1",xpos,5ElseDrawText"0",xpos,5EndIfEndIf'do the minutesIf(minute&binaryMask)DrawText"1",xpos,25ElseDrawText"0",xpos,25EndIf'do the secondsIf(second&binaryMask)DrawText"1",xpos,45ElseDrawText"0",xpos,45EndIfNext'make the text red For the decimal timeSetColor(255,0,0)DrawText"Decimal: "+CurrentTime(),5,65'set the text back To white For the restSetColor(255,255,255)Flip'will wait half a secondWaitTimer(secondTimer)IfKeyHit(KEY_ESCAPE)ThenExitForever

Software written using BlitzBasic

Legacy

In 2011, BRL released a new cross-platform programming language called Monkey and its first official module called Mojo. Monkey has a similar syntax to BlitzMax, but instead of compiling direct to assembly code, it translates Monkey source files directly into source code for a chosen language, framework or platform e.g. Windows, Mac OS X, iOS, Android, HTML5, and Adobe Flash.

Since 2015 development of Monkey X has been halted in favour of Monkey 2, an updated version of the language by Mark Sibly.

Related Research Articles

<span class="mw-page-title-main">Qt (software)</span> Object-oriented framework for software development

Qt is cross-platform software for creating graphical user interfaces as well as cross-platform applications that run on various software and hardware platforms such as Linux, Windows, macOS, Android or embedded systems with little or no change in the underlying codebase while still being a native application with native capabilities and speed.

<span class="mw-page-title-main">PureBasic</span>

PureBasic is a commercially distributed procedural computer programming language and integrated development environment based on BASIC and developed by Fantaisie Software for Windows, Linux, and macOS. An Amiga version is available, although it has been discontinued and some parts of it are released as open-source. The first public release of PureBasic for Windows was on 17 December 2000. It has been continually updated ever since.

XBasic is a variant of the BASIC programming language that was developed in the late 1980s for the Motorola 88000 CPU and Unix by Max Reason. In the early 1990s it was ported to Windows and Linux, and since 1999 it has been available as open source software with its runtime library under the LGPL license.

In computing, cross-platform software is computer software that is designed to work in several computing platforms. Some cross-platform software requires a separate build for each platform, but some can be directly run on any platform without special preparation, being written in an interpreted language or compiled to portable bytecode for which the interpreters or run-time packages are common or standard components of all supported platforms.

Amiga E is a programming language created by Wouter van Oortmerssen on the Amiga computer. The work on the language started in 1991 and was first released in 1993. The original incarnation of Amiga E was being developed until 1997, when the popularity of the Amiga platform dropped significantly after the bankruptcy of Amiga intellectual property owner Escom AG.

Irrlicht is an open-source game engine written in C++. It is cross-platform, officially running on Windows, macOS, Linux and Windows CE and due to its open nature ports to other systems are available, including FreeBSD, Xbox, PlayStation Portable, Symbian, iPhone, AmigaOS 4, Sailfish OS via a QT/Qml wrapper, and Google Native Client.

Blitz Research Ltd is an Auckland, New Zealand–based company which currently produces three BASIC based programming languages. Founded in 2000 by Mark Sibly, the company's first product was the now obsolete Blitz BASIC 2D, a PC version of the Amiga Blitz Basic. It was released the same year as the company's foundation. In 2001, Blitz3D was released. This allowed programmers to create 3D games and applications in Blitz Basic using DirectX.

<span class="mw-page-title-main">GLBasic</span> Commercial BASIC programming language

GLBasic is a commercial BASIC programming language that can compile to various platforms including Windows, Linux, Mac OS X, and some handheld devices. The language is designed to be simple and intuitive.

Cocos2d is an open-source game development framework for creating 2D games and other graphical software for iOS, Android, Windows, macOS, Linux, HarmonyOS, OpenHarmony and web platforms. It is written in C++ and provides bindings for various programming languages, including C++, C#, Lua, and JavaScript. The framework offers a wide range of features, including physics, particle systems, skeletal animations, tile maps, and others.

<span class="mw-page-title-main">Hollywood (programming language)</span> Programming language

Hollywood is a commercially distributed programming language developed by Andreas Falkenhahn which mainly focuses on the creation of multimedia-oriented applications. Hollywood is available for AmigaOS, MorphOS, WarpOS, AROS, Windows, macOS, Linux, Android, and iOS. Hollywood has an inbuilt cross compiler that can automatically save executables for all platforms supported by the software. The generated executables are completely stand-alone and do not have any external dependencies, so they can also be started from a USB flash drive. An optional add-on also allows users to compile projects into APK files.

Dart is a programming language designed by Lars Bak and Kasper Lund and developed by Google. It can be used to develop web and mobile apps as well as server and desktop applications.

<span class="mw-page-title-main">Simple and Fast Multimedia Library</span> Graphics and Multimedia Library written in C++

Simple and Fast Multimedia Library (SFML) is a cross-platform software development library designed to provide a simple application programming interface (API) to various multimedia components in computers. It is written in C++ with bindings available for Ada, C, Crystal, D, Euphoria, Go, Java, Julia, .NET, Nim, OCaml, Python, Ruby, and Rust. Experimental mobile ports were made available for Android and iOS with the release of SFML 2.2.

Absoft Fortran Compilers are set of Fortran compilers for Microsoft Windows, Apple Macintosh, and Linux produced by Absoft Corporation. The compilers are source code compatible across platforms.

The Game Creators Ltd is a British software house based in Macclesfield, Cheshire, England, which specialises in software for video game development, originally for the Microsoft Windows platform. The company was established in March 1999 through a partnership between programmers Lee Bamber and Richard Vanner, who were joined by Meash Meakin in 2011 and Deborah Ascott-Jones in 2013.

Microsoft, a technology company historically known for its opposition to the open source software paradigm, turned to embrace the approach in the 2010s. From the 1970s through 2000s under CEOs Bill Gates and Steve Ballmer, Microsoft viewed the community creation and sharing of communal code, later to be known as free and open source software, as a threat to its business, and both executives spoke negatively against it. In the 2010s, as the industry turned towards cloud, embedded, and mobile computing—technologies powered by open source advances—CEO Satya Nadella led Microsoft towards open source adoption although Microsoft's traditional Windows business continued to grow throughout this period generating revenues of 26.8 billion in the third quarter of 2018, while Microsoft's Azure cloud revenues nearly doubled.

raylib Game programming library

Raylib is a cross-platform open-source software development library. The library was made to create graphical applications and games.

References

  1. "The Official Blitz Website". www.blitzbasic.com. Archived from the original on 3 June 2017.
  2. "Blitz Basic 2". AmigaReport. Archived from the original on 31 March 2022. Retrieved 30 April 2020.
  3. "AmiBlitz". GitHub .
  4. "Blitz News". www.blitzbasic.com. Archived from the original on 26 January 2008. Retrieved 12 December 2007.
  5. "BlitzMax update 1.26 now available!". www.blitzbasic.com. Archived from the original on 26 May 2011. Retrieved 11 January 2011.
  6. BlitzMax V132 for Windows and MacIntel now up! Archived 26 May 2011 at the Wayback Machine on blitzbasic.com
  7. BlitzPlus Source Code Released Archived 16 July 2016 at the Wayback Machine by simonh (2014-04-29)
  8. Blitz3D open sourced! Archived 6 September 2016 at the Wayback Machine on Blitz3D Forums by (2014)
  9. Blitz3D Now Free and Open Source! Archived 16 July 2016 at the Wayback Machine by simonh (2014-08-03)
  10. blitz3d on GitHub
  11. blitzmax on GitHub
  12. IGN. Worms Blast Preview Archived 18 February 2007 at the Wayback Machine on ign.com