Invisible Colors
Moderators:Administrator, Global Moderator
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?
Justly is our impending doom thrust upon us, for mightily did we scar Gaia with our conquest out of laze, and so long coming has been our demise. You have been warned. The anguish is yours. -Aaron-
-
- QBasic God
- Posts:166
- Joined:Tue Mar 25, 2003 12:45 am
- Location:U.S.A.
- Contact:
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.
Come check out [url=http://www.freebasic.net/forum/index.php]FreeBASIC[/url]. The syntax is based on QuickBasic, but it expands to use pointers, operator overloading, etc... The list goes on and on!
-
- QBasic God
- Posts:166
- Joined:Tue Mar 25, 2003 12:45 am
- Location:U.S.A.
- Contact:
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!
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!
Come check out [url=http://www.freebasic.net/forum/index.php]FreeBASIC[/url]. The syntax is based on QuickBasic, but it expands to use pointers, operator overloading, etc... The list goes on and on!
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!
*speaking in Yoda tongues out of sheer excitement for STAR WARS EPISODE III*
Try your program I will. No. DO! There is no try!
Justly is our impending doom thrust upon us, for mightily did we scar Gaia with our conquest out of laze, and so long coming has been our demise. You have been warned. The anguish is yours. -Aaron-
-
- QBasic God
- Posts:166
- Joined:Tue Mar 25, 2003 12:45 am
- Location:U.S.A.
- Contact:
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...
Justly is our impending doom thrust upon us, for mightily did we scar Gaia with our conquest out of laze, and so long coming has been our demise. You have been warned. The anguish is yours. -Aaron-
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?
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?
Justly is our impending doom thrust upon us, for mightily did we scar Gaia with our conquest out of laze, and so long coming has been our demise. You have been warned. The anguish is yours. -Aaron-
-
- QBasic God
- Posts:166
- Joined:Tue Mar 25, 2003 12:45 am
- Location:U.S.A.
- Contact:
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?
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."
Code: Select all
Put(X,Y), Sprite(n,n), TRANS
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?
Come check out [url=http://www.freebasic.net/forum/index.php]FreeBASIC[/url]. The syntax is based on QuickBasic, but it expands to use pointers, operator overloading, etc... The list goes on and on!
I'm beginning to think FB pays you to post here. So for what quantity of gold did you sell your soul?!
Only joking.
Only joking.
Justly is our impending doom thrust upon us, for mightily did we scar Gaia with our conquest out of laze, and so long coming has been our demise. You have been warned. The anguish is yours. -Aaron-
-
- QBasic God
- Posts:166
- Joined:Tue Mar 25, 2003 12:45 am
- Location:U.S.A.
- Contact:
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.
Come check out [url=http://www.freebasic.net/forum/index.php]FreeBASIC[/url]. The syntax is based on QuickBasic, but it expands to use pointers, operator overloading, etc... The list goes on and on!