コード例 #1
0
 public EnemyEvader(ContentManager content, Vector2 screenSize, int x, int y, Planet aPlanet)
 {
     planet = aPlanet;
     Texture = content.Load<Texture2D>(@"Sprites/evader");
     TextureCenter = new Vector2(Texture.Width / 2, Texture.Height / 2);
     Position = new Vector2(x, y);
     Orientation = 3;
     ScreenSize = screenSize;
     cm = content;
     rect = new Rectangle((int)Position.X, (int)Position.Y, Texture.Width, Texture.Height);
 }
 private void GameSetUp()
 {
     lives = 3;
     ship = new Ship(Content, graphics);
     playerCnt = 1;
     shift = new Vector2(0, 0);
     player = new Player(new Vector2(ship.GetPosition().X, ship.GetPosition().Y - 100), Content, 1);
     bluePlanet = new Planet(Content);
     gasPlanet = new Planet(Content, 1);
     aquaGasPlanet = new Planet(Content, 2);
     marblePlanet = new Planet(Content, 3);
     ps.Add(bluePlanet);
     ps.Add(gasPlanet);
     ps.Add(aquaGasPlanet);
     ps.Add(marblePlanet);
     ees.Clear();
     ecs.Clear();
     ets.Clear();
     ees.Add(new EnemyEvader(Content, new Vector2(1900, 950), -1800, -400, marblePlanet));
     ees.Add(new EnemyEvader(Content, new Vector2(1900, 950), -1700, 100, marblePlanet));
     ees.Add(new EnemyEvader(Content, new Vector2(1900, 950), -1800, -50, marblePlanet));
     ees.Add(new EnemyEvader(Content, new Vector2(1900, 950), -1650, 280, marblePlanet));
     ees.Add(new EnemyEvader(Content, new Vector2(1900, 950), -1450, 500, marblePlanet));
     ees.Add(new EnemyEvader(Content, new Vector2(1900, 950), -1820, 450, marblePlanet));
     ees.Add(new EnemyEvader(Content, new Vector2(1900, 950), 3600, 1800, aquaGasPlanet));
     ees.Add(new EnemyEvader(Content, new Vector2(1900, 950), 3000, 1800, aquaGasPlanet));
     ees.Add(new EnemyEvader(Content, new Vector2(1900, 950), 3600, 1500, aquaGasPlanet));
     ees.Add(new EnemyEvader(Content, new Vector2(1900, 950), 2500, -400, gasPlanet));
     ees.Add(new EnemyEvader(Content, new Vector2(1900, 950), 2300, -500, gasPlanet));
     ees.Add(new EnemyEvader(Content, new Vector2(1900, 950), 2000, -600, gasPlanet));
     ees.Add(new EnemyEvader(Content, new Vector2(1900, 950), 2500, -700, gasPlanet));
     ets.Add(new EnemyTeleport(Content, new Vector2(1900, 950)));
     ets.Add(new EnemyTeleport(Content, new Vector2(1900, 950)));
     //ets.Add(new EnemyTeleport(Content, new Vector2(1900, 950)));
 }
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            IsMouseVisible = true;

            graphics.PreferredBackBufferWidth = 1900;
            graphics.PreferredBackBufferHeight = 950;
            //this.graphics.IsFullScreen = true;

            menu = new Menu();
            gamestate = GameStates.Menu;

            graphics.ApplyChanges();
            planet = new Planet(content);

            GameSetUp();

            input = new Input();
            base.Initialize();
        }