Example #1
0
 /// <summary>
 /// Add the eyes for the player.
 /// </summary>
 /// <param name="game">The game in which you want to add the eyes.</param>
 /// <param name="_level">The level in which you want to add the eyes.</param>
 /// <param name="model">A Model object with a path to the model.</param>
 /// <param name="rotation">The starting rotation of the eyes.</param>
 /// <param name="scale">The eye's scale.</param>
 /// <param name="player">The player object which will be used to update this object's position.</param>
 public FlameEyes(Game game, Model model, Vector3 rotation, Vector3 scale, LittleFlame player)
     : base(game, model, Vector3.Zero, rotation, scale)
 {
     this.player   = player;
     this.offset   = new Vector3(0, 0.25f, RADIUS);
     this.position = player.Position + offset;
 }
Example #2
0
        public override void Draw(GameTime gameTime)
        {
            LittleFlame player = (LittleFlame)game.Services.GetService(typeof(LittleFlame));

            if (player != null)
            {
                this.flameSize = player.FlameSize;
            }

            EffectParameterCollection parameters = particleEffect.Parameters;

            /*parameters["Duration"].SetValue((float)settings.Duration.TotalSeconds);
             * parameters["DurationRandomness"].SetValue(settings.DurationRandomness);
             * parameters["Gravity"].SetValue(settings.Gravity);
             * parameters["EndVelocity"].SetValue(settings.EndVelocity);
             * parameters["MinColor"].SetValue(settings.MinColor.ToVector4());
             * parameters["MaxColor"].SetValue(settings.MaxColor.ToVector4());
             *
             * parameters["RotateSpeed"].SetValue(new Vector2(settings.MinRotateSpeed, settings.MaxRotateSpeed));*/
            parameters["StartSize"].SetValue(new Vector2((flameSize - (flameSize * sizeDiff)) * sizeMod, (flameSize + (flameSize * sizeDiff)) * sizeMod));
            parameters["EndSize"].SetValue(new Vector2((flameSize - (flameSize * sizeDiff)) * sizeMod, (flameSize + (flameSize * sizeDiff)) * sizeMod));


            base.Draw(gameTime);
        }
Example #3
0
 /// <summary>
 /// Add the eyes for the player.
 /// </summary>
 /// <param name="game">The game in which you want to add the eyes.</param>
 /// <param name="_level">The level in which you want to add the eyes.</param>
 /// <param name="model">A Model object with a path to the model.</param>
 /// <param name="rotation">The starting rotation of the eyes.</param>
 /// <param name="scale">The eye's scale.</param>
 /// <param name="player">The player object which will be used to update this object's position.</param>
 public FlameEyes(Game game, Model model, Vector3 rotation, Vector3 scale, LittleFlame player)
     : base(game, model, Vector3.Zero, rotation, scale)
 {
     this.player = player;
     this.offset = new Vector3(0, 0.25f, RADIUS);
     this.position = player.Position + offset;
 }
Example #4
0
        private void StopFall(LittleFlame player)
        {
            isFalling = false;
            isBurned  = true;

            player.Position  = topTree;
            player.IsInTree  = false;
            player.TreeClimb = 0;
        }
Example #5
0
 public Healthbar(Game game, Texture2D barText, Vector2 position, int height, int boostMin, LittleFlame player)
     : base(game)
 {
     this.barText = barText;
     this.position = position;
     this.height = height;
     this.player = player;
     this.boostMin = boostMin;
     this.game = game;
 }
Example #6
0
 public Healthbar(Game game, Texture2D barText, Vector2 position, int height, int boostMin, LittleFlame player)
     : base(game)
 {
     this.barText  = barText;
     this.position = position;
     this.height   = height;
     this.player   = player;
     this.boostMin = boostMin;
     this.game     = game;
 }
Example #7
0
        public override void Initialize()
        {
            rangeDistance = 1;
            player = (LittleFlame)Game.Services.GetService(typeof(LittleFlame));
            terrain = (Terrain)Game.Services.GetService(typeof(Terrain));
            isBurned = false;

            //The fallspeed starts at a sixteenth of a circle each second (a half circle equals PI and divide that by eigth multiplied by 60 fps).
            this.fallspeed = MathHelper.Pi / 480;

            base.Initialize();
        }
Example #8
0
        public override void Initialize()
        {
            rangeDistance = 1;
            player        = (LittleFlame)Game.Services.GetService(typeof(LittleFlame));
            terrain       = (Terrain)Game.Services.GetService(typeof(Terrain));
            isBurned      = false;

            //The fallspeed starts at a sixteenth of a circle each second (a half circle equals PI and divide that by eigth multiplied by 60 fps).
            this.fallspeed = MathHelper.Pi / 480;

            base.Initialize();
        }
