The Dink Network

Reply to Re: How to...

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
October 22nd 2010, 11:00 AM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
@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:

void main(void)
{
    int &counter;
}
void hit(void)
{
    &counter += 1;
    sp_pframe(&current_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.
    }
}
.
.
.