Пример #1
0
        private static void SpawnEnemy(MobSpawn spawn)
        {
            MobType type = spawn.Type;
            int     x    = (int)spawn.Location.X;
            int     y    = (int)spawn.Location.Y;

            switch (type)
            {
            case MobType.BasicMob:
                RightGame.AddMob(new BasicMob(basicEnemyTexture, noShootAnimations, 43, 42, new Vector2(x, y), 4, 43, 42));
                break;

            case MobType.LargeBoss:
                SpawnBoss();
                break;

            case MobType.ShootMob:
                Weapon shootWeapon = new MobWeapon(mobBulletTexture, mobShoot);
                RightGame.AddMob(new ShootingMob(basicShootingTexture, shootAnimations, 43, 42, new Vector2(x, y), 4, 43, 42, shootWeapon));
                break;

            case MobType.FastMob:
                RightGame.AddMob(new BasicMob(basicEnemyTexture, noShootAnimations, 43, 42, new Vector2(x, y), 8, 43, 42));
                break;

            case MobType.SideMob:
                int flip = 1;
                if (spawn.Rotation != 0)
                {
                    flip = -1;
                }
                Weapon sideWeapon = new SideWeapon(mobBulletTexture, mobShoot, flip);
                RightGame.AddMob(new SideMob(basicShootingTexture, shootAnimations, 43, 42, new Vector2(x, y), 4, 43, 42, sideWeapon, flip));
                break;
            }
        }
Пример #2
0
 public SideMob(Texture2D spriteSheet, AnimationState[] animations, int frameWidth, int frameHeight, Vector2 loc, int speed, int mobWidth, int mobHeight, Weapon weapon, int dir) : base(spriteSheet, animations, frameWidth, frameHeight, loc, speed, mobWidth, mobHeight, MAX_HEALTH)
 {
     this.weapon = (SideWeapon)weapon;
     this.dir    = dir;
     this.loc.X += mobWidth / 2;
 }