How to update sprite attributes?


Established Member
Hey guys,

I'm making (slow) progress on my game. I've got sprites working, and moving around the screen without a hitch. Now I'm working on some fancier stuff. How do I flip a sprite?

Looking at Reinhart's animation source:

SPR_ATTR attr[] = {









It's obvious you have to use the sprNoFlip and sprHflip commands. Instead of having multiple definitions for everything, shouldn't there be a way to change the option on the fly?

I've tried sompething like this:



attr[6] = SPR_ATTRIBUTE(6,No_Palet,No_Gouraud,CL32KRGB|ECdis,sprHflip);

But those don't compile. I move sprites around the screen in a similar way, but that works. Any advice? Also, what doc discusses sprites in C? Thanks in advance.


Established Member
Thanks CWX, it works, but with a weird warning: main.c:360: warning: large integer implicitly truncated to unsigned type.

Any word on which docs you pulled this info from? Or at minimum the struct defintions?
Any word on which docs you pulled this info from? Or at minimum the struct defintions?

I got it from sl_def.h. It looks like sprHflip has a value that doesn't normally fit in dir. I'm guessing SPR_ATTRIBUTE gets around that problem by anding the value by 0x0F3F. So if you really find the warning annoying, try doing that.

Cyber Warrior X


Mid Boss
try this:

if (character_flip != '\0') {

  attr[6] |= sprHflip;

} else {

  attr[6] &= ~sprHflip;

Sorry for bumping an old thread but I'm facing the same issue and none of the posts actually fixed the problem.

Maybe one of you guys got it working ?

Using the Rockin-B game tutorial this is the part of the code I want to modify :

        if((push & PER_DGT_TL) == 0) {

       	if(--current < 0)

                current = 4;

     	//   	SPR_ATTR SON =

                attr_SON[3].dir = (sprHflip&0x0f3f);

The code compiles fine but it's not working in the demo. I can't get the Sprites to Hflip. :/

Any suggestions ?

I saw your PM, I did a basic tutorial for sprites manipulation in it's a spanish web for saturn. You don't know spanish?, it's not a problem because the code is in english; you can download the code too.


I will release the new version beta.

I making a 2D engine for saturn, including tools for sprite packing and level editors. The big problem is the Sound!

The posible next games are:

Splatter House, Sunset Riders or Lethal Enforces I
Thank you for responding FacundoARG.

Also, this is AMAZING ! Good job !

Thank you so much for a detailed tutorial. I'll translate it np.

Funny that I'm using Sonic as well for animation. I'm thinking of Maybe trying to port the CD version to saturn lol.

But who knows.

Looking forward to the beta version and the engine as well.