Help for a newbie

hello to everyone.

I am new to programming in the corona and moon, and I need help.

I initially knowing the functions and I am not knowing how to put into practice.

I’m an idea in mind something like this.

I have an image in the center of the screen and when the screen is touched that image moves randomly anywhere on the screen.

I have not the slightest idea how to do this.

can someone give some basic examples?

PS: sorry if posted in the wrong section.
Thank you. [import]uid: 140401 topic_id: 25037 reply_id: 325037[/import]

Something like this:

local box = display.newRect( 135, 215, 50, 50 )  
  
local function randomTest( event )  
randomx = math.random( 25, 295 )  
randomy = math.random( 25, 455 )  
 if event.phase == "began" then  
 box.x = randomx  
 box.y = randomy  
 end  
end  
  
Runtime:addEventListener( "touch", randomTest )  

You can also make it so that it only moves when you click the image itself like this

--Runtime:addEventListener( "touch", randomTest ) -- ^^^ change this into whats below ^^^ box:addEventListener( "touch", randomTest ) [import]uid: 77199 topic_id: 25037 reply_id: 101711[/import]

thank you very much

helped me a lot,

with that I can have a base of touch events and their functionality.

Thank you so much [import]uid: 140401 topic_id: 25037 reply_id: 101728[/import]