Example #1
0
 public override void Step(float dt)
 {
     if (this.IsBoundarySet)
     {
         // whole map fits inside a single screen, no need to modify the position - unless map boundaries are increased
         if (this._isBoundaryFullyCovered)
         {
             return;
         }
         CCPoint tempPos = this._halfScreenSize - this._followedNode.Position;
         Target.Position = new CCPoint(
             CCPoint.Clamp(tempPos.X, this._leftBoundary, this._rightBoundary),
             CCPoint.Clamp(tempPos.Y, this._bottomBoundary, this._topBoundary)
             );
     }
     else
     {
         Target.Position = this._halfScreenSize - this._followedNode.Position;
     }
 }