The Dink Network

Reply to Re: Wait times

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 24th 2024, 02:13 AM
death.gif
Seseler
Peasant He/Him Heard Island And Mcdonald Islands
 
I figured out a way to make a one frame wait!

All you have to do is to use move_stop with a sprite with a low enough timing and end position that is on opposing direction than the movement.

Here's a modified version of the animation loop from the previous message:

int &seq;

//Timing must be between 1 and 15, so the sprite movement is checked every frame.
sp_timing(&current_sprite, 1);

loop:
&seq = sp_seq(&current_sprite, -1);
if(&seq != 0)
{
	move_stop(&current_sprite, 2, -2147483648, 1);
	goto loop;
}
//Sprite done animating


Since the sprite does not need to move to reach the target, the move_stop returns immediately on the next time the sprite's brain activates, which (due to low sp_timing) is going to be the next frame. The sprite's speed and base walk do not matter and its position will not be changed.
If you don't want to mess with &current_sprite's timing you can create another sprite and use it for sp_timing and move_stop functions.