Change Offsets of Shadows

Started by xenogia, Sat 02/05/2009 11:00:15

Previous topic - Next topic

xenogia

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?

Code: ags

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);
    }
    
  }
  

 
}

GarageGothic

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.

xenogia

Cheers GarageGothic that worked perfectly :)

SMF spam blocked by CleanTalk