Evolution_War.MovingObject.LoopCollisionPhysics C# (CSharp) Method

LoopCollisionPhysics() protected method

protected LoopCollisionPhysics ( ) : void
return void
        protected virtual void LoopCollisionPhysics()
        {
            // wall collision.
            if (x + dx > World.Instance.Arena.Right) dx = -Math.Abs(dx);
            else if (x + dx < World.Instance.Arena.Left) dx = Math.Abs(dx);
            if (y + dy > World.Instance.Arena.Bottom) dy = -Math.Abs(dy);
            else if (y + dy < World.Instance.Arena.Top) dy = Math.Abs(dy);
        }