OK, so I am a complete noob with 2 weeks in this awesome SDK and I desperately need your help!
I am making a virtual pet app and I have a variable hunger set to default by 0. Than I’ll make it increase by 10 each xx minutes, when it reaches some figure the pet should change its status.
Well here’s my extremely newbie question
How is the listener supposed to look like?
For example
hunger = hunger + 50
if hunger = 50
then “hungry” = true
end
pet:addEventListener (?“hungry”?, getHungry)
function getHungry(event)
if event?..? then
pet:change…
end
end
eventName can’t be a boolean, right? how to bind the hunger value with the function?
I think I am missing something very simple… But its been 2 days, so no other way but ask for help…
Thanks!
[import]uid: 161390 topic_id: 29050 reply_id: 329050[/import]