Force of hit on actor

jon2sjon2s Member Posts: 40
edited November -1 in Working with GS (Mac)
I've been trying to figure this out for awhile and just can't figure it out. What I am trying to do is determine how hard an actor was hit. For example in a cannon game if the cannon ball hits an actor and is flying through the air and a good rate it should destroy the actor. If it is just barely rolling it shouldn't. If the cannon ball hits a block that just barely hits an actor it shouldn't destroy the actor but if the block is falling at a good rate, it should. My problem is I just can't figure out what the force of an actor A hitting actor B to determine if actor B should be destroyed or have hit points dropped down.

Hope this makes sense. Thanks,

Jon

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    You can keep track of the linear velocity of an Actor, which is what you'll want in your case.

    essentially:

    When Actor overlaps or collides
    When self.linear.velocity.Y > whatever
    .....do something
  • jon2sjon2s Member Posts: 40
    Thanks, I will give this a shot. =)
Sign In or Register to comment.