Exemplo n.º 1
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));
        }
 public LeafDictionary(QuadTree tree)
 {
     this.tree = tree;
 }
 public GameObjectCollection(Vector2 world)
 {
     worldRectangle = new Utils.RectangleF(new Vector2(0), world);
     quadTree = new QuadTree(world);
 }
 public LeafDictionary(QuadTree tree)
 {
     this.tree = tree;
 }