示例#1
0
        public Enemy Spawn(EnemyType type, Vector3 pos, PropertyCollection props)
        {
            Enemy e = null;

            switch (type)
            {
            case EnemyType.Asteroid:
                e = new Asteroid(pos, spriteSheets["Asteroid"]);
                break;

            case EnemyType.Omega:
                e = new Omega(pos, spriteSheets["Omega"]);
                break;

            case EnemyType.Turret:
                e = new Turret(pos, spriteSheets["Turret"], props.Contains("Inverted"));
                break;

            case EnemyType.Squid:
                e = new Squid(pos, spriteSheets["Squid"]);
                break;
            }

            Enemies.Add(e);
            return(e);
        }
示例#2
0
        public Enemy Spawn(EnemyType type, Vector3 pos, PropertyCollection props)
        {
            Enemy e = null;
            switch (type)
            {
                case EnemyType.Asteroid:
                    e = new Asteroid(pos, spriteSheets["Asteroid"]);
                    break;
                case EnemyType.Omega:
                    e = new Omega(pos, spriteSheets["Omega"]);
                    break;
                case EnemyType.Turret:
                    e = new Turret(pos, spriteSheets["Turret"], props.Contains("Inverted"));
                    break;
                case EnemyType.Squid:
                    e = new Squid(pos, spriteSheets["Squid"]);
                    break;
            }

            Enemies.Add(e);
            return e;
        }