public static NPCShip Factory(Vector2 position, Random random)
        {
            NPCShip ship = new NPCShip(position, random);

            GameObject.Collection.Add(ship);
            return(ship);
        }
        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 ClearTargetState(NPCBasicAttackStrategy context, NPCShip obj, FlyingGameObject target)
     : base(context, obj, target)
 {
 }
 public NPCBasicAttackStrategy(NPCShip obj, FlyingGameObject target)
     : base(obj)
 {
     AddState(new AttackingState(this, obj, target));
 }
Beispiel #5
0
 public static NPCShip Factory(Vector2 position, Random random)
 {
     NPCShip ship = new NPCShip(position, random);
     GameObject.Collection.Add(ship);
     return ship;
 }