Example #1
0
        public override void Update()
        {
            EnemySprite.Update();

            Enemy.gravityManagement.Update();
            Enemy.Position += Vector2.UnitX;
        }
Example #2
0
        public override void Update()
        {
            EnemySprite.Update();

            Enemy.gravityManagement.Update();
            Enemy.Position += EnemyUtil.Util;
        }
Example #3
0
 public override void Update()
 {
     EnemySprite.Update();
     if (!Enemy.Island)
     {
         Enemy.gravityManagement.Update();
     }
     Enemy.Position -= Vector2.UnitX;
 }
Example #4
0
 public override void Update()
 {
     EnemySprite.Update();
     if (!Enemy.Island)
     {
         Enemy.gravityManagement.Update();
     }
     if (delay == 200)
     {
         GameObjectManager.Instance.GameObjectList.Add(new Goomba(Enemy.Position));
         delay = 0;
     }
     delay++;
 }
Example #5
0
        public override void Update(GameTime gametime)
        {
            CheckCanMove();
            if (_state == BossState.MOVE)
            {
                movetimer += gametime.ElapsedGameTime.TotalSeconds;
                if (movetimer >= movetime)
                {
                    movetimer = 0.0f;
                    int rndnum = rnd.Next(0, 3);
                    switch (rndnum)
                    {
                    case 0:
                        _state = BossState.ATTACK;
                        break;

                    case 1:
                        changedir = true;
                        _state    = BossState.RUSH;
                        break;

                    case 2:
                        _state = BossState.SUPERATTACK;
                        break;
                    }
                }
            }
            if (_state == BossState.ATTACK)
            {
                attacktimer += gametime.ElapsedGameTime.TotalSeconds;
                if (attacktimer >= attacktime)
                {
                    attacktimer = 0.0f;
                    _state      = BossState.MOVE;
                }
            }
            else if (_state == BossState.RUSH)
            {
                rushtimer += gametime.ElapsedGameTime.TotalSeconds;
                if (rushtimer >= rushtime)
                {
                    rushtimer = 0.0f;
                    _state    = BossState.MOVE;
                }
            }
            else if (_state == BossState.SUPERATTACK)
            {
                supattacktimer += gametime.ElapsedGameTime.TotalSeconds;
                if (supattacktimer >= supattacktime)
                {
                    supattacktimer = 0.0f;
                    _state         = BossState.MOVE;
                }
            }

            switch (_state)
            {
            case BossState.MOVE:
                Move();
                break;

            case BossState.ATTACK:
                Attack(gametime);
                break;

            case BossState.RUSH:
                Rush();
                break;

            case BossState.SUPERATTACK:
                SuperAttack(gametime);
                break;
            }

            if (Health <= 0)
            {
                EnemySprite.IsLive = false;
            }

            _currentAnimation = _idleAniamtion;
            _currentAnimation.Update(gametime);
            EnemySprite.Update();
        }
Example #6
0
 public virtual void Update()
 {
     EnemySprite.Update();
     Enemy.gravityManagement.Update();
 }
Example #7
0
        public override void Update(GameTime gametime)
        {
            CheckCanMove();
            if (_state == GBLSate.XL)
            {
                changetimer += gametime.ElapsedGameTime.TotalSeconds;
                if (changetimer >= changetime)
                {
                    changetimer = 0.0f;
                    if (!_isfindHero)
                    {
                        rndnum = rnd.Next(0, 4);
                    }
                }
                if ((GameManager.GetInstance().Player.Position - EnemySprite.Position).Length() <= 400)
                {
                    _isfindHero = true;
                    _state      = GBLSate.FINDENEMY;
                }
            }
            else
            {
                if (_state == GBLSate.FINDENEMY)
                {
                    stoptimer += gametime.ElapsedGameTime.TotalSeconds;
                    if (stoptimer >= stoptime)
                    {
                        _state = GBLSate.ATTACK;
                    }
                }
                else if (_state == GBLSate.ATTACK)
                {
                    attacktimer += gametime.ElapsedGameTime.TotalSeconds;
                    if (attacktimer >= attacktime)
                    {
                        _state = GBLSate.FINDENEMY;
                    }
                }
            }



            switch (_state)
            {
            case GBLSate.XL:
                MoveXL();
                break;

            case GBLSate.FINDENEMY:
                Move();
                break;

            case GBLSate.ATTACK:
                Attack(gametime);
                break;
            }

            if (Health <= 0)
            {
                EnemySprite.IsLive = false;
            }

            _currentAnimation = _idleAniamtion;
            _currentAnimation.Update(gametime);
            EnemySprite.Update();
        }
Example #8
0
        public override void Update(GameTime gameTime)
        {
            CheckCanMove();

            if (_state == EnemyPigState.XL)
            {
                changetimer += gameTime.ElapsedGameTime.TotalSeconds;
                if (changetimer >= changetime)
                {
                    changetimer = 0.0f;
                    if (!_isfindHero)
                    {
                        rndnum = rnd.Next(0, 4);
                    }
                }
                if ((GameManager.GetInstance().Player.Position - EnemySprite.Position).Length() <= 400)
                {
                    _isfindHero = true;
                    _state      = EnemyPigState.FINDENEMY;
                }
            }
            else
            {
                if (_state == EnemyPigState.FINDENEMY)
                {
                    stoptimer += gameTime.ElapsedGameTime.TotalSeconds;
                    if (stoptimer >= stoptime)
                    {
                        stoptimer = 0.0f;
                        changedir = true;
                        _state    = EnemyPigState.RUSH;
                    }
                }
                else if (_state == EnemyPigState.RUSH)
                {
                    rushtimer += gameTime.ElapsedGameTime.TotalSeconds;
                    if (rushtimer >= rushtime)
                    {
                        rushtimer = 0;
                        _state    = EnemyPigState.FINDENEMY;
                    }
                }
            }

            switch (_state)
            {
            case EnemyPigState.XL:
                MoveXL();
                break;

            case EnemyPigState.FINDENEMY:
                Move();
                break;

            case EnemyPigState.RUSH:
                //SoundManager.Getinstance().PlaySoundEffect("pigAttack");
                MoveRush();
                break;
            }



            if (Health <= 0)
            {
                EnemySprite.IsLive = false;
            }
            _currentAnimation = _idleAnimation;
            _currentAnimation.Update(gameTime);
            EnemySprite.Update();
        }