Ejemplo n.º 1
0
        public BadGuy(Vector2 GridPos, Color color, int id, BodyType bodType, int circleRadius)
            : base("mobs/Boar", GridPos, "Snake" + id, GetRandDir(), 15, 0, id)
        {
            circle = BodyFactory.CreateCircle(Globals.World, radius: .14f, density: 1f);
            Sprite = new FarseerPhysics.SamplesFramework.Sprite(Globals.AssetCreatorr.TextureFromShape(circle.FixtureList[0].Shape,
                                                                                MaterialType.Squares,
                                                                                color, 1f));
            circle.LinearDamping = 1.5f;
            circle.AngularDamping = 3f;

            circle.BodyType = bodType;

            Vector2 pos = GridPos;// Globals.map.GetRandomFreePos();
            circle.Position = new Vector2(pos.X * TileWidth, pos.Y * TileHeight);
            circle.Friction = 0.0f;

            Wiskers[0] = new Wisker(attatched: circle, offSet: 0, WiskerLength: 1f);
            Wiskers[1] = new Wisker(attatched: circle, offSet: (float)Math.PI / 4f, WiskerLength: 1f);
            Wiskers[2] = new Wisker(attatched: circle, offSet: (float)Math.PI / -4f, WiskerLength: 1f);
            CircleSensor = new CircleSensor(attatched: circle, color: Color.Green, radius: circleRadius);
            PieSliceSensor = new PieSlice(circle, new Color(10, 10, 10, 50), 1f);
        }
Ejemplo n.º 2
0
 public Player(ContentManager content, Vector2 GridPos)
     : base(GridPos, Color.Purple, 0, FarseerPhysics.Dynamics.BodyType.Dynamic, 1)
 {
     PieSliceSensor = new PieSlice(circle, new Color(10, 10, 10, 90), 2f);
 }