Exemplo n.º 1
0
        public override void Reset()
        {
            // This method is called when the StartScene() method is called
            this.level.LoadMap(this.mapFileName, 1);
            viewPort.Reset();

            this.Entities.Clear();

            // set up the player character entity
            Characters.Mario mario = new Characters.Mario(this._gameObject);
            player = mario;
            this.Entities.Add(player);

            new ResourceProxy().PlaySound("music-1");

            // Set up the game timer
            timeCounter        = 400;
            gameTimer          = new System.Windows.Forms.Timer();
            gameTimer.Tick    += new EventHandler(gameTimer_Tick);
            gameTimer.Interval = 1000; // 1 second
            gameTimer.Start();


            base.Reset();
        }
Exemplo n.º 2
0
        public override void Reset()
        {
            // This method is called when the StartScene() method is called
            this.level.LoadMap(System.IO.Directory.GetCurrentDirectory() + @"\leveldata.xml", 1);
            viewPort.Reset();

            this.Entities.Clear();

            // set up the player character entity
            Characters.Mario mario = new Characters.Mario(this._gameObject);
            player = mario;
            this.Entities.Add(player);

            ResourceManager.Instance.PlaySound("music-1");

            // Set up the game timer
            timeCounter        = 400;
            gameTimer          = new System.Windows.Forms.Timer();
            gameTimer.Tick    += new EventHandler(gameTimer_Tick);
            gameTimer.Interval = 1000; // 1 second
            gameTimer.Start();


            base.Reset();
        }
Exemplo n.º 3
0
        public override void Reset()
        {
            Characters.Mario mario = new Characters.Mario(this._gameObject);
            mario.X = 430;
            mario.Y = 360;
            mario.sprite.TextureRect = mario.EntitySpriteSheet.GetFirstSprite(Direction.RIGHT);
            this.Entities.Add(mario);

            base.Reset();
        }
Exemplo n.º 4
0
 public override void Reset()
 {
     this.level.LoadMap(this.mapFileName, 1);
     viewPort.Reset();
     this.Entities.Clear();
     Characters.Mario mario = new Characters.Mario(this.gameObject);
     player = mario;
     this.Entities.Add(player);
     base.Reset();
 }
Exemplo n.º 5
0
        private void gameTimer_Tick(object sender, EventArgs e)
        {
            timeCounter--;

            if (timeCounter == 100)
            {
                new ResourceProxy().GetSound("warning").Play();
                new ResourceProxy().GetSound("music-1").Pause();
            }

            if (new ResourceProxy().GetSound("warning").Status == SoundStatus.Stopped && new ResourceProxy().GetSound("music-1").Status == SoundStatus.Paused)
            {
                new ResourceProxy().GetSound("music-1").Play();
            }

            if (timeCounter == 0)
            {
                gameTimer.Stop();
                Characters.Mario m = (Characters.Mario)Entities.Find(x => x.GetType() == typeof(Characters.Mario));
                m.Die();
            }
        }
Exemplo n.º 6
0
        public override void Reset()
        {
            // This method is called when the StartScene() method is called
            this.level.LoadMap(System.IO.Directory.GetCurrentDirectory() + @"\leveldata.xml", currentLevel);
            viewPort.Reset();

            this.Entities.Clear();

            // set up the player character entity
            Characters.Mario mario = new Characters.Mario(this._gameObject);
            player = mario;
            this.Entities.Add(player);
            positionX = player.X;

            ResourceManager.Instance.PlaySound("music-1");

            // Set up the game timer
            timeCounter       = timeCounterTracking = level.time;
            gameTimerTracking = new System.Windows.Forms.Timer();
            gameTimer         = new System.Windows.Forms.Timer();


            gameTimer.Tick         += new EventHandler(gameTimer_Tick);
            gameTimerTracking.Tick += new EventHandler(gameTimerTracking_Tick);

            gameTimer.Interval = 1000; // 1 second
            gameTimer.Start();

            gameTimerTracking.Interval = 1000; // 1 second
            gameTimerTracking.Start();

            //data = "";
            PrintTracking("Begin Game");
            file = String.Format("{0: yyyy'-'MM'-'dd'T'HH'h'mm'm'ss }.txt", DateTime.Now);// file name pattern

            base.Reset();
        }