26 lines
364 B
CoffeeScript
26 lines
364 B
CoffeeScript
class Miner
|
|
constructor: ->
|
|
@frame = 0
|
|
window.setInterval @changeAnimation, 500
|
|
|
|
tick: (tile)->
|
|
tile.click "left"
|
|
|
|
sprite: ->
|
|
[@frame*8, 16, 8, 8]
|
|
|
|
spritedetail: ->
|
|
[0, 16*2, 16, 16]
|
|
|
|
isMoveable: ->
|
|
true
|
|
|
|
changeAnimation: =>
|
|
if @frame == 1
|
|
@frame = 0
|
|
else
|
|
@frame += 1
|
|
|
|
spaceProvided: 5
|
|
isDockable: false
|