Qbasicnews.com

Full Version: Parralax Backgrounds with LINE and PAINT.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been trying to brainstorm about this forever and I just cannot fins a solution for this. In Cobra, I'm trying to include parralax backgrounds so it will look better and all... but when I tried putting it in, (I backed it up, don't worry), the line and paint commands didn't really do that nice of a job going on top of each other, so I was wondering, is there a way to maybe do some weird thing that resembled page flipping, but ignores a certain color, so I can maybe "page flip" a layer on top of the other?
You'll need libs, sorry. DirectQB has stuff to do what you like.

I've seen that you draw your backdrop using graphical primitives such as lines, circles and paint. You can do a nice trick to have a parallax:

Use a determined outline colour for the far layer, and use it with PAINT. You can use all colours but, for example, 0, which will be the outline colour for the near layer. When you draw the outlines OVER the far layer, and then use PAINT (x,y),colour,0 it will stop only on 0, and will over-draw the far layer ('cause it DOES NOT contain 0).

I did some tests in the past, and it seems to work. The bad point is when the PAINT coordinate falls out of screen: that polygon will remain empty.
here's a better solution: dont use vector graphics using qb's line and paint. seriously, you'll want bitmaps. then you can do all sorts of crazy things. especially if you use a library so it isnt so goddamned slow. or learned c. that works too, and surprisingly well.

but for cobra: yeah. use bitmap backgrounds in 13h.
Ok thanks, I need to find out how to use BMPS because then I can do a *WHOLE* lot more than I could with line and paint commands.
ive got a tut on loading BMPs in Pure QB. Il upload it later for you megaman..

a few moments later...

http://www.geocities.com/yourfriendthefreak/bmpqb.htm

there you go, hope it helps,

(PS, i got this tut of the net a while back, i hope the autor dosnt mind me posting it :oops: )
Quote:here's a better solution: dont use vector graphics using qb's line and paint. seriously, you'll want bitmaps. then you can do all sorts of crazy things. especially if you use a library so it isnt so goddamned slow. or learned c. that works too, and surprisingly well.

but for cobra: yeah. use bitmap backgrounds in 13h.

The vector graphics might be faster... if you didn't use the built-in line commands...
yeah, that's why i added the line and paint comment. there are actually quite a few hacks he could pull off. But for all efficiency purposes, you can pull off parallax scrolling in qb on a 486 if you use the right libs.
A 5 layer game made in CosmoX or/and Rellib would run fine on a 486. Al you need is a good design and powers of 2 sprites for solid. Transparent sprites soesn't need to be pow of 2 as it checks on a per pixel basis.

Parallax? just divide by any factor you want.
I'll be a little annoying here: as a priority, your game doesn't need to look better, but to play better. Did you see Milo's keyhandler routine? (and that suggested addition just for a start)

Just my opinion.
Quote:I'll be a little annoying here: as a priority, your game doesn't need to look better, but to play better. Did you see Milo's keyhandler routine? (and that suggested addition just for a start)

Just my opinion.

Yeah, and I believe you are ready for Libs.