Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sprite(1000) compared to sprite (10,10)
#11
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!
Reply
#12
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
Reply
#13
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.
Reply
#14
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. Smile

Nemesis
Reply
#15
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 Wink :lol:
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#16
Lillo did his homework.. it is in TFM, in the PUT section.
Antoni
Reply
#17
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)