 class AniCycle
     #constructor
     constructor: (data) ->
-        #throw errors if proper data isn't supplied
-        throw new Error "name must be supplied" unless data.name?
-        throw new Error "startRow must be supplied" unless data.startRow?
-        throw new Error "numFrames must be supplied" unless data.numFrames?
-        
         #extract data
+        @frame = 1
         @name = data.name
-        @startRow = data.startRow
+        @row = data.row
         @numFrames = data.numFrames
-        @frame = 1
 
 class @AniSprite extends @Sprite
     #constructor

        @_dis.timer = new Timer()
        
        #push provided cycles onto the array
        for own key, value of config when key.indexOf("cycle") is 0
            key.name ?= key.slice 5
            @_dis.cycles.push(new AniCycle(value)) 
        
        #call Sprite constructor
        super(config)
        
        #return this
        this
    
    #getter
    get: (what) ->
        #add later
    
    #setter
    set: (what, to) ->
        #add later
    
    #changer
    change: (what, step) ->
        #add later
    
    #animation control
    play: ->
        @_dis.timer.start()
    pause: ->
        @_dis.timer.pause()
    
    #update routines
    _draw: ->

        @_dis.translate @_pos.x, -@_pos.y
        @_dis.rotate -@_pos.a
        
        #draw frame
        @_dis.context.drawImage( 
            @_dis.image, #spritesheet
            (@_dis.current.frame - 1) * @_dis.cellWidth, #sx
            (@_dis.current.row - 1) * @_dis.cellHeight, #sy
            @_dis.cellWidth, #swidth
            @_dis.cellHeight, #sheight
            -@_dis.width / 2, #x
            -@_dis.height / 2, #y
            @_dis.width, #width
            @_dis.height) #height
        
        #restore context
        @_dis.context.restore()
    _update: =>
        if @_dis.timer.getElapsedTime() >= (1000 / @_dis.frameRate)
            if @_dis.current.frame < @_dis.current.numFrames
                @_dis.current.frame += 1
            else
                @_dis.current.frame = 1
            @_dis.timer.restart()
        super()
#end class AniSprite
