Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 public virtual void OnSeperation(AbstractEntity collidedWith)
 {
 }
Ejemplo n.º 3
0
 public virtual bool WillCollide(AbstractEntity collidedWith)
 {
     return true;
 }
Ejemplo n.º 4
0
 public virtual void OnCollision(AbstractEntity collidedWith)
 {
 }