256 color QBASIC

Started by
12 comments, last by Iron Eye 20 years, 6 months ago
Alright I''ve got a pretty good idea of whats happening in your code. But why do you loop 255 times? Are you just assuming its a bitmap thats 253 (theres 2 extra ones right?) pixels wide?
---
ConPong _//_ Google _//_ Chaos Forge - quick and easy file hosting for developers

"Games usually keep me from making my own..."
-Me
---



find your elementat mutedfaith.com.
Advertisement
quote:Original post by Iron Eye
Alright I''ve got a pretty good idea of whats happening in your code. But why do you loop 255 times? Are you just assuming its a bitmap thats 253 (theres 2 extra ones right?) pixels wide?




The for loop (for ctr = 0 to 255) is to read in the pallete information... there are 256 color values that you need to read in .

After this, I loop through the Width and Height of the bitmap and read it in value by value, plotting the pixel using pset. If you want a more generic method of rendering sprites (in QBasic anyways), you can either look at bload and bsave, or extend my method to support sprites as well.
quote:Original post by Ready4Dis
If you want a more generic method of rendering sprites (in QBasic anyways), you can either look at bload and bsave, or extend my method to support sprites as well.



Would it be a lot speedier to switch to bload and bsave?

Your method is really simple and easy to understand...which usually means speed is not of the essence....
---
ConPong _//_ Google _//_ Chaos Forge - quick and easy file hosting for developers

"Games usually keep me from making my own..."
-Me
---



find your elementat mutedfaith.com.
Heh, yes... bsave and bload or some other way is probably much faster . I used to have a bunch of old QB code, but I wiped my drive clean of QB stuff (I even had a 3d software engine with texture mapping that I wrote way back on my 386).

This topic is closed to new replies.

Advertisement