示例#1
0
        public void TestScore()
        {
            Game gm = new Game();

            Player bob  = new Player();
            Enemy  jeff = new EnemyStraight();

            bob.X     = 5;
            bob.Y     = 5;
            jeff.X    = 5;
            jeff.Y    = 5;
            jeff.Size = 5;

            gm.Collision();

            Assert.IsTrue(gm.Score == 0);
        }
示例#2
0
        //spawn new enemies
        public void Spawn()
        {
            Random random   = new Random();
            int    randtype = random.Next(1, 16);

            if (randtype < 10)
            {
                EnemyStraight estr = new EnemyStraight();
                _enemies.Add(estr);
            }
            else if (randtype >= 10 && randtype <= 14)
            {
                EnemySin esin = new EnemySin();
                _enemies.Add(esin);
            }
            //else
            //{
            //	EnemyFollow ef = new EnemyFollow ();
            //	_enemies.Add (ef);
            //}
        }