Exemplo n.º 1
0
 public static Body CreateBalloon(
     Vector3 target,
     Vector3 position,
     ComponentManager componentManager,
     ShipmentOrder order,
     Faction master)
 {
     return(new Balloon(componentManager, position, target, order, master));
 }
Exemplo n.º 2
0
        public Balloon(ComponentManager Manager, Vector3 Position, Vector3 Target, ShipmentOrder Order, Faction Owner) :
            base(Manager, "Balloon", Matrix.CreateTranslation(Position), new Vector3(0.5f, 1, 0.5f), new Vector3(0, -2, 0))
        {
            this.Target = Target;
            this.Order  = Order;
            this.Owner  = Owner;

            InitializeCosmetics();
            AddChild(new BalloonAI(Manager, Target, Order, Owner));
        }
Exemplo n.º 3
0
 public BalloonAI(ComponentManager Manager, Vector3 target, ShipmentOrder shipment, Faction faction) :
     base("BalloonAI", Manager)
 {
     VelocityController = new PIDController(0.9f, 0.5f, 0.0f);
     MaxVelocity        = 2.0f;
     MaxForce           = 15.0f;
     TargetPosition     = target;
     State            = BalloonState.DeliveringGoods;
     Shipment         = shipment;
     Faction          = faction;
     CurrentResources = new List <ResourceAmount>();
 }
Exemplo n.º 4
0
        public Balloon(ComponentManager Manager, Vector3 Position, Vector3 Target, ShipmentOrder Order, Faction Owner) :
            base(Manager, "Balloon", Matrix.CreateTranslation(Position), new Vector3(0.5f, 1, 0.5f), new Vector3(0, -2, 0))
        {
            this.Target = Target;
            this.Order  = Order;
            this.Owner  = Owner;

            CreateCosmeticChildren(Manager);
            CollisionType = CollisionType.Dynamic;

            AddChild(new BalloonAI(Manager, Target, Order, Owner));
        }
Exemplo n.º 5
0
 public BalloonAI(Body body, Vector3 target, ShipmentOrder shipment, Faction faction)
     : base("BalloonAI", body)
 {
     Body = body;
     VelocityController = new PIDController(0.9f, 0.5f, 0.0f);
     MaxVelocity = 2.0f;
     MaxForce = 15.0f;
     TargetPosition = target;
     State = BalloonState.DeliveringGoods;
     Shipment = shipment;
     Faction = faction;
     CurrentResources = new List<ResourceAmount>();
 }
Exemplo n.º 6
0
        public static Body CreateBalloon(Vector3 target, Vector3 position, ComponentManager componentManager, ContentManager content, GraphicsDevice graphics, ShipmentOrder order, Faction master)
        {
            Body balloon = new Body("Balloon", componentManager.RootComponent,
                                    Matrix.CreateTranslation(position), new Vector3(0.5f, 1, 0.5f), new Vector3(0, -2, 0));

            SpriteSheet  tex    = new SpriteSheet(ContentPaths.Entities.Balloon.Sprites.balloon);
            List <Point> points = new List <Point>
            {
                new Point(0, 0)
            };
            Animation balloonAnimation = new Animation(graphics, new SpriteSheet(ContentPaths.Entities.Balloon.Sprites.balloon), "balloon", points, false, Color.White, 0.001f, false);
            Sprite    sprite           = new Sprite(componentManager, "sprite", balloon, Matrix.Identity, tex, false)
            {
                OrientationType = Sprite.OrientMode.Spherical
            };

            sprite.AddAnimation(balloonAnimation);

            Matrix    shadowTransform = Matrix.CreateRotationX((float)Math.PI * 0.5f);
            Shadow    shadow          = new Shadow(componentManager, "shadow", balloon, shadowTransform, new SpriteSheet(ContentPaths.Effects.shadowcircle));
            BalloonAI balloonAI       = new BalloonAI(balloon, target, order, master);

            MinimapIcon minimapIcon = new MinimapIcon(balloon, new ImageFrame(TextureManager.GetTexture(ContentPaths.GUI.map_icons), 16, 2, 0));

            return(balloon);
        }