Skip to content

Instantly share code, notes, and snippets.

@mattcolman
Created September 17, 2012 05:38
Show Gist options
  • Save mattcolman/3735734 to your computer and use it in GitHub Desktop.
Save mattcolman/3735734 to your computer and use it in GitHub Desktop.
Actor class
define [
'caper/actor'
], (Actor) ->
class SampleActor extends Actor
added: (@parent, @pos) ->
@cnt = new Container()
@cnt.x = @pos.x
@cnt.y = @pos.y
@parent.addChild @cnt
@emit 'created'
removed: ->
@parent.removeChild @cnt
SampleActor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment