Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / New Project, Need Help

Author
Message
Kamakazi
15
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: Moberly, Missouri
Posted: 1st Jul 2012 14:15
I am taking on my third game project. This one is based on an original idea I planned a long time ago for the Atari 8-bit computers. It's a 2D shooter currently being called Planet Defense. I am not sure if another game of the same name exists but for now this name will have to do.

Upon creating some of the basics I ran into an issue I am hoping someone here will know how to help solve. I am trying to get a score and high score text on my HUD but it is blacking out at the point the cursor is positioned. Is there any way to avoid this or is there another method? I am using the set cursor command followed by a print command.

Kamakazi
15
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: Moberly, Missouri
Posted: 1st Jul 2012 14:19
Forgot to share the code. Star field is borrowed from TGC's code database. I really liked it compared to the one I was going to use from the Atari code.

Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 1st Jul 2012 15:29
try the bitmap font kit
http://forum.thegamecreators.com/?m=forum_view&t=179885&b=8
it works well and runs fast.

I have no trouble keeping it on the top layer.

Sometimes I like to use words out of contents
Kamakazi
15
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: Moberly, Missouri
Posted: 1st Jul 2012 20:17
Wow! Awesome work Sven B! Only one question: how do I install this add-on: copy folders over DBPro's folders of the same name or what? I also tried to view Scraggle's website for some fonts to try out but their site is down I assume since I get a website not found error. Where can some BMP fonts be found? Thanks.
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 1st Jul 2012 22:57
This seems like the perfect time for me to shamelessly plug my Bitmap Font Creator

>Shameless plug<

Hope that helps

Kamakazi
15
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: Moberly, Missouri
Posted: 2nd Jul 2012 04:30
@ =PRoF= Thanks! Downloaded and will test it out tonight (after dinner).

But that still leaves how do I install the plug-in?
Kamakazi
15
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: Moberly, Missouri
Posted: 2nd Jul 2012 05:41
Wow...That Bitmap Font Creator is the bomb! Quick, easy and very efficient. Nice work! I have yet to test it with the plug in as I still need to install it but not sure how to do it.
nonZero
13
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 2nd Jul 2012 10:06 Edited at: 2nd Jul 2012 10:09
Quote: "But that still leaves how do I install the plug-in? "


If it is a standalone dll, copy the dll to:
[darkbasic install directory]/plugins-user/

Here's my path, for example (you'll notice it's the old path system as I only update my compiler and help/keyword/etc files because I hate the new editor):
Quote: "C:\Program Files (x86)\Dark Basic Software\Dark Basic Professional\Compiler\plugins-user"


You're install dir will likely be:
C:\Program Files\The Game Creators\Dark Basic Pro Free\...
for x86 Windows.

Or:
C:\Program Files (x86)\The Game Creators\Dark Basic Pro Free\...
for x64 Windows.

...Hope that wasn't overboard, am bad at explaining so I broke it down into byte-sized bits (now lol at my geek joke).

If it is not a standalone dll, you'd best actually post info on the package such as a file/folder listing. eg:

...And then maybe I, or someone else, could tell you what to do.

Kamakazi
15
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: Moberly, Missouri
Posted: 2nd Jul 2012 11:15
@nonZero Thanks. All I had to do was what you said: copy the files to the appropriate DBPro folder (namely Compiler, Editor and Help). It didn't have any TXT files for installation.

Now I have another question and I am going over the tutorial on 2D shoot'em ups and another 2D tutorial. I have also viewed the code database for any scroller examples but have not ran across what I am looking for...either that or what I am trying to do has not been done. As some might can tell from the image in my first post, the game will seem similar to Gradius or other 2D shooters. What I am trying to do is create the "environments" or levels in Photoshop, saving them in png format and am trying to scroll them from right to left (side scroller). Is this possible to do in DBPro? Or will tiles be the only way to do this? Level images I figure about 500 pixels high and about 2400 pixels or slightly more wide.

I am thinking I will have to use the Get Image command set at a specific point (like a camera dragging across the level image as if it were on paper). Am I on the right track?
nonZero
13
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 3rd Jul 2012 10:20 Edited at: 3rd Jul 2012 11:25
Gradius ftw! Oh sweet childhood... Back on topic though...

