Hi,
I’m making my first steps in lua and corona and having a really embarrasing problem. I’m sure it’s my own stupidity that this is not working but I’m following this tutorial: http://www.youtube.com/watch?v=qEMGcy-mizM&list=UUyv9aW0TsL_7WAZqTPuKXqA&index=39&feature=plcp. And I just don’t seem to get the touch event working. I’ve added a print statement to the function that should be called on touch but that also doesn’t print in the console. Underneath I’ve pasted all my code so far, and I’m working on a windows 7 PC. If anyone could point me at what I’m forgetting or doing wrong that would be greatly appreciated. I’ve searched the forums but couldn’t find this problem there either :(. Hope you can help me, thanks in advance.
[code]
–place background image
local BackgroundImage = display.newImage(“wall.png”)
–place balloon image
local Balloon1 = display.newImage(“balloon.png”)
Balloon1.x = display.contentWidth / 2
–turn on Physics for Balloon
Physics.addBody(Balloon1, { bounce = 0.2 })
–plade floor image
local Floor = display.newImage(“floor.png”)
Floor.y = display.contentHeight - Floor.stageHeight / 2
–turn on Physics for Floor
Physics.addBody(Floor,“static”)
–hide status bar
display.SetStatusBar( display.HiddenStatusBar )
–add event to Balloon1
function MoveBalloon1(event)
print(“touched”)
Balloon1:applyLinearImpulse(0,-0.2,Balloon1.x,Balloon1.y)
end
–add event listener
Balloon1:addEventListener(“touch”,MoveBalloon1)
[/code] [import]uid: 134940 topic_id: 23508 reply_id: 323508[/import]
[import]uid: 134940 topic_id: 23508 reply_id: 94312[/import]
That was it. Off course my own stupidity, it was there in the console all along. Just overlooked it somehow, to focussed on the wrong thing I guess. Sorry for taking up your time and thanks for helping out.