Exemple #1
0
        public void ShowUpgradeOptions(StationBlock s)
        {
            buttons.Clear();



            enabled = true;
        }
Exemple #2
0
        public Drone(Texture2D text,
                     double thrust, double diameter,
                     string name, double m, double hp,
                     double x = 0, double y = 0, double xDot = 0, double yDot = 0, StationBlock homeBlock = null)
        {
            type       = "miningDrone";
            baseDamage = 10;
            idNo       = name;

            theta     = 0;
            thetaDot  = 0;
            pos       = new Vector2((float)x, (float)y);
            posDot    = new Vector2((float)xDot, (float)yDot);
            posDotDot = new Vector2(0, 0);

            diam = diameter;

            thrustMax    = thrust;
            negThrustMax = .5 * thrustMax;


            maxHealth = hp;
            health    = maxHealth;

            maxShield = maxHealth * .1;
            shield    = maxShield;

            mass = m;

            drawPos = new Vector2(
                pos.X - (float)(diam * .5),
                pos.Y - (float)(diam * .5)
                );

            hitBox    = new Rectangle((int)drawPos.X, (int)drawPos.Y, (int)diam, (int)diam);
            hitCircle = new Circle(pos, (float)diam);

            //for (int i = 0; i < resources.Count(); i++)
            //{
            //    resources[i] = 0;
            //}

            foreach (string k in _globals.materials)
            {
                content.Add(k, 0);
            }

            texture         = text;
            playerControled = true;

            if (homeBlock != null)
            {
                home = homeBlock;
            }
        }
Exemple #3
0
        public Drone(string typeOfDrone,
                     string name,
                     double x = 0, double y = 0, double xDot = 0, double yDot = 0, StationBlock homeBlock = null)
        {
            type            = typeOfDrone;
            pos             = new Vector2((float)x, (float)y);
            posDot          = new Vector2(0, 0);
            home            = homeBlock;
            idNo            = name;
            playerControled = true;

            baseDamage   = 10000;
            thrustMax    = 1000;
            maxHealth    = 1000000;
            health       = maxHealth;
            maxShield    = maxHealth * .1;
            shield       = maxShield;
            mass         = 10;
            diam         = 15;
            maxResources = 0;

            switch (typeOfDrone)
            {
            case "miningDrone":
                baseDamage = 10000;
                texture    = _globals.textures[1, 1];
                break;

            case "harvestDrone":
                maxResources = 100;
                texture      = _globals.textures[1, 2];
                break;

            case "harpoonDrone":
                thrustMax = 10000;
                texture   = _globals.textures[1, 3];
                break;
            }
            drawPos = new Vector2(
                pos.X - (float)(diam * .5),
                pos.Y - (float)(diam * .5)
                );
            hitBox    = new Rectangle((int)drawPos.X, (int)drawPos.Y, (int)diam, (int)diam);
            hitCircle = new Circle(pos, (float)diam);
            foreach (string k in _globals.materials)
            {
                content.Add(k, 0);
            }
        }
Exemple #4
0
        public StationBlock(int x, int y, string typ, StationBlock core)
        {
            type       = typ;
            solid      = false; // May change later
            gridPos[0] = x;
            gridPos[1] = y;

            diam = 30;
            switch (typ)
            {
            case "stationDock":
                texture      = _globals.textures[2, 1];
                spawnsDrones = true;
                numDrones    = 2;
                droneType    = "miningDrone";
                break;

            case "stationDockHarvester":
                texture      = _globals.textures[2, 1];
                spawnsDrones = true;
                droneType    = "harvestDrone";
                break;

            case "stationDockHarpoon":
                texture      = _globals.textures[2, 1];
                spawnsDrones = true;
                droneType    = "harpoonDrone";
                break;

            case "stationStorage":

                break;

            case "stationPower":

                break;

            case "stationStructure":

                break;

            case "stationTractor":

                break;

            case "stationGrinder":

                break;

            case "stationRepel":

                break;

            case "stationSapper":

                break;
            }

            pos = new Vector2((float)(core.pos.X + diam * gridPos[0]), (float)(core.pos.Y + diam * gridPos[1]));
            Vector2 offset = new Vector2(-(float)(diam / 2), -(float)(diam / 2));

            drawPos = pos + offset;
            hitBox  = new Rectangle(
                new Point((int)drawPos.X, (int)drawPos.Y),
                new Point((int)diam, (int)diam));
            posDot = new Vector2(0, 0);

            //expPos =
        }
Exemple #5
0
 public void AddBlock(StationBlock s)
 {
     blocks.Add(s);
 }
Exemple #6
0
        public void AddBlock(int x, int y, string type)
        {
            StationBlock s = new StationBlock(x, y, type, blocks[0]);

            blocks.Add(s);
        }
Exemple #7
0
        public Station(Vector2 origin)
        {
            StationBlock core = new StationBlock(origin);

            blocks.Add(core);
        }