The Dink Network

Less than, more than...

January 9th 2006, 10:53 AM
bonca.gif
Christiaan
Bard They/Them Netherlands
Lazy bum 
Let's say the this is a script:

void main( void )
{
int &dam;
}

void hit( void )
{
&dam = sp_hitpoints(&current_sprite, -1);

if (&dam < 35)
{
say("`0I like pie", &current_sprite);
sp_speed(&current_sprite, 4);
move_stop(&current_sprite, 6, 162, 1);
move_stop(&current_sprite, 4, 162, 1);
move_stop(&current_sprite, 8, 156, 1);
move_stop(&current_sprite, 2, 156, 1);
sp_speed(&current_sprite, 2);
}

if (&dam < 30)
{
say("`0I like apples!", &current_sprite);
}
}

When the sprite has, say, 25 hitpoints, he will first say "I like pie" and do the move_stop, and after he's done with it, he will say "I like apples!"

This is because there is no <35>30 math supported, is there? I mean, I want him to say "I like apples" when he's below 30, not "I like pie".

Anyone know if there's a solution to this problem, or is just not supported in Dink?
Thanks.
January 9th 2006, 11:01 AM
spike.gif
if (&dam < 30)
{
say("`0I like apples!", &current_sprite);
return; / &dam = 99999;
}
if (&dam < 35)
{
say("`0I like pie", &current_sprite);
sp_speed(&current_sprite, 4);
move_stop(&current_sprite, 6, 162, 1);
move_stop(&current_sprite, 4, 162, 1);
move_stop(&current_sprite, 8, 156, 1);
move_stop(&current_sprite, 2, 156, 1);
sp_speed(&current_sprite, 2);
}

or

if (&dam > 29)
{
if (&dam < 35)
{
say("`0I like pie", &current_sprite);
sp_speed(&current_sprite, 4);
move_stop(&current_sprite, 6, 162, 1);
move_stop(&current_sprite, 4, 162, 1);
move_stop(&current_sprite, 8, 156, 1);
move_stop(&current_sprite, 2, 156, 1);
sp_speed(&current_sprite, 2);
}
}
January 9th 2006, 11:08 AM
bonca.gif
Christiaan
Bard They/Them Netherlands
Lazy bum 
I had just found that last way on the DinkC Reference, after searching for an hour or so. How the hell am I supposed to know < and > are called "bumps".

Thanks, scratch-man.