Posts: 77
Threads: 15
Joined: Mar 2004
Sprite(1000) means you can have 1000 pixels max in that sprite. Sprite(100) means you can have 100 pixels max in that sprite.
Basically, Sprite(n) means you can have n pixels max in that sprite.
nd remember kids, only you can provoke forest fires!
Posts: 319
Threads: 68
Joined: Mar 2005
yes i know but does it really matter
his world has been connected...
Tied to the darkness.
Soon to be completely eclipsed.
There is so very much to learn...
You understand so little.
A meaningless effort.
One who knows nothing can understand nothing.
-Ansem Bringer of darkness and creator of the heartless
if youre in screen 13, using INTEGER arrays to store data, the formula is
((x * y) \ 2) + 2 number of indices to hold a sprite of dimensions x,y.
btw sprite(1000) actually has 1001 indices
anywho
you could fit a 50*40 sprite in sprite%(1001) (2000 pixels in 1002 indices)
((50 * 40) \ 2) + 2 = 1002
sorry, just didnt want you guys to learn wrong
edit: and the difference is, the more indices you use, the more mempry your prog will use. if youre using integer arrays (which i HIGHLY recommend) you will use 2 bytes per index. so the above example with sprite%(1001) will use 2004 bytes.
Posts: 116
Threads: 5
Joined: Jul 2004
Quote:Personally, I like to use multi-dimensional arrays for sprites. If you're a beginning QBasic programmer though, you'll probably want to use a single dimensional array because of simplicity.
Umm, a multi-dimensioned array I feel would be easier for a beginner, than a single dimensioned one.
(That's ofcourse if all the frames of the sprite are the same size.
Nemesis
Posts: 6,419
Threads: 74
Joined: Mar 2002
Quote:na_th_an Wrote:It's the same, but the 2D array approach isn't forwards compatible with FB as it uses row order as opposed to QB which uses column order, so you have to change the order of your dimmensions to make the source compilable in FB.
AARGH!!! Where did you get the info?? Now I understand some things...
I noticed it when I was first testing lillo's GFXlib by porting some old code. I told him that he should include this detail in the docs. I guess he hasn't... or maybe you didn't RTFM
:lol:
Posts: 1,407
Threads: 117
Joined: Dec 2002
Lillo did his homework.. it is in TFM, in the PUT section.
Antoni
Posts: 319
Threads: 68
Joined: Mar 2005
ok so what should you use if your doing a background
his world has been connected...
Tied to the darkness.
Soon to be completely eclipsed.
There is so very much to learn...
You understand so little.
A meaningless effort.
One who knows nothing can understand nothing.
-Ansem Bringer of darkness and creator of the heartless