Permalink
Browse files

Added Mirage.Sprite actor

  • Loading branch information...
1 parent eb10663 commit 7f693d66ed081703ca08ad3ef91d7e74cacfa2d1 @chrome committed May 13, 2012
Showing with 24 additions and 0 deletions.
  1. +1 −0 Cakefile
  2. +23 −0 src/entities/sprite.coffee
View
@@ -12,6 +12,7 @@ unitedFiles = ->
'entities/resources/resource'
'entities/resources/image'
'entities/actor'
+ 'entities/sprite'
'entities/scene'
'components/renderer'
'components/resource_manager'
View
@@ -0,0 +1,23 @@
+class Mirage.Sprite extends Mirage.Actor
+
+ image: null
+
+ x: 0
+ y: 0
+ angle: 0
+ scale: 1
+
+ initialize: (@image) ->
+
+ moveTo: (dX, dY) ->
+ [@x, @y] = [dX, dY]
+
+ render: ->
+ Mirage.getRenderer()
+ .drawImage(
+ @image
+ x: @x
+ y: @y
+ angle: @angle
+ scale: @scale
+ )

0 comments on commit 7f693d6

Please sign in to comment.