private void Stun(Entity entity)
 {
     isRunningToPlayer = false;
     isAngry           = false;
     firingUp          = false;
     entity.SetVelX(0);
     entity.SetVelY(0);
     entity.ComplexAnimation.RemoveAllFromQueue();
     entity.AddAnimationToQueue("still");
 }
示例#2
0
        public override void Initialize(Entity entity)
        {
            _jumpTimer = CreateTimedAction(TimeBetweenJumps_IDLE, Jump);

            entity.CurrentCollisionType   = CollisionType.None;
            entity.CollidedWithTileBelow += Entity_CollidedWithTileBelow;
            entity.AddAnimationToQueue("still");

            base.Initialize(entity);
        }
示例#3
0
 /// <summary>
 /// Does the animation for spell casting.
 /// </summary>
 private void CastSpell()
 {
     if (!castingSpell)
     {
         castingSpell = true;
         Entity.AddAnimationToQueue("castSpell");
         castingSpellTimer.ResetAndWaitFor(3000);
         castingSpellTimer.SetTimeReached += CastingSpellTimer_SetTimeReached;
         spawnSound.Play();
         laughSound.Play();
     }
 }
示例#4
0
        public override void Update(Entity entity)
        {
            attackTimer.Increment();
            if (attackTimer.TimeElapsedInMilliSeconds > TimeBetweenAttacks)
            {
                attackTimer.Reset();
                entity.AddAnimationToQueue("attack");
                entity.ComplexAnimation.AnimationEnded += ComplexAnimation_AnimationEnded;

                float velocityY = TMBAW_Game.Random.Next(-200, -180) / 10f;
                float velocityX = (GameWorld.GetPlayers()[0].CollRectangle.X - entity.GetCollRectangle().X) / 30f;

                //ProjectileSystem projectile = new ProjectileSystem(ProjectileSystem.Type.SnakeVenom, entity.Position + new Vector2(16, 13) * 2, new Vector2(velocityX, velocityY), entity);
                //GameWorld.EnemyProjectiles.Add(projectile);
            }

            base.Update(entity);
        }
示例#5
0
        public override void Update(Entity entity)
        {
            StoneGolem golem = entity as StoneGolem;

            if (CollisionRay.IsEntityInSight(entity, GameWorld.GetPlayers()[0]))
            {
                float velX = 1.0f;
                golem.IsFacingRight = false;
                if (!golem.IsPlayerToTheRight())
                {
                    velX *= -1;
                    golem.IsFacingRight = true;
                }
                golem.SetVelX(velX);
                entity.AddAnimationToQueue("walk");
            }
            else
            {
                entity.RemoveAnimationFromQueue("walk");
            }
            base.Update(entity);
        }
示例#6
0
 public override void Initialize(Entity entity)
 {
     entity.AddAnimationToQueue("idle");
     base.Initialize(entity);
 }