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); }
public override BoundBox GetBoundBox() { base.Center = body.GetPosition(); BoundBox bb = base.GetBoundBox(); //base.drawBoundBox.SetBoundBoxInfor(bb); return(bb); }
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); }
/// <summary> /// 使一些物体不随摄像机移动. /// </summary> public void KeepPos(Vector2 v2) { background.SetPosition(background.GetPosition() + v2); }
public Vector2 GetPosition() { return(body.GetPosition()); }