i have just finished the first level of the app, and i have a problem with my paddle to return the ball. the paddle moves with my finger, on the x-axis, but does not stop at the screen’s edge. my code:
local paddle = display.newImageRect (paddle, {“paddle.png”, 120, 33})
paddle.x = 159
paddle.y = 275
function movePaddle( event )
paddle.x = event.x
paddle.y = 275
end
Runtime:addEventListener(“touch”, movePaddle)
the question is is there a way to limit the movement range to say 300 pixels, without messing up on bigger or smaller screens?
the paddle.png is just a paint png that is a 320x100 gray square. nothing advanced about it, just me being hopeful for a simple fix.
[import]uid: 68665 topic_id: 11176 reply_id: 311176[/import]