DarkBASIC

From Wikipedia, the free encyclopedia

DarkBASIC is a commercial game creation programming language released by the United Kingdom based company The Game Creators. The language is a structured form of BASIC and is similar to AMOS on the Amiga. The purpose of the language is game creation using Microsoft's DirectX from a BASIC programming language.


Contents

[edit] DarkBASIC

Darkbasic is a programming language that specialises in the creation of games. It can create both 2D and 3D games using a lot less code than the equivalent program would take using more powerful languages such as C++ due to the included libraries. Often referred to as DarkBASIC Classic to avoid confusion with DarkBASIC Professional. It consists of an IDE, Debugger and Compiler. The engine was built on DirectX 7. The compiler emitted Bytecode that is appended to an interpreter to create a stand alone executable. The current version is 1.13 released 24. January 2002. Since the introduction of Darkbasic Professional, TheGameCreators have stated that there will be no further updates to the language, although it will still be sold.


[edit] Features of DarkBASIC

Audio/Video Extension Save
Wave WAV Yes
Windows Media WMA
Mpeg Layer 2 MP2
Mpeg Layer 3 MP3
MIDI Playback MIDI
RMI RMI
Scream tracker S3M
Fast Tracker XT
Impule Tracker IT
SoundTracker MOD
CD Audio CDA
2D Extension Save
Bitmap BMP Yes
Run Length Encoded BMP RLE
Device Independent Bitmap DIB
Portable Network Graphics PNG
JPEG JPG Yes
DirectDraw Surface DDS
Targa TGA
PCX PCX
PhotoShop PSD
Tagged Interchange Format TIFF
3D Extension
3D Studio 3DS
DirectX X Yes


DarkBASIC a wide language which covers all areas of game development typical of its time, hence it also includes a wide range of file formats typically used in games. Extra features such as multiplayer and EAX support became available in an expansion pack.

[edit] Display

[edit] Input/Output

  • Mouse ,Keyboard and Gaming controller input.
  • Force-Feedback Control
  • System Handling
  • File Handling

[edit] Video and Audio

  • Video Animation Control
  • Audio Control

[edit] 2D

  • Super-Fast 2D blitting
  • Mirror, Stretch, Blur and Fade
  • Screen-Sized and animated sprites
  • Transparency
  • Fast pixel perfect Collision
  • 2D Drawing Functions

[edit] 3D

  • Landscape Terraforming
  • Built-in 3D Primitives
  • Polygon Collision Detection
  • Full Model Manipulation
  • Model Animation
  • Ambient Lighting
  • Directional Lighting
  • Texture Filtering
  • Alpha blending
  • Fogging

[edit] DarkBASIC Professional

Developed as a replacement for DarkBASIC. As with DarkBASIC it consisted of an IDE, debugger and compiler. Unlike DarkBASIC the compiler outputs Machine Code. The engine originally used DirectX 8.1 but has been updated to use DirectX, 9.0c. The language is essentially the same as DarkBASIC with a few additions. Notably types which allow combining simple data types into a composite data type similar to Structs in C. The current version is 6.5 released 1. March 2007.

[edit] Plugin architecture

Plugins allow extra commands to be added to the language. Plugins are DLLs with an embedded string resource detailing the routines implemented in the dll. At compile time the compiler bundles the relevant plugin dlls into the executable.

Interestingly built-in commands are also implemented in the same way. This allows third party plugins access to built-in commands by calling the correct function in the relevant dll.

Currently available plugins provide a wide range of addition commands from integration with physics engines to accessing a Database.

[edit] Dark Game SDK

The DarkBASIC Professional engine packaged up for use with Visual C++ or Microsoft .NET.


[edit] Sample code

[edit] Hello world[1]

 
rem print on screen Hello world
print "Hello world."
rem wait for a key to be pressed
suspend for key
rem end the program
end
 

[edit] Simple Rotating Cube[2]

 
REM 3D rotating cube demo

SYNC RATE 60
MAKE OBJECT CUBE 1,100
DO
    XROTATE OBJECT 1,OBJECT ANGLE X(1)+0.3
    YROTATE OBJECT 1,OBJECT ANGLE Y(1)+0.5
LOOP
 

[edit] Dark Game SDK[3]

 
#include "DarkGDK.h"

void DarkGDK ( void )
{
        // set sync on and sync rate to 60 frames per second
        dbSyncOn   ( );
        dbSyncRate ( 60 );

        // make a cube
        dbMakeObjectCube ( 1, 10 );

        // loop until the escape key is pressed
        while ( !dbEscapeKey ( ) )
        {
                // update screen
                dbSync ( );
        }
}
 

[edit] See also

[edit] References

  1. ^ Darkbasic Professional user manual
  2. ^ TheGameCreators.com darkBASIC codebase
  3. ^ Dark Game SDK user manual


[edit] External links