You probably won’t find anything like that except maybe in a book (try Dr Burton’s Books).
However, here is some code doing what you described (spawning circles in this example)
local mRand = math.random local function onTouch( event ) if( event.phase == "ended" ) then local tmp = display.newCircle( event.x, event.y, 20 ) tmp:setFillColor( mRand(), mRand(), mRand() ) end return true end Runtime:addEventListener( "touch", onTouch )
I suspect you’re having trouble because you are thinking in specific high level terminology like “spawn”, instead of starting at the bottom and learning about these ideas:
- touches
- listeners
- creation - Circles, rectangles, images, image rectangles
Note: This is not an admonition, but rather encouragement not to leap too fast without first learning the principles of working with Corona.