I just bought the book "The Beginners Guide to DarkBASIC Programming", and I'm troubled by a strange discrepancy. In the chapter on sprite properties, they include a simple sample program to show how
load bitmap,
get image, and
sprite work together. Here's what's in the book:
`----------------------------------------------------------
`Beginner's Guide To DarkBASIC Game Programming
`Copyright (C)2002 Jonathan S. Harbour and Joshua R. Smith
`Chapter 11 - TransSprite Program
`----------------------------------------------------------
`Initialize the program
HIDE MOUSE
CLS
`Load background bitmap
LOAD BITMAP "background.bmp", 0
`Load the source bitmap file
LOAD BITMAP "F15.bmp", 1
`Grab image 1 from bitmap
GET IMAGE 1,0,0,300,300
`Draw the sprite
SPRITE 1,170,90,1
`Wait for keypress
WAIT KEY
END
When I run this in DBPro, all I get is the background image. This makes sense to me, because even I created a sprite with the
get image and
sprite commands, I still haven't used
paste sprite to actually draw the sprite to the screen, so perhaps this was a typo in the book. However, when I add the
paste sprite command (
paste sprite 1,0,0), I still don't see the F15 sprite in DBPro, but when I run the above code with the
paste sprite command in DB Classic I see the F15. What is the difference between DBPro and DB Classic here? Does the
load bitmap command in DB Classic automatically make the bitmap loaded the "current bitmap"? The reason I ask is that the
get image command doesn't have an attribute to specify which bitmap to take the section from, so I'm assuming it takes the section from the current bitmap. Would someone mind clarifying the relationship between these 3 commands for me?
/* You are not expected to understand this. */