I'm trying to get into gideros development to create a game...
I've downloaded a tutorial from http
/ bluebilby.com/2013/05/08/gideros-mobile-tutorial-creating-your-first-game/#codesyntax_13, and I am trying to alter it so that I can move the 'player' from the keyboard
So I have added the following functions to main.lua:
function onKeyDown(event)
print("key down:"..event.keycode)
end
function onKeyUp(event)
end
and below the line stage:addEventListener(Event.ENTER_FRAME, updateAll), I have added the following two lines:
stage:addEventListener(Event.KEY_DOWN, onKeyDown, event)
stage:addEventListener(Event.KEY_UP, onKeyUp, event)
but whenever I press a key on the keyboard after running the game I get the following message:
main.lua:326: attempt to concatenate field 'keycode' (a nil value)
stack traceback:
main.lua:326: in function
Comments