diff --git a/public/images/actions.png b/public/images/actions.png index b8cc1e6..1ee814d 100644 Binary files a/public/images/actions.png and b/public/images/actions.png differ diff --git a/src/app.coffee b/src/app.coffee index 1468d47..24df7e4 100644 --- a/src/app.coffee +++ b/src/app.coffee @@ -5,7 +5,7 @@ app = playground( smoothing: false, create: -> - @loadImages "layers", "active", "progress", "selected", "entities", "hud" + @loadImages "layers", "active", "progress", "selected", "entities", "hud", "actions" @currentHoveredTile = new Tile ready: -> diff --git a/src/hud.coffee b/src/hud.coffee index b059f05..bfac5c8 100644 --- a/src/hud.coffee +++ b/src/hud.coffee @@ -4,6 +4,8 @@ app.game.hud = @position = x: 45, y: 103 + @itemArrow = new AnimatedItem maxFrames: 12, image: app.images.actions, speed: 50 + @resources = [] for restype, i in resTypes @resources[restype] = new Tilelayer( @@ -37,7 +39,8 @@ app.game.hud = switch panelusage when 'entity' - app.layer.drawRegion app.images.entities, currentSelectedTile.entity.sprite(), 44, 102 + #app.layer.drawRegion app.images.entities, currentSelectedTile.entity.sprite(), 44, 102 + app.layer.drawRegion @itemArrow.image, @itemArrow.sprite(), 44, 102 when 'resources' # resources i = 0 diff --git a/src/items/animateditem.coffee b/src/items/animateditem.coffee index f1cb5e3..de65906 100644 --- a/src/items/animateditem.coffee +++ b/src/items/animateditem.coffee @@ -1,12 +1,12 @@ class AnimatedItem constructor: (options) -> - {@maxFrames, @image} + {@maxFrames, @image, @speed} = options @frame = 0 - window.setInterval @changeAnimation, 500 + window.setInterval @changeAnimation, @speed sprite: -> - [@frame*8, 8, 8, 8] + [@frame*8, 0, 8, 8] changeAnimation: => if @frame == @maxFrames