示例#1
0
        private void InitSpells()
        {
            //testing function
            Action <List <Sprite> > spell = (sprites) =>
            {
                var fireballAnimation = new Dictionary <string, Animation>()
                {
                    { "fireball", new Animation(State.Content.Load <Texture2D>("Projectiles/fireball"), 1, 6)
                      {
                          FrameSpeed = 0.05f
                      } }
                };
                var animation = new AnimationSprite(fireballAnimation, GlobalOrigin);
                animation.Position -= animation.Origin * animation.Scale;
                sprites.Add(animation);
            };


            Func <bool> canExecute = () =>
            {
                return(true);
            };

            Spellbar.Add(SpellDepository.TrippleFireball(this));
            Spellbar.Add(new Spell(spell, 15, State.Content.Load <Texture2D>("Projectiles/projectile"), 1));
            Spellbar.Add(new Spell(spell, 20, State.Content.Load <Texture2D>("Projectiles/fireball_icon"), 1));
            Spellbar.Add(new Spell(spell, 25, State.Content.Load <Texture2D>("Projectiles/projectile"), 1));
        }
示例#2
0
文件: Enemy.cs 项目: Xoxololz/Myng
 public Enemy(Dictionary <string, Animation> animations, Vector2 position, EnemyType type) : base(animations, position)
 {
     autoAttack = SpellDepository.RangeAutoAttack(this);
     Spells     = new List <Spell>();
     InitSpells();
     Scale           = 1f;
     baseSpeed       = 1.5f;
     Faction         = Faction.ENEMY;
     XPDrop          = 20;
     movementAI      = new MovementAI(CollisionPolygon, this);
     EnemyType       = type;
     currentState    = new WanderState(this);
     SightRange      = 600;
     autoAttackRange = 350;
     baseAttackSpeed = 2f;
     Debug.Assert(SightRange > autoAttackRange, "Cant shoot target, when u dont see it.");
 }
示例#3
0
 private void InitAutoattack()
 {
     autoAttack = SpellDepository.RangeAutoAttack(this);
 }