Tiles can be selected now

This commit is contained in:
Ruben Müller 2014-12-06 16:52:53 +01:00
parent c66e9a68b5
commit 05abf401a6
3 changed files with 7 additions and 3 deletions

BIN
public/images/selected.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 946 B

View file

@ -12,7 +12,8 @@ class Tile extends BaseEntity
@isActive = false
click: (button)->
console.log button
# console.log button
@isSelected = true
moveIn: ->
@isActive = true
@ -26,5 +27,8 @@ class Tile extends BaseEntity
render: (x, y)->
tileLayer = @layers[@currentLayer]
app.layer.drawRegion app.images.layers, tileLayer.sprite, x*8, y*8
if @isActive
if @isSelected
app.layer.drawImage app.images.selected, x*8, y*8
else if @isActive
app.layer.drawImage app.images.active, x*8, y*8

View file

@ -5,7 +5,7 @@ app = playground({
smoothing: false,
create: ->
@loadImages "layers", "active"
@loadImages "layers", "active", "selected"
@currentHoveredTile = new Tile
ready: ->