public Museum()
 {
     InitializeComponent();
     gameState = new GameState();
 }
示例#2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            var data = NavigationContext.QueryString;

            if (data.ContainsKey("difficulty"))
            {
                if (data["difficulty"] == "medium")
                {
                    level = 1;
                }
                if (data["difficulty"] == "hard")
                {
                    level = 2;
                }
            }

            // Setup button storyboards
            restartStoryboard = TweenUtil.AutoScale(retyButton, .9, false);
            continueStoryboard = TweenUtil.AutoScale(continueButton, .9, false);

            gameState = new GameState();

            double height = LayoutRoot.ActualHeight;
            double width = LayoutRoot.ActualWidth;

            InitByLevel(level);

            var timer = new DispatcherTimer();
            timer.Interval = new TimeSpan(0, 0, 0, 0, 400); // 100 Milliseconds
            timer.Tick += (sender, args) =>
                    {
                        if (game != null && game.Status == GameStatus.InProgess && game.Begin.HasValue)
                        {
                            secs = (int) Math.Round((DateTime.Now - game.Begin.Value).TotalSeconds);
                            if (secs > 999)
                                secs = 999;

                        }
                    };
            timer.Start();

            base.OnNavigatedTo(e);

            SaveGameState();

            gameState.SetActivePage("GamePage.xaml");

            TweenUtil.AnimateInStageLeft(gameGuy, .3);

            SoundUtil.PlayBackgroundLoop("Sounds/HappyDigGuyTheme.wav");
        }
示例#3
0
        public StartPage()
        {
            InitializeComponent();

            gameState = new GameState();
        }