Esempio n. 1
0
        //effects stuff for zoom in and out
        public void UpdateScreen(EnfinitumAeon EA, GameTime gameTime)
        {
            if (!backToSystem)
            {
                planet.ZoomIn(gameTime);
            }

            if (EscapePressed())
            {
                exitCombat = true;
            }

            if (exitCombat)
            {
                backToSystem = true;
                planet.ZoomOut(gameTime);
                if (planet.Scale <= planet.InitialScale)
                {
                    exitCombat     = false;
                    backToSystem   = false;
                    EA.QuitCombat  = true;
                    planet.Clicked = false;
                    player.Ship.deleteFromScreen();
                }
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Allows the game to perform any initialization it needs to before starting to run.
 /// This is where it can query for any required services and load any non-graphic
 /// related content.  Calling base.Initialize will enumerate through any components
 /// and initialize them as well.
 /// </summary>
 protected override void Initialize()
 {
     // TODO: Add your initialization logic here
     settings = new GameSettings(graphics);
     settings.Fullscreen();
     game = new EnfinitumAeon(graphics);
     //options = new GameOptions(graphics);
     this.IsMouseVisible = true;
     base.Initialize();
 }
Esempio n. 3
0
        public void Update(EnfinitumAeon EA, GameTime gameTime, ContentManager content)
        {
            UpdateInputState();
            UpdateScreen(EA, gameTime); // zoom in and out stuff
            if (planet.OverSized())     // when the planet is fixed
            {
                bool isASun = (Planet.Name == "Sun" || Planet.Name == "Odin" || Planet.Name == "Ra");
                if (!gameOver && !victory || isASun)
                {
                    if (planet.EnemyShips == 0)
                    {
                        victory = true;
                    }
                    if (planet.Player.Ship.Destroyed)
                    {
                        gameOver = true;
                    }
                    planet.Player.Update(gameTime, content, 0);
                    if (planet.Player.Ship.Hit)
                    {
                        explosions.Add(new Explosion(content, planet.Player.Ship, "Damage"));
                        player.Ship.Damage.Play();
                        player.Ship.Hit = false;
                    }

                    for (int i = 0; i < enemies.Count && !planet.Player.Ship.Destroyed; i++)
                    {
                        planet.Player.Ship.TakesDamageFrom(enemies[i], content);
                        enemies[i].Update(gameTime, content);
                        enemies[i].TakesDamageFrom(player.Ship, content);
                        if (enemies[i].Hit)
                        {
                            explosions.Add(new Explosion(content, enemies[i], "Damage"));
                            enemies[i].Damage.Play();
                            enemies[i].Hit = false;
                        }
                        if (enemies[i].Destroyed)
                        {
                            player.Credits    += enemies[i].Credits;
                            player.Experience += enemies[i].Experience;
                            enemies[i].Boom.Play();
                            explosions.Add(new Explosion(content, enemies[i], "Destroyed"));
                            enemies.RemoveAt(i);
                            planet.EnemyShips--;
                            planet.Clicked = false;
                        }
                    }
                    foreach (Explosion explosion in explosions)
                    {
                        explosion.Update(gameTime);
                    }
                    //initializes enemy ships when the wave is destroyed
                    if (currentWave < waves && enemies.Count == 0)
                    {
                        loadTime += (float)gameTime.ElapsedGameTime.TotalSeconds;
                        //  if(loadTime <= 2f)
                        currentWave++;
                        // if(loadTime > 4f)
                        InitializeEnemyShips();
                        // if (loadTime > 6f)
                        LoadContent(content);
                        // if (loadTime > 8f)
                        loadTime = 0;
                    }
                    ManageExplosions();
                }
                if (victory && planet.Enfinitum > 0)
                {
                    player.Credits   += planet.Credits;
                    player.Enfinitum += planet.Enfinitum;
                    planet.Credits    = 0;
                    planet.Enfinitum  = 0;
                    planet.Defences   = 0;
                }
                if (gameOver)
                {
                    planet.EnemyShips = initialEnemies;
                }
            }
        }
Esempio n. 4
0
 public void Reset(EnfinitumAeon EA)
 {
     EA.QuitCombat = false;
     victory       = false;
     gameOver      = false;
 }