OpenDBC
Menu

Tutorials

Each tutorial covers one topic with one short program. Read it, run it, change it. Download the source, collect any listed media and run it in the profile shown. Screenshots are captured from the programs running in OpenDBC.

Every listing can be downloaded. An excerpt downloads as a complete program that runs on its own, and every program is compiled and run with OpenDBC before the site is published.

Use the project's media. Tutorials that need a texture, a model or a sound use files from the repository's examples/ folder. They are CC0: copy them next to your .dba and reuse them in your own games. The Download link on each listing saves the source only; the files under “What you need” are separate.

dbc DarkBASIC Classic

New to DarkBASIC? Start here, in order. Run them with --dialect dbc.

First Program running in OpenDBC

1. Your first program

Text, colours, the main loop and SYNC.

Primitives running in OpenDBC

2. 3D primitives

Cubes, spheres, cones: make, place, colour and turn them.

Camera running in OpenDBC

3. Moving the camera

Walk through a scene with the arrow keys.

Textures running in OpenDBC

4. Textures

Load images, wrap them on objects, tile, scroll and ghost them.

Lights running in OpenDBC

5. Lights

Ambient, directional, point and spot lights.

Matrix running in OpenDBC

6. Matrix terrain

Hills from a grid, textured tiles and ground height.

Models running in OpenDBC

7. Loading models

Load animated .x models and play their animations.

Hud running in OpenDBC

8. HUD and UI

Text, health bars and a clickable button over a 3D scene.

Sprites running in OpenDBC

9. Sprites

A 2D background, moving sprites and collisions.

Sound running in OpenDBC

10. Sound and music

Sound effects on key presses and looping music.

dbpro DarkBASIC Professional

Explore Professional types, vectors, cameras, picking and physics. Run them with --dialect dbpro.

Types And Functions running in OpenDBC

Types and functions

User types, typed arrays, globals and constants.

Vectors running in OpenDBC

Vectors

Vector3 maths to make one object chase another.

Fps Camera running in OpenDBC

First-person camera

Mouse look and WASD movement.

Cameras running in OpenDBC

Several cameras

A chase view and a top view on screen at once.

Picking running in OpenDBC

Clicking 3D objects

Find the object under the mouse with PICK OBJECT.

Physics running in OpenDBC

Physics

Falling balls and ramps with the ODE commands.

Want more?

The repository holds bigger programs that cover every Classic command, family by family, in examples/dbc/tutorials/, and six complete demo games in examples/dbc/demos/. The reference walks through each of them. For Professional projects, explore the DBPro demos. The imported DBPro help examples have varying support; see the example status guide.