You can use a single sprite to hold your bg image. May be slower on some systems though as you aren't able to cull what's passed by like with tiles. However I think on today's pcs this is a negligable performance loss. The first thing I made with DBP was a vertical-scrolling shooter like Raiden Trad (I tried to aproach it like qbasic and looking back my source is a mess, lol). Anyway in my scroller I used a mixture of full length backgrounds and tiles (level-depending) as it was one of the things I wanted to investigate. Well ran well - even on a laptop!

So far as how to do it, there are two options:
1: Off-screen drawing (lots of it). Position all the enviroment entities at 0 + when the appear. You can sprite off-screen btw. Then use a FOR-loop to move them -1 (or your desired speed) each cycle.
2: Off-set. Use a variable to store your ship's distance travelled. Increase this variable by a speed factor each cycle. Now subtract this from the sprite location, eg: SPRITE mybg, 0 - camOffset, 0, mybg. Full credit to Agent for this method.

Personally I prefer method 1 as I find it more flexible and easier for a game like this. If you were making platformer, I'd say option 2 would prolly be easier for a beginner level.
I'm on my phone atm but will post some example code later.

[EDIT] Have added some examples, see below[/EDIT]

The above code illustrate scrolling sprite ranges with a function call. I threw in some extras on management which span across both examples.


The above shows using an offset-type method. You'll also note that my extras example with management explains using arrays for management. This method requires that you expand, shrink and shift arrays to get accurate results. Not a good idea unless you're experienced with data structures, however something to consider for educational purposes.

Hope this helps. If something isn't clear ask (I dunno how well I explained it).

*Disclaimer: This code will not run as-is (it's not meant to, it's an example). If there is a fault in something, I'm sorry. I'm busy drinking coffee, getting dressed and coding at the same time - I'm addicted to multi-tasking.

Lewis999
14
Years of Service
User Offline
Joined: 23rd Oct 2010
Location:
Posted: 3rd Jul 2012 23:28 Edited at: 3rd Jul 2012 23:29
For the first Question, you could also just use the
command
Then again, the method mentioned above it probably faster.

For the second question, I think using bitmaps might be a better solution, I haven't used sprites much but I'm sure drawing off screen can't be efficient (correct me if I'm wrong, as I said I don't use them much)

how about something like this:

image I used: http://en.wikipedia.org/wiki/File:Chicago_Downtown_Panorama.jpg

Using functions for this is kinda pointless, the update code is two lines and the setup is only a few.

Hope this is helpful, Lewis.
nonZero
13
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 4th Jul 2012 11:09
@Lewis:
I was also thinking the TEXT command and was going to suggest it until I saw just how much you could do with this Bitmap Font stuff and I have to admit it lends itself to a very clean and polished look (although I'd still personally use the TEXT command for basic jobs - I like to keep it straight and simple).

I like your bitmap trick for a scrolling background for single, static images. Tried it out with a sprite of a UFO (I won't even say how funny my MSPAINT UFO looked flying across Chicago ) and it worked well. A little resource-heavy, but definitely a better option for a simple sidescroller, especially on a beginner level. The only problem I have with this method is that it's not optimal for handling multiple independent background entities (for example some butterflies flitting about the flowers, etc).

Quote: "but I'm sure drawing off screen can't be efficient (correct me if I'm wrong, as I said I don't use them much)"

Resource-wise, it is not always efficient however with the right management, it can work very well but it the wrong hands it'll produce a nightmare. The main thing about using sprites and off-screen drawing is it can make life easier if you have very many different background entities moving at different speeds because you can simply draw them at their starting point and let the move function move them at their speed and the scroll speed. Also, off-screen drawing is sometimes exceedingly useful in de-bloating code in certain situations. Another thing, at least with regard to sprites, is that off-screen drawing can (when used within reason) provide smoother scrolling because there aren't a constant set of get-paste commands (I believe that's more or less how COPY BITMAP works but I'll stand corrected). So in short, the short answer is yes and no

An aside, you put the text command out of order in you example:
Quote: "
"

TEXT needs to be last or you paste the bitmap over it

That aside, great thinking out the box with your code!

Login to post a reply

Server time is: 2024-11-23 20:20:46
Your offset time is: 2024-11-23 20:20:46