Hi,
1. Gideros is just great. Really, thank you for this awesome Development Kit.
2. I found a mistake in the official eBook:
On page 87, it sais:
self:removeEventListener(Event.MOUSE_DOWN, self.onMouseDown, self)
self:removeEventListener(Event.MOUSE_MOVE, self.onMouseMove, self)
self:removeEventListener(Event.MOUSE_UP, self.onMouseUp, self)
But the eventListeners weren't even created yet. Now i simply created them inside the MainBall:init() method. But according to the game rules (Meshball), they're supposed to be active only once. How should i do that?
Comments
the idea was that you create MainBall only once
inside MainBall:init add event listener
on mouse up remove event listeners
so the next time you do mouse down, nothing should happen, because the event listeners were removed
Does it make sense?
You can also check the code that should go along with the book:
https://github.com/ar2rsawseen/GiderosMobileGameDevelopmentBook
self:addEventListener(
Event.MOUSE_DOWN,
function(e)
self:onMouseDown(e)
end
)
self:addEventListener(
Event.MOUSE_MOVE,
function(e)
self:onMouseMove(e)
end
)
self:addEventListener(
Event.MOUSE_UP,
function(e)
self:onMouseUp(e)
end
)
Thx for your help! Nonetheless this should be added to the book:-)
http://giderosbook.waterbreadinternet.com/errata
and will be corrected/included in next edition