zeldaking wrote:
For sprites, I was planning on using 16 or even 8 bit bitmaps. But I got a problem, I thought 16-bit has plenty of colors and shades but for some reason in paint using 16-bit it changed brown to a green and pink to gray, etc. I was wondering how come?
Are you using SourceCoder to do the image conversions? You might be using 16-bit sprites with not-16-bit sprite routines, or vice versa.
I am going to be using multiple sprites for the rotation of the ship, since this is faster and easier than using trig to figure out the lines. So I have a few questions, is there any way similair to axe to store sprites and just add an offset to the appropriate sprite?
Example of what I mean:

Code:

//sprite data
XORSprite( Sprite_MemLoc+Offset ,X, Y, W, H); //where offset is known offset

If that doesn't make sense, I can explain it another way.
If I can do it this way it would be loads easier than:

Code:

if (sprite_num==1) XORSprite( sprite_1, X, Y, W, H);
if (sprite_num==2) XORSprite( sprite_2, X, Y, W, H);
if (sprite_num==3) XORSprite( sprite_3, X, Y, W, H);
//etc

Thanks for the help.
Yes, many, many languages did it before Axe ever had anything like that. You simply put the sprites sequentially in RAM, and add (index*sizeof(each_sprite)) to get to the one you want. Alternatively, you create a Look-Up Table (LUT) of pointers to sprites:

Code:
const void* shipLUT[4] = {ShipUp,ShipLeft,ShipDown,ShipRight};
I have never used a LUT, although I have explored them in z80 so I might need a bit of help. Is this a good way to do it?

Code:

int Ship_Dir=1; //offset # in LUT
XORSprite( shipLUT[Ship_Dir], X, Y, H, W);

If not please correct me, thanks.
Yes, that would work nicely. You'd also want to change the const void* on the shipLUT to whatever the type of your sprites is, whether const char*, const color_t*, etc.
Well summer has been very busy for me, so I haven't had time to program very much. This post is just to confirm that I am still working on it. I am working on movement right now. It seems to be working nicely atm.
zeldaking wrote:
Well summer has been very busy for me, so I haven't had time to program very much. This post is just to confirm that I am still working on it. I am working on movement right now. It seems to be working nicely atm.
Great, keep up the good work. Let us know if you need help with the sprite situation, or deciding between sprites and vectors.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 5 of 5
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement