Can I recommend some tutorial videos to help you out generally as a Corona beginner?
http://www.youtube.com/user/cheetomoskeeto/videos?view=0
I used these when I first started using Corona, and they’re great. I would advise working through these before going through a book, they’re well explained which makes it easier to understand how Corona / Lua works. Some of it may be slightly outdated now, but I don’t think there’s is anything in there which won’t work, it’s more likely that things have been simplified further since those videos were made.
Onto your problem.
So firstly I set up any variables I might need:
--I always cache these values at the start of my program --since they are used so often to position objects local \_W = display.contentWidth local \_H = display.contentHeight --this is where we will store the number of taps local numTaps = 0 --make a rect which is full screen, this will be the object we tap
local touchableRect = display.newRect(0, 0, \_W, \_H) --let's make it red so that you can see the white text above it touchableRect:setFillColor(255, 0, 0)--this is the text object which will show the number of taps local numTapText = display.newText("0", \_W \* 0.5, \_H \* 0.5, native.systemFont, 30)
Now you need a tap function:
local function screenTap(event) numTaps = numTaps + 1 numTapText.text = numTaps end
And now add this function to an object:
touchableRect:addEventListener("tap", screenTap)
And that should be it!
Now when you tap, the total number of taps should increase and the text on screen should be updated (by changing it’s .text property).