First of all, I'm ecstatic that I can code again. I was an amateur C programmer but I gave it up 15 years ago with the advent of C++ and Windows. My project is to do a remake of Starflight II with 3d effects. There's a SF III project underway but it's been going on for 10 years(!) so I'm a little impatient and want to try on my own, something I see possible given the amount of work I've been able to do in DBPro.
Now that I have the registered version of DBPro, I've run into a couple of problems. First, I "borrowed" the code from the memory block tutorial to create a 3d starfield in the upper left quadrant. However, I couldn't figure out how to draw to just that area. Any decrease in the x, y, variables only decreased the y axis. So I'm under the impression that when using 3d, the whole screen is involved. Therefore, I masked the rest with 2d boxes, using black set at (1, 1, 1) to confine the 3d graphics to the upper left quadrant. I get image the static screen then display it as a sprite.
Question 1 is, can I confine the 3d to one area of the screen?
However, I found out that I could only switch the menues on the left by creating the submenu, writing text, capture image then turn it into a sprite, then blank it out with a black box and write the next submenu. In other words, the menu changes are accomplished by hiding/showing these sprites.
Okay, so far, but I need to send text to update spaceship coordinates and other info to areas on the static interface sprite. My second question then, is is this possible? I've tried every combination of print and text statements I can think of and can't get the text to the screen.
3rd Question: It seems that DB is a cross between C and BASIC. I know C (but rusty) but don't know BASIC. So my question is, when I try to do a do/loop in a subroutine, it doesn't cycle rather it runs through once and returns.
4th question, it seems DB only allows functions in #includes. If this is true, then how do you keep the code straight? I'm already at 730 lines, and I've just started. I'd rather not plow through several thousand lines.
Last question, I keep having to put in sleep statements after keypresses to avoid repeating keys. Is there any way to flush the buffer? I've tried clear entry buffer but it doesn't seem to work.
Well, this is my first post so I apologize if it's too long. I'm going to try and include the source code and a picture, but I don't know exactly how it works.
If you run the code, you'll have to hit the [Enter] button on Captain, then [Enter] button on Launch to remove the viewport mask. [Downarrow] to Bridge, hit [Enter] to go to main menu. [Downarrow] to Navigator, hit [Enter] then hit [Enter] again on Maneuver. The 3d starfield should appear. Other cautions: I have no idea about how fast this will be on other machines. Also, you might need to change the font if the one I use isn't on your system.
Thanks!