Example #9
0
        private void switchCamera()
        {
            Vector3 _position = cam.CamPos;

            if (devCamOn && camSwitchDelay == 0)
            {
                devCamOn = false;
                Game.Services.RemoveService(typeof(Camera.Camera));
                cam = new Camera.LFCamera(_position, camSpeed, Game.GraphicsDevice);
                Game.Services.AddService(typeof(Camera.Camera), cam);
                if (!Game.Components.Contains(player))
                {
                    player          = new LittleFlame(Game, startPosition, devCamOn, this);
                    player.DevCamOn = false;
                    if (Game.Services.GetService(typeof(LittleFlame)) == null)
                    {
                        Game.Services.AddService(typeof(LittleFlame), player);
                    }
                    else
                    {
                        Game.Services.RemoveService(typeof(LittleFlame));
                        Game.Services.AddService(typeof(LittleFlame), player);
                    }
                    Game.Components.Add(player);
                }
                camSwitchDelay = 1;
            }
            else if (camSwitchDelay == 0)
            {
                devCamOn = player.DevCamOn = true;
                Game.Services.RemoveService(typeof(Camera.Camera));
                cam = new Camera.DevelopCamera(_position, camSpeed, Game.GraphicsDevice);
                Game.Services.AddService(typeof(Camera.Camera), cam);
                if (Game.Components.Contains(player))
                {
                    Game.Components.Remove(player);
                    Game.Services.RemoveService(typeof(LittleFlame));
                }
                camSwitchDelay = 1;
            }
        }
Example #10
0
        public override void ReloadContent()
        {
            player = playerHolder;

            base.ReloadContent();
        }
Example #11
0
        private void StopFall(LittleFlame player)
        {
            isFalling = false;
            isBurned = true;

            player.Position = topTree;
            player.IsInTree = false;
            player.TreeClimb = 0;
        }
Example #12
0
 private void switchCamera()
 {
     Vector3 _position = cam.CamPos;
     if (devCamOn && camSwitchDelay == 0) {
         devCamOn = false;
         Game.Services.RemoveService(typeof(Camera.Camera));
         cam = new Camera.LFCamera(_position, camSpeed, Game.GraphicsDevice);
         Game.Services.AddService(typeof(Camera.Camera), cam);
         if (!Game.Components.Contains(player)) {
             player = new LittleFlame(Game, startPosition, devCamOn, this);
             player.DevCamOn = false;
             if (Game.Services.GetService(typeof(LittleFlame)) == null) {
                 Game.Services.AddService(typeof(LittleFlame), player);
             } else {
                 Game.Services.RemoveService(typeof(LittleFlame));
                 Game.Services.AddService(typeof(LittleFlame), player);
             }
             Game.Components.Add(player);
         }
         camSwitchDelay = 1;
     } else if (camSwitchDelay == 0) {
         devCamOn = player.DevCamOn = true;
         Game.Services.RemoveService(typeof(Camera.Camera));
         cam = new Camera.DevelopCamera(_position, camSpeed, Game.GraphicsDevice);
         Game.Services.AddService(typeof(Camera.Camera), cam);
         if (Game.Components.Contains(player)) {
             Game.Components.Remove(player);
             Game.Services.RemoveService(typeof(LittleFlame));
         }
         camSwitchDelay = 1;
     }
 }
Example #13
0
        public override void UnloadContent()
        {
            playerHolder = player;

            base.UnloadContent();
        }
Example #14
0
        public override void Initialize()
        {
            player = (LittleFlame)Game.Services.GetService(typeof(LittleFlame));

            normalGrassSizeMod = -0.7f;
            dryGrassSizeMod = 0.4f;
            sandSizeMod = -1;
            ashSizeMod = -1;
            rockSizeMod = -1;

            smooth = 10f;

            worldMatrix = Matrix.Identity;
            lightDirection = new Vector3(1, 0.5f, 1);

            base.Initialize();
        }
Example #15
0
        public void BurningField(Vector3 flamePos, GameTime gametime, Game game, Level level)
        {
            ground[(int)flamePos.X, (int)flamePos.Z].BurnValue -= 2;
            player = (LittleFlame)Game.Services.GetService(typeof(LittleFlame));

            int burnSize = (int)player.FlameSize / 75;
            switch (ground[(int)flamePos.X, (int)flamePos.Z].Grounds) {
                case (int)Ground.GroundTypes.GRASS:
                    UpdateGrass(flamePos, burnSize, false, false, normalGrassSizeMod, 1, 0.5);
                    break;
                case (int)Ground.GroundTypes.GRASSFLOWERS:
                    UpdateGrass(flamePos, burnSize, false, true, normalGrassSizeMod, 1, 0.5);
                    break;
                case (int)Ground.GroundTypes.DRYGRASS:
                    UpdateGrass(flamePos, burnSize, true, false, dryGrassSizeMod, 0.5, 0);
                    break;
                case (int)Ground.GroundTypes.DRYGRASSFLOWERS:
                    UpdateGrass(flamePos, burnSize, true, true, dryGrassSizeMod, 0.5, 0);
                    break;
                case (int)Ground.GroundTypes.SAND:
                    NonWalkableTerrain(sandSizeMod);
                    break;
                case (int)Ground.GroundTypes.MUD:
                    NonWalkableTerrain(sandSizeMod);
                    break;
                case (int)Ground.GroundTypes.ROCK:
                    NonWalkableTerrain(rockSizeMod);
                    break;
                case (int)Ground.GroundTypes.ASH:
                    NonWalkableTerrain(ashSizeMod);
                    break;

                default: break;
            }
        }