Exemplo n.º 1
0
        // Provides instructions on updating the map.
        public void Update(Surrounded game)
        {
            // Add lights.
            for (int i = 0; i < Lights.Count; ++i)
            {
                game.Lights.Add(this.Lights[i]);
            }

            // Update map name position.
            this.Name.Position = new Vector2f(game.GetView().Center.X - (game.GetView().Size.X / 2), game.GetView().Center.Y - (game.GetView().Size.Y / 2));

            // Update player logic.
            this.Player.Update(game);
        }
Exemplo n.º 2
0
        // Called when the player needs to be updated.
        public void Update(Surrounded game)
        {
            // Handles input.
            HandleMovement();
            HandleControl();
            HandleStatus();

            // Update listener direction and position.
            Listener.Direction = Directions.GetVectorFromDirection(this.Sprite.Direction);
            Listener.Position  = new Vector3f(this.Position.X, this.Position.Y, 0);

            // Update the sprite.
            this.Sprite.Update(this.Position, this.Walking, this.Attacking, this.Dead);

            // Update the camera position.
            game.SetView(new View(this.Position, new Vector2f(640, 360)));

            // Add the aura.
            game.Lights.Add(new Light(this.Position, Color.Yellow, 1.0F));
        }
Exemplo n.º 3
0
    new private void Start()
    {
        base.Start();
        List <IOffensiveModifier> modifiers = new List <IOffensiveModifier>
        {
            new ArmorPierce(0.5f)
        };

        Zeal       zeal       = new Zeal(0, _attack, 20, 0.03f);
        Surrounded surrounded = new Surrounded(150, this, zeal, (Targetable t) => t is Inquisitor);

        surrounded.ApplyOnTarget(this);

        _attack = new Attack(0f, 1.0f, this, 20, (Targetable attackable) => TargetingFunction.IsEnemy(this, attackable))
        {
            Modifiers = modifiers
        };

        Skills = new[] { _attack };
    }