/// <summary> /// Creates a new instance of ConstrainToRectangleBehavior. /// </summary> /// <param name="rectangle">The rectangle within which the actor is to be trapped.</param> public ConstrainToRectangleBehavior(ActorManager actorManager, Rectangle rectangle, Physics.Enums.CollisionCategories collisionCategory) : base(actorManager) { this.rectangle = rectangle; this.collisionCategory = collisionCategory; }
/// <summary> /// This just kills the actor if it's hit something. /// </summary> public bool CollisionHandler(Physics.Collisions.Geom geom1, Physics.Collisions.Geom geom2, Physics.Collisions.ContactList contacts) { parentActor.Kill(); return true; }