This would all be so much easier if there was just a command to stretch an image. Sprite work seems to me the most annoyingly deficient section of the language (yes, I know it was meant for 3D, but it's still irritating). CLS doesn't get rid of sprites, and when I make a temporary bitmap and initialize the sprites there, when I reference the sprites later in the code, DBPro asserts that they do not exist.
I'll show you what I'm talking about, and cut out some repetitive code for brevity's sake:
load bitmap "Breakout Clone\spritesthusfar.png", 0
get image 2, 0, 32, 31, 63, 3 //get images from the tileset
get image 3, 0, 0, 31, 15, 3
get image 4, 32, 0, 63, 15, 3
get image 5, 64, 0, 95, 15, 3
get image 6, 96, 0, 127, 15, 3
get image 7, 128, 0, 159, 15, 3
get image 8, 160, 0, 191, 15, 3
//...
get image 26, 32, 48, 63, 63, 3
create bitmap 2, 640, 480 //make bitmap for sprites
set current bitmap 2
sprite 2, 0, 0, 2
set sprite 2, 0, 1 //get rid of bizarre blue bg
sprite 3, 0, 0, 3
set sprite 3, 0, 1
sprite 4, 0, 0, 4
set sprite 4, 0, 1
sprite 6, 0, 0, 6
set sprite 6, 0, 1
sprite 7, 0, 0, 7
set sprite 7, 0, 1
//...
sprite 26, 0, 0, 26
set sprite 26, 0, 1
//...more initialization code, then later...
for x = 0 to 15 //this gets types of blocks in a Breakout-type game
for y = 0 to 15
read blocks(y,x).value
blocks(x,y).lenx = screen width() / 16 //init width
blocks(x,y).leny = screen width() / 25 //init height
next y
next x
for x = 3 to 18
stretch sprite x, (blocks(0, 0).lenx * 100) / image width(x), (blocks(0, 0).leny * 100) / image height(x)
//stretch sprite by cross-multiplying and dividing to fit dimensions... this doesn't work for some reason
next
hit.radius = screen height() / 60 //the ball's radius
stretch sprite 2, (hit.radius * 2 * 100) / image height(2), (hit.radius * 2 * 100) / image height(2)
stretch sprite 26, ((screen width() / 8) * 100) / image width(26), ((screen width() / 30) * 100) / image height(26)
set current bitmap 0
I don't know if this is right, but I've followed the instructions as closely as I can, and I don't quite understand why it isn't working. If this doesn't give anyone quite enough context I can upload the file.
Retrotastic!