Reply to Re: How to...
If you don't have an account, just leave the password field blank.
@Kyle
It does not!As long as you don't set it to a frame that doesn't exist. It sets the sp_pframe to a specific value when the variable is more (or equal to) an value. What you are thinking about kyle would be something like:
which would stop working when &counter is more than the number of frames in the seq, and could be fixed with a
@Sparrowhawks:
Wouldn't that make the sprite flicker between frames, if even only for a so short time that it's impossible to see? Wouldn't it be better to write:
It does not!As long as you don't set it to a frame that doesn't exist. It sets the sp_pframe to a specific value when the variable is more (or equal to) an value. What you are thinking about kyle would be something like:
void main(void) { int &counter; } void hit(void) { &counter += 1; sp_pframe(¤t_sprite, &counter); }
which would stop working when &counter is more than the number of frames in the seq, and could be fixed with a
if(&counter == 10) &counter = 1;between &counter += 1 and sp_pframe.
@Sparrowhawks:
Wouldn't that make the sprite flicker between frames, if even only for a so short time that it's impossible to see? Wouldn't it be better to write:
. . . if(&counter >= 5) { if(&counter < 10) { //desired frame here. } } . . .