public ActionScreen(Game game, SpriteBatch spriteBatch, Viewport vp)
     : base(game, spriteBatch)
 {
     tMap = new Terrain(game);
     cam = new Camera2D(vp);
     unit = new Building(spriteBatch, game, cam, mouse);
 }
Ejemplo n.º 2
0
 public BandUList(Game game, SpriteBatch sB, Camera2D cam, Texture2D image, Vector2 pos, Building.BuildingList bL)
 {
     this.spriteBatch = sB;
     this.cam = cam;
     structPos = pos;
     bPos = structPos;
     structImg = image;
     bList = bL;
     UpgradeImage = game.Content.Load<Texture2D>("Upgrade");
     BuildImage = game.Content.Load<Texture2D>("Build");
     initialBuild = new BuildandUpgrade(sB, cam, BuildImage, pos);
     initialUpgrade = new BuildandUpgrade(sB, cam, UpgradeImage, pos);
 }
Ejemplo n.º 3
0
        //****************************************
        // THIS IS FOR THE BUILDING CLASS
        //****************************************
        public UI(Game game, SpriteBatch spriteBatch, Camera2D cam, MouseHandler mH, Building b)
        {
            this.game = game;
            this.spriteBatch = spriteBatch;
            this.cam = cam;
            this.mH = mH;

            pos = new Vector2(b.Position.X, b.ImageRec.Height);
            size = new Rectangle((int)b.Position.X, (int)b.Position.Y, b.ImageRec.Width / 10, 10);
            progBox = game.Content.Load<Texture2D>("UtilityTextures/RedBox");
            healthBox = game.Content.Load<Texture2D>("UtilityTextures/RedBox");
            sBar = new StatusBar(pos, healthBox, health, size, "Right", spriteBatch, cam);

            //font
            spriteName = game.Content.Load<SpriteFont>("menufont");
            fontLoc = new Vector2(b.Position.X, b.Position.Y - 10);
            name = b.UnitName;
            //Console.WriteLine("Font Location: " + fontLoc.X + ", " + fontLoc.Y);
        }
Ejemplo n.º 4
0
        public void Update(GameTime gameTime, Building b)
        {
            GetObject(b);

            //Console.Clear();
            //Console.WriteLine("Lower Left Corner: " + pos);
            //Console.WriteLine("Upper Right Corner: " + b.Position);
            //Console.WriteLine("Size of object (w, H): " + b.Image.Width + ", " + b.ImageRec.Height);
            //Console.WriteLine("Size of Health Bar: " + size.Width + ", " + size.Height);
            //Console.WriteLine("Font Location: " + fontLoc.X + ", " + fontLoc.Y);
        }
Ejemplo n.º 5
0
        private void GetObject(Building b)
        {
            pos = new Vector2(b.Position.X, b.ImageRec.Height + b.Position.Y);

            //font
            name = b.UnitName;
            fontLoc.X = b.Position.X;
            fontLoc.Y  =  b.Position.Y - 20;
            //end font

            health = b.Health;

            size = new Rectangle((int)pos.X, (int)pos.Y, b.ImageRec.Width / 10, 10);
            h = new Texture2D[health];
            sBar = new StatusBar(pos, healthBox, health, size, "Right", spriteBatch, cam);
        }