Skip to content

Instantly share code, notes, and snippets.

@cigumo
Created April 3, 2014 16:41
Show Gist options
  • Save cigumo/9958088 to your computer and use it in GitHub Desktop.
Save cigumo/9958088 to your computer and use it in GitHub Desktop.
Engine = class('Engine')
function Engine:initialize()
-- ...
self:register_signals()
end
function Engine:pan_camera(dx,dy)
-- moves the camera using self.camera
end
function Engine:register_signals()
local e = self
signal.register(CMD_PAN_MAP, function(dx,dy) e:pan_camera(dx,dy))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment