Help with collision

conrad74conrad74 Member Posts: 50
edited November -1 in Working with GS (Mac)
I have an enemy actor in which every 2 seconds he flashes his sword. After he does this for 2 seconds, he puts it away. How would I go about it so that every time the main actor runs into the enemy when he is flashing the sword, he dies; but when the enemy is not flashing the sword, the main actor doesn't die. Any help, or ideas would be greatly appreciated. Thanks!

Comments

  • AsymptoteellAsymptoteell Member Posts: 1,362
    Make it when he flashes his sword, a game attribute is changed to say 1. When that attribute is 1 and the actors collide, make the enemy die. When he isn't flashing his sword, change it back to 0.
  • conrad74conrad74 Member Posts: 50
    I believe that is the right idea but since it is an animation, how does it know that the enemy is flashing the sword halfway through the animation?
  • AsymptoteellAsymptoteell Member Posts: 1,362
    The only way I know is to use a timer based on how long the animation takes.
  • conrad74conrad74 Member Posts: 50
    I believe I may have solved this. For others who may need help on this in the future, you just need to create a rule that says if: "self.Image" contains "blank.jpg" (whatever name is the image - in this case, the image with the sword) then turn "killedbySword" game attribute to "1." Otherwise, turn "killedbySword" game attribute to "0."
  • DrGlickertDrGlickert Member Posts: 1,135
    Theory sounds right. Hopefully it works!
Sign In or Register to comment.