Page 1 of 1
Invisible Colors
Posted: Mon Apr 04, 2005 1:39 am
by ~XUS~
I made a bunch of art for my game, and surrounded the characters with color 100 (light blue). I was planning to make QBasic print everything but color 100, so that the tiles beneath the characters would show through. How can I do this after having saved the art into files to be opened and read to arrays upon execution?
Posted: Mon Apr 04, 2005 3:56 am
by Dr_Davenstein
Your best bet is to use a lib like DirectQB, or CosmoX... if you're using SCREEN 13, that is. Masking can be done without a library, but it flickers alot, unless you do some brute force double buffering. That's alot of work in itself though... Eh, just use
DirectQB. I can help you set it up, if you need.
Posted: Tue Apr 05, 2005 7:09 pm
by ~XUS~
I'll try. Thanks for the offer. What are these flickering techniques, just so i can occupy myself?
Posted: Tue Apr 05, 2005 11:42 pm
by Dr_Davenstein
Do yourself a favor, and try this program. It's free, totally legal and SOOOOooooo much better than QBasic!
http://www.hot.ee/fbide/FBIde033.exe
Plenty of examples in the package, plus a
huge community that's willing to answer the most(dumb sounding to you!) questions. Also, your programs will run on almost any computer! I mean they will even run on Linux!
Posted: Wed Apr 06, 2005 3:37 am
by ~XUS~
Nice are you.
*speaking in Yoda tongues out of sheer excitement for STAR WARS EPISODE III*
Try your program I will. No. DO! There is no try!
Posted: Wed Apr 13, 2005 7:33 am
by Dr_Davenstein
So... Have you tried it yet?
Posted: Mon Apr 25, 2005 11:03 pm
by ~XUS~
Woah! Sorry for my long absence. I quit qb for 2 weeks or so. Yes I tried it. I couldn't get it to work, tho. I can't recall why not...
Posted: Thu Apr 28, 2005 12:53 am
by ~XUS~
Say I have my character saved in an array, right? I just loaded him up from a file "mainchar.gfx". Is there a way that while in the process of pasting him on the screen, I could use a FOR, NEXT loop to paste all colors except a certain color. Hypothetically, that would'nt flicker, and it'd solve my unbearable problem of having a character with a freakin' grey box around him. Any thoughts?
Also, using the OPEN _____ AS INPUT FOR #1 or whatever, how can I skip down to the next line of a file? How would I use this command to save/load an array for a tile-based map?
Posted: Thu Apr 28, 2005 9:23 am
by Dr_Davenstein
You can do it that way, but that would be
extremely slow in QB. There is a technique called bitmasking that does the trick, but it's a little tricky... and you'll still have flicker.
Why wont you give FB a shot? It's so easy to do what you're asking. Here's some pseudo code for putting an image on the screen in FreeBASIC without drawing the dreaded "grey box."
Yup, it's that easy. The only trick is to make sure the pixels you don't want to draw are pure black(0,0,0).
Go try this game. It was originally a QBasic game made by my friend.
http://www.geocities.com/szrrya/files/rjb.zip
That game is made with nothing but FreeBASIC.
To do that with QB, you would need an external library, ASM, or writing a bunch of PEEK/POKE routines.
Go try it out now, would ya's?
Posted: Fri Apr 29, 2005 1:17 am
by ~XUS~
I'm beginning to think FB pays you to post here. So for what quantity of gold did you sell your soul?!
Only joking.
Posted: Fri Apr 29, 2005 8:39 am
by Dr_Davenstein
They might as well be. Sorry, if it's getting on your nerves. It's just so much more than QB. I almost feel
obligated to spread the news. I bet it will actually give BASIC a better reputation... eventually.