Beispiel #1
0
        public override void UpdateFrame(float dt)
        {
            if (ticker60Fps.isTime(dt))
            {
                body.SetPosition(body.GetPosition() + Dir * Speed);

                nowShootDis += Speed;
                if (nowShootDis > maxShootDis)
                {
                    HP = 0;
                }
            }

            base.UpdateFrame(dt);
        }
Beispiel #2
0
        public override BoundBox GetBoundBox()
        {
            base.Center = body.GetPosition();
            BoundBox bb = base.GetBoundBox();

            //base.drawBoundBox.SetBoundBoxInfor(bb);

            return(bb);
        }
Beispiel #3
0
        public override void UpdateFrame(float dt)
        {
            if (ticker60Fps.isTime(dt))
            {
                if (Speed > 0)
                {
                    Speed -= speedDamp;
                    if (Speed < 0)
                    {
                        Speed = 0;
                    }
                }
                //自转
                Body.Rotate(rotation);
                body.SetPosition(body.GetPosition() + Dir * Speed);
            }

            startBomb -= dt;
            if (startBomb < 0)
            {
                startBomb = 0;
                isBomb    = true;
            }
            //
            if (isBomb == true)
            {
                bombKeepTime -= dt;
                //持续时间结束就死亡
                if (bombKeepTime < 0)
                {
                    HP = 0;
                }
            }
            //
            if (NoContactTime > 0)
            {
                NoContactTime -= dt;
            }


            base.UpdateFrame(dt);
        }
Beispiel #4
0
 /// <summary>
 /// 使一些物体不随摄像机移动.
 /// </summary>
 public void KeepPos(Vector2 v2)
 {
     background.SetPosition(background.GetPosition() + v2);
 }
Beispiel #5
0
 public Vector2 GetPosition()
 {
     return(body.GetPosition());
 }