Playing around with making classes and I can't find how to make this work:
Monster = Core.class();
function Monster:init()
self.health = 100
self.speed = 3
self.timer = Timer.new(1000,5);
local function doOnTimer(event)
print("Timer event!");
end
timer:addEventListener(Event.TIMER, doOnTimer);
self.timer:start()
end
Any help much appreciated
Thanks
Tom
Comments
self.timer:addEventListener(Event.TIMER, doOnTimer);
Likes: Tom2012
Likes: Tom2012