Example #1
0
        private void canvas_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args)
        {
            //Update game objects
            gameObjects.Update(MILLISECONDS_PER_FRAME);

            //Check for collision events
            collisions.CollisionTest();

            //Count down spawn timer
            spawnTime -= MILLISECONDS_PER_FRAME;

            //If timer ended
            if (spawnTime <= 0.0)
            {
                //Spawn an enemy
                SpawnEnemy();

                //Reset the timer
                ResetEnemySpawnTimer();
            }

            //If all players dead
            if (players.IsEmpty())
            {
                //Jump to main menu TODO (crashing due to a thread error)
                //this.Frame.Navigate(typeof(MainMenuPage));
            }
        }