Esempio n. 1
0
        public override void UpdateMovement(GameTime _GameTime, CInput _Input)
        {
            //CoolDownFire += (float)_GameTime.ElapsedGameTime.TotalMilliseconds;

            Accel = new Vector2(Accel.X, 0.00098f);

            if (m_Status == IDStatus.MOVE)
            {
                if (Direction == IDDir.LEFT)
                {
                    m_Velocity = new Vector2(-0.03f, m_Velocity.Y);
                }

                if (Direction == IDDir.RIGHT)
                {
                    m_Velocity = new Vector2(0.03f, m_Velocity.Y);
                }
            }

            if (Status == IDStatus.FIRE)
            {
                Velocity = Vector2.Zero;
                //Direction = tempDirection;
                if (CoolDown(ref CoolDownBullet, 800, _GameTime))
                {
                    //BossBullet b = new BossBullet(new Vector2(this.Position.X, GlobalValue.MARIO_POSITION.Y), this.Direction);
                    //List_Of_Bullet.Add(b);
                    BossBullet b = new BossBullet(new Vector2(this.Position.X, this.Position.Y), this.Direction);
                    GlobalValue.List_Of_Bullet.Add(b);
                }
                if (CoolDown(ref CoolDownFire, 1000, _GameTime))
                {
                    Status = IDStatus.MOVE;
                }
            }

            if (Boss_Heath_Point <= 0)
            {
                Status = IDStatus.DIE;
            }

            if (CoolDown(ref CoolDownMove, 3000, _GameTime) && CanFire)
            {
                Status = IDStatus.FIRE;
            }

            //for (int i = 0; i < List_Of_Bullet.Count; i++)
            //{
            //    List_Of_Bullet[i].UpdateMovement(_GameTime, _Input);
            //}

            base.UpdateMovement(_GameTime, _Input);
            base.Update(_GameTime, _Input);
        }
Esempio n. 2
0
        public override void UpdateMovement(GameTime _GameTime, CInput _Input)
        {
            //CoolDownFire += (float)_GameTime.ElapsedGameTime.TotalMilliseconds;

            Accel = new Vector2(Accel.X, 0.00098f);

            if (m_Status == IDStatus.MOVE)
            {
                if (Direction == IDDir.LEFT)
                {
                    m_Velocity = new Vector2(-0.03f, m_Velocity.Y);
                }

                if (Direction == IDDir.RIGHT)
                {
                    m_Velocity = new Vector2(0.03f, m_Velocity.Y);
                }
            }

            if (Status == IDStatus.FIRE)
            {

                Velocity = Vector2.Zero;
                //Direction = tempDirection;
                if (CoolDown(ref CoolDownBullet, 800, _GameTime))
                {
                    //BossBullet b = new BossBullet(new Vector2(this.Position.X, GlobalValue.MARIO_POSITION.Y), this.Direction);
                    //List_Of_Bullet.Add(b);
                    BossBullet b = new BossBullet(new Vector2(this.Position.X, this.Position.Y), this.Direction);
                    GlobalValue.List_Of_Bullet.Add(b);
                }
                if (CoolDown(ref CoolDownFire, 1000, _GameTime))
                {
                    Status = IDStatus.MOVE;
                }
            }

            if (Boss_Heath_Point <= 0)
            {
                Status = IDStatus.DIE;
            }

            if (CoolDown(ref CoolDownMove, 3000, _GameTime) && CanFire)
            {
                Status = IDStatus.FIRE;
            }

            //for (int i = 0; i < List_Of_Bullet.Count; i++)
            //{
            //    List_Of_Bullet[i].UpdateMovement(_GameTime, _Input);
            //}

            base.UpdateMovement(_GameTime, _Input);
            base.Update(_GameTime, _Input);
        }