Esempio n. 1
0
        public static PlayerShip Factory(Vector2 position, MyGame.IO.InputManager inputManager)
        {

            //GunnerController gunner0 = GunnerController.CreateGunner(0);
            //GunnerController gunner1 = GunnerController.CreateGunner(1);
            PlayerShip ship = new PlayerShip(position, inputManager);
            GameObject.Collection.Add(ship);

            /*PlayerRotatingGun gun1 = new PlayerRotatingGun(this, new Vector2(0, 25), (float)(Math.PI / 2), gunner0);
            GameObject.Collection.Add(gun1);
            PlayerRotatingGun gun2 = new PlayerRotatingGun(this, new Vector2(0, -25), (float)(-Math.PI / 2), gunner1);
            GameObject.Collection.Add(gun2);
            this.GameState.AddLocalUpdateable(gunner0);
            this.GameState.AddLocalUpdateable(gunner1);*/
            return ship;
        }
Esempio n. 2
0
        public static PlayerShip Factory(Vector2 position, MyGame.IO.InputManager inputManager)
        {
            //GunnerController gunner0 = GunnerController.CreateGunner(0);
            //GunnerController gunner1 = GunnerController.CreateGunner(1);
            PlayerShip ship = new PlayerShip(position, inputManager);

            GameObject.Collection.Add(ship);

            /*PlayerRotatingGun gun1 = new PlayerRotatingGun(this, new Vector2(0, 25), (float)(Math.PI / 2), gunner0);
             * GameObject.Collection.Add(gun1);
             * PlayerRotatingGun gun2 = new PlayerRotatingGun(this, new Vector2(0, -25), (float)(-Math.PI / 2), gunner1);
             * GameObject.Collection.Add(gun2);
             * this.GameState.AddLocalUpdateable(gunner0);
             * this.GameState.AddLocalUpdateable(gunner1);*/
            return(ship);
        }
Esempio n. 3
0
        public GameState(MyGame.IO.InputManager inputManager, Vector2 worldSize, Camera camera)
        {
            GameObject.LocalGameState = this;

            this.camera = camera;
            worldRectangle = new Utils.RectangleF(new Vector2(0), worldSize);
            spacialData = new QuadTree(worldSize);
            Random random = new Random();
            for (int i = 0; i < (int)(worldSize.X * worldSize.Y / 50000); i++)
            {
                stars.Add(new Drawable(Textures.Star, RandomPosition(), Color.SteelBlue, (float)(random.NextDouble() * Math.PI * 2), new Vector2(25), .1f));
            }

            PlayerShip ship = new MyGame.GameStateObjects.Ships.PlayerShip(new Vector2(50), inputManager);
            this.AddGameObject(ship);
            NPCShip npcShip = new MyGame.GameStateObjects.Ships.NPCShip(new Vector2(260), random);
            this.AddGameObject(npcShip);
            Mine MyMine = new Mine(new Vector2(500));
            this.AddGameObject(MyMine);
            //this.AddGameObject(new Bullet(new Vector2(0), 2f));
        }