Introduction to Dark Basic
What is Dark Basic?
Dark Basic is an object oriented programming language that allows you to create and personalize games, slideshows or other applications. You don’t need to be an expert in software programming to be able to understand and use Dark Basic as it is provided with a set of simple commands, suitable for any beginner.
You can get a free trial version of the program from the following link:
http://darkbasic.thegamecreators.com/
Step 1: How to start?
You will be prompted to enter all the commands in a window in order to create your own environment or whatever game you have in mind. Hence, the first thing required is to know what you want the screen to display. You can use the sample below in order to display a window entitled EDPLN 2 Freeware SE and that will enable your mouse use but disable the ESC key.
set window on
set window layout 1,1,1
set window title "System backup copy (1.1)"
show window
show mouse
disable escapekey
sync on
gosub start
end
Step 2: How to create a simple menu?
Creating a simple menu will allow the user to use and go through the program. Hence, you can use the codes below to create a basic menu with the command ‘A’ to Save, ‘B’ to define a filter, ‘C’ to choose a way out of the game or environment and ‘Q’ to quit the game.
start:
rem Definition defaults
$ access = 'E: \ "
rem Start the main loop
do
cls 0
To replace print text on the screen (and not to print)
print "Utility Backups."
print ""
print "to save A, B to define a filter, C to change the output path, Q to exit."
rem Request a value to the user and saves it as $ key
input "Choose the action to do and press Enter>", $ key
rem analysis of data received
if key $ <> "A" and $ key <> "a" and key $ <> "B" and key $ <> "b" and key $ <> "C" and key $ <> "c" and key $ <> "Q" and key $ <> "q" then print "Please choose a valid choice." : Sleep 2000: GOSUB start
rem The previous line displays an error message for 2 seconds and then back to the beginning if the election is invalid.
rem I have not forgotten in the previous line to analyze the upper and lower case.
rem Another solution would have been $ key turning in capitalization to shorten the code.
rem Now that the analysis is done, use the data.
It will replace begin to see if the first choice was made:
if $ key = "a" or $ key = "A" then save GOSUB
rem If the choice was A or A, then we will save.
if $ key = "b" or $ key = "B" then GOSUB option1
Similarly to replace B, you arrive at the sub-menu option1
if $ key = "c" or $ key = "C" then GOSUB option2
Similarly rem for C to reach the submenu option2
if $ key = "q" or $ key = "Q" then end
rem Here, we saw that if the choice was to leave, leave the program without warning.
rem Now that diversions were made, it closes the loop for security (which will save us, you should see it if you run this code when we have finished).
loop
return
Key Features of Dark Basic
- Automated Double Buffering
- Full-Screen Display Modes
- Gamma Control
- Mouse, Keyboard and Gaming controller input.
- Force-Feedback Control
- System Handling
- File Handling
- Video Animation Control
- Audio Control
- Super-Fast 2D blitting
- Mirror, Stretch, Blur and Fade
- Screen-Sized and animated sprites
- Transparency
- Fast pixel perfect Collision
- 2D Drawing Functions
- Landscape Terraforming
- Built-in 3D Primitives
- Polygon Collision Detection
- Full Model Manipulation
- Model Animation
- Ambient lighting
- Directional Lighting
- Texture filtering
- Alpha blending
- Fogging