title: game character moves out of screen limit
body: <p>In my game character should move from left to right (using accelerometer), and I've set the limit on the move that the character can make (i think). However it happens quite a few times, when the character has moved to it's right limit for example, and i tried tilting the phone right some more, somehow the character can move out of the permitted limit and goes missing in oblivion. here's my code -</p>
  
  <pre><code>display.setStatusBar (display.HiddenStatusBar)
  -- Hides the status bar
  
  local physics = require ("physics")
  physics.start()
  physics.setGravity(0,0)
  -- start physics engine and set the gravity (I'm using 0 to start, you might want to change this.)
  
  background = display.newImage ("back.jpg")
  local floor = display.newRect(320, 0, 1, 480)
  local lWall = display.newRect(0, 480, 320, 1)
  local rWall = display.newRect(0, -1, 320, 1)
  local ceiling = display.newRect(-1, 0, 1, 480)
  
  staticMaterial = {density=2, friction=.3, bounce=.4}
  physics.addBody(floor, "static", staticMaterial)
  physics.addBody(lWall, "static", staticMaterial)
  physics.addBody(rWall, "static", staticMaterial)
  physics.addBody(ceiling, "static", staticMaterial)
  -- Sets the background
  
  collector = display.newImage ("ms_throw.png")
  collector.x = 10
  collector.y = 10
  physics.addBody(collector, {friction = 1.0, bounce=0.6})
  -- Adds the collector and adds physics to the collector
  
  -- Create the table to throw eggs
  local vertPost = display.newRect(0, 400, 160, 10)
  vertPost:setFillColor(33, 33, 33)
  local horizPost = display.newRect(160, 400, 10, 155)
  horizPost:setFillColor(33, 33, 33)
  physics.addBody(vertPost, "static", staticMaterial)
  
  -- Put a character on top of the table
  thrower = display.newImage ("mr_throw.png")
  thrower.x = 230
  thrower.y = 460
  
  local motionx = 0
  local motiony = 0
  
  local function onAccelerate( event )
  motiony = 35 * event.yGravity
  end
  Runtime:addEventListener ("accelerometer", onAccelerate)
  
  local function movecollector (event)
  collector.x = collector.x + motionx
  collector.y = collector.y - motiony
  end
  Runtime:addEventListener("enterFrame", movecollector)
  </code></pre>