The Dink Network

Reply to Re: Slow Ride... Take it easy!

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:
 
 
March 16th 2010, 01:54 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
Edit: Scratcher seemed to have snuck in while I was testing out my code

You mean like inside_box(int x, int y, int left, int top, int right, int bottom). You'd have to do a loop and possibly get_next_sprite_with_this_brain() to check all brain whatever monsters, but it could work. Use sp_custom() to keep track of who's speed has been modified to fix it later on. You'd need to do custom boxes to make it work in a lot of areas though.

Using a missile's damage procedure could also work. It could spawn a script to reduce speed, wait, then set it back. As long as the thing is touching the missile sprite, then the speed of it should keep being set lower. Well it has a few bugs though. The enemy's hit sound will constantly play when touching it, and I think it will force the enemy to target Dink if it touches the grass.

//missile brain
void main ()
{
int &b_speed
int &cur_speed;
sp_brain(&current_sprite,11);
sp_seq(&current_sprite,-1);
}

void damage ()
{
&b_speed = sp_custom("basespeed",&missile_target,-1);
 if (&b_speed == 0)
 {
 &b_speed = sp_speed(&missile_target,-1);
 sp_custom("basespeed",&missile_target,&b_speed);
 }
&cur_speed = sp_speed(&missile_target,-1);
  if (&cur_speed == &b_speed)
  {
   if (&cur_speed > 1)
   {
   &cur_speed -= 1;
   sp_speed(&missile_target,&cur_speed);
   
   &save_x = &missile_target;
   spawn("reset_spd")
   }
  }

}

//reset_spd
void main ()
{
script_attach(0);
int &sprite = &save_x;
wait(100);
int &speed = sp_custom("basespeed",&sprite,-1);
sp_speed(&sprite,&speed);
kill_this_task();
}