When i first startd using darkbasic, i had it for about a month and i couldnt understand it. I gave up for a while but then i found this and and then the darkbasic stuff started making sense:
REM SIMPLE MOVEMENT AND VERY SIMPLE AI TUTORIAL
REM THIS TUTORIAL IS MENT FOR THE COMPLETE NEWCOMER TO DARKBASIC CLASSIC
REM THIS TUTORIAL INTRODUCES MAKING OBJECTS,SYNCHORIZING,SIMPLE MATHS,
REM LOOPS,CONTROLLING OBJECTS,SETTING UP A SIMPLE CAMERA TO FOLLOW THE
REM PLAYER CONTROLLED OBJECT, IF STATEMENTS, USE OF VARIABLES, AND
REM THE USE OF USER PROMPTS
REM BY: THE DARK PADAWAN
REM TURN ON THE SYNCHORIZING
SYNC ON
REM SET THE SYNCHORIZING RATE
SYNC RATE 30
REM MAKE PLAYER BLOB
MAKE OBJECT CONE 2,10
REM MAKE CUP CONTROLLED BLOB
MAKE OBJECT CUBE 3,10
REM MAKE A VARIABLE FOR "TIMING" AI
M#=0
REM START OFF THE MAIN LOOP
DO
REM SET THE CURSOR TO THE 0,0 COORDINATES
SET CURSOR 0,0
Rem Store Object angle Y in aY#
AY# = Object angle Y(2)
Rem Control input for camera
If Upkey()=1 then Move object 2,10
If Leftkey()=1 then Yrotate object 2,Wrapvalue(aY#-5)
If Rightkey()=1 then Yrotate object 2,Wrapvalue(aY#+5)
REM AI************************************************
REM MAKE THE TIMER SO EVERY TIME THE LOOP "LOOPS" OR GOES THROUGH ITS CYCLE,
REM IT ADDS ONE TO THE M# VARIABLE
M# = M#+1
REM MOVE THE CPU BLOB AT A RANDOM SPEED OF 1 - 5
MOVE OBJECT 3,RND(5)
REM USE THE IF STAMENT TO
REM MAKE IT SO IF THE M# VARIABLE IS GREATER (>) THEN 10
REM YROTATE THE OBJECT TO POINT INTO ANOTHER DIRECTION RANDOMLY
IF M#>10
YROTATE OBJECT 3,RND(360)
REM MAKE THE M# VARIABLE 0 SO IT CONTINUES TO DO ROTATE (CHANGE DIRECTION)
REM WHEN THE M# VARIABLE TURNS TO 10
M#=0
REM CLASSIFY THAT THIS IS THE END OF OUR IF STATEMENT
ENDIF
REM THIS GETS THE PLAYER CONTROLLED OBJECT'S X AND Z POSITION AND STORES IT
X# = OBJECT POSITION X(2)
Z# = OBJECT POSITION Z(2)
Rem THIS GETS THE CAMERA'S X AND Z POSITION AND STORES IT
CAMERAZ# = NEWZVALUE(Z#,AY#-180,100)
CAMERAX# = NEWXVALUE(X#,AY#-180,100)
Rem position camera
Position Camera CAMERAX#,100,CAMERAZ#
Rem point the camera at the player object
Point camera X#,50,Z#
REM LET THE PLAYER KNOW WHAT TO DO
PRINT "USE THE ARROW KEYS TO MOVE"
REM REFRESH THE SCREEN
SYNC
REM CLASSIFY THIS AS THE END OF THE LOOP
LOOP
REM THINGS FOR YOU TO DO
REM 1) REREAD THIS TUTORIAL UNTIL YOU FULLY UNDERSTAND IT
REM 2) SLOW DOWN THE AI'S TURNING
REM 3) HAVE FUN PROGRAMMING
I dont remember where i found that but it was somewhere on the darkbasic website. It was created by THE DARK PADAWAN, I dont know who he is. That really helped me and a month after i saw this, i finished a very simple 3d game.