Hey guys. I have a few questions. First of all, I'm trying to make a vertically scrolling paralax starfield. I'm running into a few problems.
I'm using the tutorial located here: http://developer.thegamecreators.com/?f=dbpro_tutorials
Specifically, I'm using the MEMBLOCK version.
The first problem I have run into is that when I copy data from a memblock to the display, the display is missing a good chunk of information. I've isolated the problem, but I do not undertstand it. Take for example, this code.
sh = screen height()
sw = screen width()
sd = screen depth()
bytes_per_pixel = ds / 8
mem_size = sw * sh * bytes_per_pixel `this will be 1920000, which mathimattically is corrent
make memblock 1, mem_size
now, we enter the test
`make a quick box, then copy all of the screen information into the memblock
cls 0
ink rgb(100,100,100),0
box 0,0,800,600
sync
lock pixels
copy memory get memblock ptr(1), get pixels pointer(), mem_size
unlock pixels
wait key
cls 0 `clear the screen again, so we know its empty, and wait again
wait key
`dump everything from the memblock into the display
lock pixels
copy get pixels pointer(), memory get memblock ptr(1), mem_size
unlock pixels
wait key
end
now that should work, but it doesn't. The bottom of the display is missing. The only workaround I have found is this:
mem_size = (sw * sh * bytes_per_pixel) * 1.12
That 1.12 is totally arbitrary, and I've only tested in a 800x600,32 environment, so I'm not sure yet if it changes. If anyone knows why this happens, please, let me know.
Also, as far as the starfield. When I used the turorial, it didnt work (same reasons posted above actually). What I want to do is move the stars vertaically, but when I adjust theit Y coordinate, the display....well freaks out. Really freaks out.
Any help is vastly appreciated.