Conflicting Death Rules

I'm having resolving death rules for my two actors. Here's the set-up. Rule One: When Actor 1 jumps on Actor 2, Actor 1 dies. Rule Two: When Actor 1 walks into Actor 2, Actor 2 dies. The second rule works fine. But when I test rule 1, rule 2 kicks in as well. How do I set it so they work independent of each other?

Rule 1 dictates: Actor 1 is destroyed when:
A) Actor 1 overlaps / collide with Actor 2
B) Actor 1 Y-Position is greater(>) than Actor 2

Rule 2 dictates: Actor 2 is destroyed when:
A) Actor 1 overlaps / collides with Actor 2
B) Actor 1 width is greater(>) than Actor 2

Any help would be greatly appreciated.

Comments

  • joshiwujoshiwu Member Posts: 207
    You did a lot of typing but not a lot of explaining. In rule two you have used the word width. THis is not correct. you need to register the Y location of the actors either constantly or on collide.

    Once you have both Y coordinates you will say if self .pos.Y is >= Target Pos.y(and colliding with player) Do action
    Else if <= targ.pos (and collide) do other. =)

  • WaymonWWaymonW Member Posts: 2
    edited July 2013
    Got it working. For those wondering, Joshiwu is partially correct in referencing the pos. Y, but that was not enough. I had to reference an additional attribute before fit worked. In my case, I had a boolean attribute to refer to ('Jumping' -> True/False), but you can use other things as well.
Sign In or Register to comment.