World Library  
Flag as Inappropriate
Email this Article

DarkBASIC

Article Id: WHEBN0040758910
Reproduction Date:

Title: DarkBASIC  
Author: World Heritage Encyclopedia
Language: English
Subject: DarkBASIC Professional, ThinBasic, Visual Basic, Digital Game Xpo, Box2D
Collection: Articles with Example Basic Code, Basic Programming Language Family, Video Game Development Software
Publisher: World Heritage Encyclopedia
Publication
Date:
 

DarkBASIC

DarkBasic
Developer(s) The Game Creators
Written in Compiled to C++ but the scripting language is BASIC
Operating system IDE for Microsoft Windows, Mac OS X, Linux
Platform Crossplatform
Available in English
Type Game creation system
License Proprietary
Website .com.thegamecreatorswww

DarkBASIC is a commercial game creation programming language released by 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. It is faster and easier to use than comparable languages, but also less powerful. It is marketed on its ability to allow a total novice to make playable games after following its tutorials.

DarkBASIC is a programming language that specializes in the creation of games. It can create both 2D and 3D games, providing function libraries that enable a game to be programmed with considerably less code than with a language such as C++ without such dedicated libraries. DarkBASIC consists of an IDE, debugger and interpreter, and an engine built on DirectX 7. The compiler emits Bytecode that is appended to an interpreter to create a stand alone executable.

It was first released in 2000 by DarkBasic Software Ltd (now The Game Creators Ltd.). In 2002, The Game Creators released an updated version called DarkBASIC Professional able to use newer versions of DirectX. The pre-Professional version is informally referred to as DarkBASIC Classic to distinguish between the products.

The current DarkBASIC Classic version is 1.21, released on 14 August 2008. Since the introduction of DarkBASIC Professional, The Game Creators have stated that there will be no further updates to the language, although it will still be sold.

Contents

  • Features 1
    • Display 1.1
    • Input/Output 1.2
    • Video and audio 1.3
    • 2D 1.4
    • 3D 1.5
  • DarkBASIC Professional 2
    • Plugin architecture 2.1
  • PureGDK 3
  • Sample code 4
    • Hello world 4.1
    • Simple rotating cube 4.2
    • Rotating cube in DarkGDK 4.3
    • Rotating cube in PureGDK 4.4
  • See also 5
  • References 6
  • External links 7

Features

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 Save
3D Studio 3DS
DirectX X
Dark Basic Object DBO Yes

DarkBASIC is 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.

Display

Input/Output

  • Mouse, keyboard and gaming controller support
  • Force-feedback control
  • System handling
  • File handling

Video and audio

  • Video animation control
  • Audio control

2D

  • Accelerated 2D blitting
  • Mirror, stretch, blur and fade
  • Screen-sized and animated sprites
  • Transparency
  • Pixel-accurate collision
  • 2D drawing Functions

3D

DarkBASIC Professional

Developed as a replacement for DarkBASIC. As with DarkBASIC it consisted of an IDE, debugger and compiler. Unlike DarkBASIC, the DarkBASIC Professional 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. Other features include the use of shaders, 3D maths commands and vertex editing commands. The current version is 7.61 released 1 June 2011.

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.[1] At compile time the compiler bundles the relevant plugin DLLs into the executable.[2]

DarkBASIC's built-in commands are themselves implemented with a plugin. 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 language extensions and utility functions.[3] to integration with physics engines[4] or accessing a Database.

PureGDK

PureGDK is an implementation of the DarkBASIC Professional engine for the PureBasic programming language. Like DarkGDK, PureGDK supports many of the same features and runs on DirectX 9.[5] An additional license for the commercial PureBasic language is required to use it.

The software comes in two editions: PureGDK Upgrade and PureGDK Complete. PureGDK Upgrade is designed to accommodate existing users of DarkBasic Professional by offering a low-cost upgrade path. PureGDK Complete is a stand-alone product for users who don't already own the engine by providing licenses for both DarkBasic Professional and PureGDK. Either solution still requires the user to own or purchase a license for PureBasic.

Sample code

Hello world[6]

 
PRINT "Hello world."
WAIT KEY
END

Simple rotating cube[7]

 
REM 3D rotating cube demo

SYNC RATE 60

MAKE OBJECT CUBE 1,100

DO
    XROTATE OBJECT 1,WRAPVALUE(OBJECT ANGLE X(1)+0.3)
    YROTATE OBJECT 1,WRAPVALUE(OBJECT ANGLE Y(1)+0.5)
    SYNC
LOOP
END

Rotating cube in DarkGDK[8]

#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 ( ) )
        {
                // Turn the cube left
                dbTurnObjectLeft ( 1, 6 );
                // update screen
                dbSync ( );
        }
}

Rotating cube in PureGDK

 
; Open a PureBasic window
OpenWindow(0,0,0,640,480,"DarkBasic Professional - PureGDK",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)

; Initialize the PureGDK screen as a child of window ID 0
OpenDBWnd(WindowID(0),0,0,640,480)

; Set the sync rate to 60 frames per second
dbSyncRate(60)

; Make a cube
dbMakeObjectCube(1,3)

; Loop until the escape key is pressed or the window is closed
Repeat
  dbXRotateObject(1,dbObjectAngleX(1)+0.3)
  dbYRotateObject(1,dbObjectAngleY(1)+0.5)
  dbSync()
Until WindowEvent()=#PB_Event_CloseWindow Or dbKeyState(#VK_ESCAPE)

See also

References

  1. ^
  2. ^
  3. ^
  4. ^ NewtonDBPro - Newton Game Dynamics plugin.
  5. ^
  6. ^ Darkbasic Professional user manual
  7. ^
  8. ^ Dark Game SDK user manual

External links

  • Official website
  • The Game Creators' Forums
  • WikiBooks - Learn how to Program DarkBASIC


This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
 
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
 
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.
 


Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.