Exemple #1
0
        public override void Update(GameTime gameTime)
        {
            if (clicked)
            {
                clicked = false;
            }

            foreach (GraphicElement e in elements)
            {
                e.Update(gameTime);
            }

            for (int i = 0; i < menuButtons.Count; i++)
            {
                if (menuButtons [i] != null)
                {
                    menuButtons [i].Update(gameTime);
                }
            }

            InputUpdate();

            if (finalCountdown)
            {
                gameStartInSeconds -= (float)gameTime.ElapsedGameTime.TotalSeconds;
                if (gameStartInSeconds <= 0)
                {
                    TreasureTown.SetScene(new GameScene(minutes, numberOfTeams, 45));
                }
            }
        }
Exemple #2
0
 public override void Update(GameTime gameTime)
 {
     time += (float)gameTime.ElapsedGameTime.TotalSeconds;
     if (time > timeBeforeEscapable)
     {
         // Check for input to go back to the main menu
         if (KeyboardManager.ButtonPressUp(Microsoft.Xna.Framework.Input.Keys.Space) || KeyboardManager.ButtonPressUp(Microsoft.Xna.Framework.Input.Keys.Enter))
         {
             TreasureTown.SetScene(new MenuScene());
         }
     }
     if (time > timeBeforeMainMenu)
     {
         TreasureTown.SetScene(new MenuScene());
     }
 }
Exemple #3
0
        public GameScene(int minutes, int teams = 2, int turnTime = 30)
        {
            _instance = this;

            TreasureTown.SetBackgroundColor(Color.Black);
            objects      = new List <GraphicElement>();
            buildings    = new List <Building>();
            Teams        = new List <Team>();
            scoreChanges = new List <ScoreChanger>();
            Mode         = ChangeMode.Normal;

            TeamTime  = turnTime;
            TeamCount = teams;

            RemainingTime = minutes * 60;

            Compass = new Dictionary <MapDirection, float>()
            {
                { MapDirection.Right, 0f },
                { MapDirection.Down, (float)Math.PI / 2 },
                { MapDirection.Left, (float)Math.PI },
                { MapDirection.Up, ((float)Math.PI / 2) * 3 }
            };
        }
Exemple #4
0
 public static void GoToResultsScene()
 {
     TreasureTown.SetScene(new RankingScene(GameScene.Instance.RankTeams()));
 }
Exemple #5
0
 public static void StartGame(int teams, int time)
 {
     TreasureTown.SetScene(new GameScene(time, teams, 45));
 }
Exemple #6
0
 static void Main()
 {
     game = new TreasureTown();
     game.Run();
 }