Moving Object to Right and bouncing of the edge......

Hi,

Hope someone can lead me in the right direction, I have the following code:

-- Cat Underneath-- local cato=display.newImage("cat.png") physics.addBody(cato, "static", {density=1.4,friction=0.5, bounce=3 } ) catrandom=math.random(320) cato.x=60+catrandom;cato.y=445 local function movecat(event) cato.x=x+5 end Runtime:addEventListener("enterframe", movecat)

In essence, I have a cat that I would like to move to the right or left randomly, and if the cat touches the edge of screen, the cat would bounce to the left, and vice versa. Right now, I’m getting the cat to show up randomly on the x asis, but the movement and bouncing part, is I need help with. I would appreciate any help regarding this matter…Thanks and God Bless…

Sincerely,

Sunday
[import]uid: 37726 topic_id: 7285 reply_id: 307285[/import]