Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: xenogia on Sat 02/05/2009 11:00:15

Title: Change Offsets of Shadows
Post by: xenogia on Sat 02/05/2009 11:00:15
I am trying to manual change the offset of shadows while a character is working depending on the angle.  And I can't seem to get it to work, also what I am trying to do is once he has stopped walking it also changes the shadow offset.  Check it out and see what I am doing wrong?


function repeatedly_execute() {
 
  if ((cMichael.View == (1)) && (cMichael.Animating == (true))) {
    if ((cMichael.Loop == (5) || cMichael.Loop == (7))) {  // diagonal upper left and right
      eShadow.SetScale (cMichael, 130);
      eShadow.SetOffset (cMichael, -16, 0);
    }
    if ((cMichael.Loop == (3) || cMichael.Loop == (0))) { // up and down
      eShadow.SetScale (cMichael, 100);
      eShadow.SetOffset (cMichael, -5, 0);
    }
    if ((cMichael.Loop == (1) || cMichael.Loop == (2))) { // left and right
      eShadow.SetScale (cMichael, 80);
      eShadow.SetOffset (cMichael, -6, 0);
    }
    if ((cMichael.Loop == (4) || cMichael.Loop == (6))) { // diagonal down left and right
      eShadow.SetScale (cMichael, 80);
      eShadow.SetOffset (cMichael, -6, 0);
    }
  }

  if ((cMichael.View == (1)) && (cMichael.Animating == false)) {
    if ((cMichael.Loop == (5) || cMichael.Loop == (7))) {
      eShadow.SetScale (cMichael, 80);
      eShadow.SetOffset (cMichael, -2, 0);
    }
   
  }
 


}
Title: Re: Change Offsets of Shadows
Post by: GarageGothic on Sat 02/05/2009 11:05:52
Try using the Character.Moving property instead of Character.Animating. Also, you may want to put this in repeatedly_execute_always rather than repeatedly_execute so it isn't stopped by blocking routines.
Title: Re: Change Offsets of Shadows
Post by: xenogia on Sat 02/05/2009 11:19:21
Cheers GarageGothic that worked perfectly :)