Invisible Colors

Please use this Board for QBasic related requests ( file research, programming, etc.)

Moderators:Administrator, Global Moderator

Post Reply
User avatar
~XUS~
Full Member
Posts:27
Joined:Tue Feb 01, 2005 9:08 pm
Contact:
Invisible Colors

Post by ~XUS~ » Mon Apr 04, 2005 1:39 am

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-

Dr_Davenstein
QBasic God
Posts:166
Joined:Tue Mar 25, 2003 12:45 am
Location:U.S.A.
Contact:

Post by Dr_Davenstein » Mon Apr 04, 2005 3:56 am

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!

User avatar
~XUS~
Full Member
Posts:27
Joined:Tue Feb 01, 2005 9:08 pm
Contact:

Post by ~XUS~ » Tue Apr 05, 2005 7:09 pm

I'll try. Thanks for the offer. What are these flickering techniques, just so i can occupy myself?
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-

Dr_Davenstein
QBasic God
Posts:166
Joined:Tue Mar 25, 2003 12:45 am
Location:U.S.A.
Contact:

Post by Dr_Davenstein » Tue Apr 05, 2005 11:42 pm

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! :P
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!

User avatar
~XUS~
Full Member
Posts:27
Joined:Tue Feb 01, 2005 9:08 pm
Contact:

Post by ~XUS~ » Wed Apr 06, 2005 3:37 am

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!
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-

Dr_Davenstein
QBasic God
Posts:166
Joined:Tue Mar 25, 2003 12:45 am
Location:U.S.A.
Contact:

Post by Dr_Davenstein » Wed Apr 13, 2005 7:33 am

So... Have you tried it yet? :P
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!

User avatar
~XUS~
Full Member
Posts:27
Joined:Tue Feb 01, 2005 9:08 pm
Contact:

Post by ~XUS~ » Mon Apr 25, 2005 11:03 pm

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-

User avatar
~XUS~
Full Member
Posts:27
Joined:Tue Feb 01, 2005 9:08 pm
Contact:

Post by ~XUS~ » Thu Apr 28, 2005 12:53 am

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?
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-

Dr_Davenstein
QBasic God
Posts:166
Joined:Tue Mar 25, 2003 12:45 am
Location:U.S.A.
Contact:

Post by Dr_Davenstein » Thu Apr 28, 2005 9:23 am

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."

Code: Select all

Put(X,Y), Sprite(n,n), TRANS
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? :P
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!

User avatar
~XUS~
Full Member
Posts:27
Joined:Tue Feb 01, 2005 9:08 pm
Contact:

Post by ~XUS~ » Fri Apr 29, 2005 1:17 am

I'm beginning to think FB pays you to post here. So for what quantity of gold did you sell your soul?!

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-

Dr_Davenstein
QBasic God
Posts:166
Joined:Tue Mar 25, 2003 12:45 am
Location:U.S.A.
Contact:

Post by Dr_Davenstein » Fri Apr 29, 2005 8:39 am

:lol:

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!

Post Reply