title: lua - screen limit for characters
body: <p><strong>I have a problem where my character keeps going out of my screen.</strong><br />
  How do I fix this problem? I know I need to put in a function to prevent the character from going out of the screen and managed to do it on the radius of the circle.</p>
  <pre><code>    if love.keyboard.isDown(&quot;right&quot;) then
          player.x = player.x + 4
      elseif love.keyboard.isDown(&quot;left&quot;) then
          player.x = player.x - 4
      elseif love.keyboard.isDown(&quot;up&quot;) then
          player.y = player.y - 4
      elseif love.keyboard.isDown(&quot;down&quot;) then
          player.y = player.y + 4
      end
  
      if AABB(player.x, player.y, player.w, player.h, target.x,    target.y, target.raduis) then
          score = score + 1
          target.x = math.random(target.raduis, love.graphics.getWidth() - target.raduis)
          target.y = math.random(target.raduis, love.graphics.getHeight()- 100)
      end
  </code></pre>