예제 #1
0
        public RedHead(Game game, Vector3 pos, Level l)
            : base(game, pos, l)
        {
            //Parameters for this specific enemy
            life = 5;
            textures = new Texture2D[life];
            Damage = 5;
            this.level = l;
            this.position = pos;
            RotationSpeed = 0.1f;
            ForwardSpeed = 6f;
            boxMin = new Vector3(-0.235f, 0, -0.235f);
            boxMax = new Vector3(0.235f, 0.8f, 0.235f);
            boundingBox = new BoundingBox(position + boxMin, position + boxMax);
            //Different textures for each life count
            textures[4] = ContentPreImporter.GetTexture("RedHead");
            textures[3] = ContentPreImporter.GetTexture("RedHead4");
            textures[2] = ContentPreImporter.GetTexture("RedHead3");
            textures[1] = ContentPreImporter.GetTexture("RedHead2");
            textures[0] = ContentPreImporter.GetTexture("RedHead1");
            hurtSound = ContentPreImporter.GetSound("enemyHurt");

            billboard = new Billboard(game, textures[life - 1], Vector2.One / 2);
            billboard.Move(position + new Vector3(0, 0.25f, 0));
            billboard.ForceUpdate();
            target = pos;
            //Set new values for the fog if required
            billboard.OverrideFog(GlobalSettings.FogEnabled, GlobalSettings.FogColor, GlobalSettings.FogStart, GlobalSettings.FogEnd * 2.1f);
        }
예제 #2
0
        public Health(Game game, Vector3 pos)
            : base(game, pos)
        {
            //Assets for the health pickup
            texture = ContentPreImporter.GetTexture("HealthPack");
            pickupSound = ContentPreImporter.GetSound("Pickup");

            billboard = new Billboard(game, texture, Vector2.One / 2);
            billboard.Move(position);
            billboard.ForceUpdate();
        }