@ Colonel_Klink:
Taking over the world shouldn't take too long.
Yeah total error trapping would be nice in Darkbasic but luckily there are plenty of specific error traps that we could make with commands like FILE EXIST(), SPRITE EXIST(), OBJECT EXIST(), and so on. It probably would be a daunting task for Lee to condense all those specific error traps into one command to trap them all.
@ Phaelax:
I admit when I started using QuickBasic (not QBasic) coming from GWBasic I still used GOTO even after I discovered QuickBasic had subroutines. It wasn't until I used Darkbasic for a while that I stopped using GOTO altogether.
The following is my oldest Darkbasic Classic program I could find that was saved... it has goto, and no indenting and several other things I wouldn't do now.
You can even see my thought process as I was learning Darkbasic with the remarks. It wasn't long after making that test that I joined the Darkbasic forums and happily learned indenting, functions and the evils of GOTO from just reading messages by people like you (those that have used Darkbasic longer than me).
This was a test for the first game I wanted to make in Darkbasic... Fatso.
` Sprite Test by Grog
` May 15, 2005
` "Sync" it so it's fast. That's a new t-shirt... "SYNC IT!" (DARKBASIC LOGO)
sync rate 0
sync on
` The background text wasn't the same nice lines as I had drawn in Paint Shop Pro... so
` I figured that the resolution wasn't the same as the picture resolution (putting a
` bigger picture "squashed" the look. The natural resolution for DarkBasic is
` 640 x 480 16million colors The command below changes the screen size.
SET DISPLAY MODE 800, 600, 16
` I had the "hide mouse" command above the "set display mode" command but apparently if
` you change the screen the mouse becomes unhidden and has to be re-hid.
hide mouse
` When you load a bitmap without a number at the end it appears instantly
` on the screen
load bitmap "fatsoback.bmp"
load bitmap "man.bmp",1
get image 1,0,0,48,111
load bitmap "candy.bmp",2
get image 2,26,8,146,142
` Place the sprite outside the view area to be able to scale it down without
` being seen (if placing the sprite isn't done it'll give an error during
` the scaling)
sprite 2,-100,-100,2
scale sprite 2,50
for t=1 to 200 step 10
sprite 1,t,t,1
sprite 2,190,t,2
sync
next t
for t=200 to 300 step 2
sprite 1,t,300,1:sync
next t
X=3
DO
` mousex() and mousey() tracks the mouse movement
sprite 1,mousex(),mousey(),1
` Just to mess around I added a mouse button function to place another sprite at the
` mouse location. Note: In doing that I see that each sprite goes in front of the other
` sprites. So if you wanted a character to enter a building the part of the building
` the character goes in front of would be sprite 1, the character itself sprite 2, and
` the front of the building as sprite 3. Moving sprite 2 would make it appear to go
` in front of sprite 1 and disappear behind sprite 3. I'll have to try that later.
` The command "set sprite" turns off the sprites ability to save the background under
` the sprite. Doing this sped up the program.
if mouseclick()=1 then sprite x,mousex(),mousey(),1:SET SPRITE x, 0, 1:x=x+1
if mouseclick()=2 then goto anim1
sync
LOOP
anim1:
for t=1 to x
xx=rnd(800):yy=rnd(600)
sprite x,xx,yy,1
sync
next t