Example #1
0
        public BasicBody(AbstractEntity entity, Vector2 position, float size)
            : base()
        {
            this.entity = entity;
            this.position = position;
            this.size = size;

            World world = Farseer.Instance.World;
            Body body = BodyFactory.CreateCircle(world, size, 1f);
            Bodies.Add(body);
            foreach (Fixture fixture in body.FixtureList)
                fixture.UserData = entity;
            body.UserData = entity;
            body.Friction = float.MaxValue;
            body.Restitution = 0.3f;
            body.CollisionCategories = Category.None;
            body.OnCollision += new OnCollisionEventHandler(onCollision);
        }
 public virtual void OnSeperation(AbstractEntity collidedWith)
 {
 }
 public virtual bool WillCollide(AbstractEntity collidedWith)
 {
     return true;
 }
 public virtual void OnCollision(AbstractEntity collidedWith)
 {
 }