The Dink Network

Reply to Re: Add sprite in script

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:
 
 
September 25th 2009, 11:12 AM
spike.gif
It could be that you need to use sp_seq() instead of sp_frame() to start it, I don't really remember for sure.

Anyhow, declaring variables in a procedure like use() may be a bad idea, if it creates a new instance of the variable every time you use the spell (there's a limit on how many variables can be active on a screen at a time)- I don't remember if that's really the case, but if so, you should declare the variables in the arm() procedure.

The graphic naming (unless they are in some toher format than .BMP) and .ini lines look good, though. Demonstration script for clarity:

void use(void)
{
say("Cure!!", 1);
&dinkx = sp_x(1,-1);
&dinky = sp_y(1,-1);
&cross = create_sprite(&dinkx,&dinky,7,890,1);
sp_seq(&cross,890);
// the sp_frame() might be excess in this case
sp_frame(&cross,1);
// I added this here because you can punch the cross animation otherwise
sp_nohit(&cross,1);
&life += 5;
&life += &magic;
If (&life > &lifemax)
{
&life = &lifemax;
}
playsound(24,22050,0,0,0);
&magic_level = 0;
draw_status();

}

// add to void arm()
int &dinkx;
int &dinky;
int ✗