示例#1
0
        public Monster SpawnMonster(string monsterType)
        {
            Monster monster = null;
            switch (monsterType)
            {
                case "Slime":
                    monster = new Slime ();
                    break;
                case "Demon":
                    monster = new Demon();
                    break;
                case "EyeBall":
                    monster = new EyeBall();
                    break;
                case "AngryRock":
                    monster = new AngryRock();
                    break;
                case "BigBadBoss":
                    monster = new AngryRock();
                    break;
            }

            monster.MovementSpeed = Moxy.Random.Next ((int)monster.LowSpeed, (int)monster.HighSpeed);
            return monster;
        }
示例#2
0
        public void Draw(SpriteBatch batch)
        {
            Monster mon = null;
            switch (MonsterType)
            {
                case "Slime":
                    mon = new Slime();
                    mon.Location = this.Location;
                    break;
            }

            mon.Draw(batch);
        }
示例#3
0
        public Monster Spawn(GameTime gameTime)
        {
            Monster monster = null;
                lastSpawn = TimeSpan.Zero;
                MonsterCount++;
                switch (MonsterType)
                {
                    case "Slime":
                        monster = new Slime();
                        break;
                    case "Demon":
                        monster = new Demon();
                        break;
                    case "EyeBall":
                        monster = new EyeBall();
                        break;
                }

                monster.Location = this.Location;
            monster.OnDeath += OnMonsterDeath;
            TimeSinceLastSpawn = 0;
            return monster;
        }