Merge branch 'master' of https://github.com/arg-games/ld31
Conflicts: public/images/entities.png
This commit is contained in:
commit
cecb52a963
13 changed files with 26 additions and 11 deletions
|
@ -11,7 +11,6 @@ Title: Entire game on one screen
|
||||||
* TODO HUD
|
* TODO HUD
|
||||||
** hud: energie progress bar :aaron:
|
** hud: energie progress bar :aaron:
|
||||||
** hud: resources "release to space" on click :aaron:
|
** hud: resources "release to space" on click :aaron:
|
||||||
** selektierte entity in großansicht anzeigen :aaron::jonas:
|
|
||||||
** Hint für shortcuts anzeigen :ruben:
|
** Hint für shortcuts anzeigen :ruben:
|
||||||
** Preise für entities :ruben:
|
** Preise für entities :ruben:
|
||||||
|
|
||||||
|
@ -19,7 +18,6 @@ Title: Entire game on one screen
|
||||||
** solarpanel item :aaron:
|
** solarpanel item :aaron:
|
||||||
|
|
||||||
* TODO Polishing
|
* TODO Polishing
|
||||||
** "tote" flächen: nicht klickbar :aaron:
|
|
||||||
|
|
||||||
* TODO OUTRO
|
* TODO OUTRO
|
||||||
** animation bei voller energybar: typ fliegt davon
|
** animation bei voller energybar: typ fliegt davon
|
||||||
|
@ -28,4 +26,4 @@ Title: Entire game on one screen
|
||||||
* TODO EXTRA Polishing
|
* TODO EXTRA Polishing
|
||||||
** game balancing
|
** game balancing
|
||||||
** Miner verschieben
|
** Miner verschieben
|
||||||
** Silos: Farben je nach Kapazität einfärben
|
** Silos: Farben je nach Kapazität einfärben
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 696 B |
BIN
public/images/entitydetails.png
Normal file
BIN
public/images/entitydetails.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
public/images/layerdetails.png
Normal file
BIN
public/images/layerdetails.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.5 KiB |
|
@ -5,7 +5,7 @@ app = playground(
|
||||||
smoothing: false,
|
smoothing: false,
|
||||||
|
|
||||||
create: ->
|
create: ->
|
||||||
@loadImages "layers", "active", "progress", "selected", "entities", "hud", "actions", "speechbubbles", "deadtiles"
|
@loadImages "layers", "active", "progress", "selected", "entities", "hud", "actions", "speechbubbles", "deadtiles", "layerdetails", "entitydetails"
|
||||||
@currentHoveredTile = new Tile
|
@currentHoveredTile = new Tile
|
||||||
|
|
||||||
ready: ->
|
ready: ->
|
||||||
|
|
|
@ -9,6 +9,9 @@ class Base
|
||||||
sprite: ->
|
sprite: ->
|
||||||
[@frame*8, 0, 8, 8]
|
[@frame*8, 0, 8, 8]
|
||||||
|
|
||||||
|
spritedetail: ->
|
||||||
|
[0, 0, 16, 16]
|
||||||
|
|
||||||
isMoveable: ->
|
isMoveable: ->
|
||||||
false
|
false
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,9 @@ class Miner
|
||||||
sprite: ->
|
sprite: ->
|
||||||
[@frame*8, 16, 8, 8]
|
[@frame*8, 16, 8, 8]
|
||||||
|
|
||||||
|
spritedetail: ->
|
||||||
|
[0, 16*2, 16, 16]
|
||||||
|
|
||||||
isMoveable: ->
|
isMoveable: ->
|
||||||
true
|
true
|
||||||
|
|
||||||
|
|
|
@ -6,13 +6,16 @@ class Silo
|
||||||
tick: (tile)->
|
tick: (tile)->
|
||||||
|
|
||||||
sprite: ->
|
sprite: ->
|
||||||
[@frame*8, 8, 8, 8]
|
[@frame*8, 8, 8, 8]
|
||||||
|
|
||||||
|
spritedetail: ->
|
||||||
|
[0, 16, 16, 16]
|
||||||
|
|
||||||
isMoveable: ->
|
isMoveable: ->
|
||||||
false
|
false
|
||||||
|
|
||||||
changeAnimation: =>
|
changeAnimation: =>
|
||||||
if @frame == 2
|
if @frame == 1
|
||||||
@frame = 0
|
@frame = 0
|
||||||
else
|
else
|
||||||
@frame += 1
|
@frame += 1
|
||||||
|
|
|
@ -5,8 +5,7 @@ app.game =
|
||||||
@map[20*5+10].entity = new Base
|
@map[20*5+10].entity = new Base
|
||||||
|
|
||||||
@mouseX = 0
|
@mouseX = 0
|
||||||
@mouseY = 0
|
@mouseY = 0
|
||||||
|
|
||||||
@currentHoveredTile = new Tile(-1)
|
@currentHoveredTile = new Tile(-1)
|
||||||
@currentSelectedTile = null
|
@currentSelectedTile = null
|
||||||
|
|
||||||
|
@ -23,10 +22,14 @@ app.game =
|
||||||
@speechbubble.render()
|
@speechbubble.render()
|
||||||
|
|
||||||
mousedown: (event)->
|
mousedown: (event)->
|
||||||
|
tile = posToTile(Math.floor(event.x/8), Math.floor(event.y/8))
|
||||||
|
|
||||||
|
# Can't click on dead tiles
|
||||||
|
return unless tile and tile.isBuildable
|
||||||
|
|
||||||
if @isMouseInView event.x/8, event.y/8
|
if @isMouseInView event.x/8, event.y/8
|
||||||
switch event.button
|
switch event.button
|
||||||
when 'left'
|
when 'left'
|
||||||
tile = posToTile(Math.floor(event.x/8), Math.floor(event.y/8))
|
|
||||||
tile.click(event.button)
|
tile.click(event.button)
|
||||||
|
|
||||||
@currentSelectedTile.deselect() if @currentSelectedTile
|
@currentSelectedTile.deselect() if @currentSelectedTile
|
||||||
|
|
|
@ -22,11 +22,12 @@ app.game.hud =
|
||||||
if currentSelectedTile != null
|
if currentSelectedTile != null
|
||||||
panelusage = 'tile'
|
panelusage = 'tile'
|
||||||
|
|
||||||
app.layer.drawRegion app.images.layers, currentSelectedTile.getCurrentLayer().sprite, 15, 100
|
|
||||||
|
|
||||||
if currentSelectedTile.entity
|
if currentSelectedTile.entity
|
||||||
panelusage = 'entity'
|
panelusage = 'entity'
|
||||||
app.layer.drawRegion app.images.entities, currentSelectedTile.entity.sprite(), 15, 100
|
app.layer.drawRegion app.images.entitydetails, currentSelectedTile.entity.spritedetail(), 12, 95
|
||||||
|
else
|
||||||
|
app.layer.drawRegion app.images.layerdetails, currentSelectedTile.getCurrentLayer().spritedetail, 12, 95
|
||||||
|
|
||||||
# silo capacity
|
# silo capacity
|
||||||
usedSiloStoragePercent = Math.round((100 / app.game.availableSiloStorage()) * app.game.usedSiloStorage())
|
usedSiloStoragePercent = Math.round((100 / app.game.availableSiloStorage()) * app.game.usedSiloStorage())
|
||||||
|
|
|
@ -16,6 +16,9 @@ class Tile
|
||||||
@randomSeed = Math.round(Math.random()*10)
|
@randomSeed = Math.round(Math.random()*10)
|
||||||
|
|
||||||
click: (button)->
|
click: (button)->
|
||||||
|
# Some tiles are not buildable
|
||||||
|
return unless @isBuildable
|
||||||
|
|
||||||
if button == "left"
|
if button == "left"
|
||||||
if (app.game.availableSiloStorage() - app.game.usedSiloStorage()) > 0
|
if (app.game.availableSiloStorage() - app.game.usedSiloStorage()) > 0
|
||||||
if @layers[@currentLayer].collect()
|
if @layers[@currentLayer].collect()
|
||||||
|
|
|
@ -3,6 +3,7 @@ class Tilelayer
|
||||||
{@type, @depth, @amount} = options
|
{@type, @depth, @amount} = options
|
||||||
@randomFactor = getRandomInt 0, 4
|
@randomFactor = getRandomInt 0, 4
|
||||||
@sprite = [@randomFactor*8, @depth*8, 8, 8]
|
@sprite = [@randomFactor*8, @depth*8, 8, 8]
|
||||||
|
@spritedetail = [0, @depth*16, 16, 16]
|
||||||
@hudSprite = [@randomFactor*8, @depth*8, 4, 4]
|
@hudSprite = [@randomFactor*8, @depth*8, 4, 4]
|
||||||
|
|
||||||
collect: ->
|
collect: ->
|
||||||
|
|
Loading…
Reference in a new issue