Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
poke and pset
#11
I am not an expert on the necessary size for sprite-saving arrays, and, if you are running out of memory and have many sprites in arrays, you will have to look up the available information on this, which is great.  So, from my limited use and knowledge, here are some beginning pointers:

In your BSAVE code snippet, you dimensioned your array as
DIM sprite1(1 TO 675)
Since you are saving a sprite that is 15 values wide and 13 values high, your array only needs to have 15*13 = 195 elements.  So, I used, with perfect results:
DIM sprite1(1 to 195)

Next, in your BSAVE line, you show:
BSAVE "sprite1.GRH", VARPTR(sprite1(1)), 2700
Since the array now only has 195 elements, its length is only 195+4=199 bytes long, so, I used, with perfect results:
BSAVE "sprite1.GRH", VARPTR(sprite1(1)), 199
Note: If you use the length as a one of the values 195, 196, 197, or to 198, you will get an incomplete sprite when you BLOAD the sprite array!

In your BLOAD snippet, of course, you must also dimension your array to match the dimension used in the BSAVE snippet, so, the DIM line must be:
DIM sprite1(1 to 195)

Also, you must not forget to include, in the BLOAD snippet, the line,
SCREEN 13
somewhere before you use any graphics commands.  I like to include it a the very beginning, as the first line.

As to your two questions,
"is this the best/stablist  way to do tiles or is there some other way more common people use?"
and
" couldnt find any examples of how to use write to make a sprite/tile using the pset read get thing that makes sprites. how do i?"
I don't really know what the answers might be.  I'm sure that someone else will be able to reply to that.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)