Fixed some bugs, made gameplay better

This commit is contained in:
Ruben Müller 2014-12-07 20:48:54 +01:00
parent 661af48fd7
commit 4a0278e90c
9 changed files with 13 additions and 12 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

View file

@ -21,6 +21,6 @@ class Base
else else
@frame += 1 @frame += 1
spaceProvided: 300 spaceProvided: 30
energyProvided: 7 energyProvided: 7
isDockable: true isDockable: true

View file

@ -5,6 +5,9 @@ class Miner
tick: (tile) -> tick: (tile) ->
tile.click "left" tile.click "left"
tile.click "left"
tile.click "left"
tile.click "left"
sprite: -> sprite: ->
[@frame*8, 16, 8, 8] [@frame*8, 16, 8, 8]

View file

@ -20,7 +20,7 @@ class Silo
else else
@frame += 1 @frame += 1
spaceProvided: 150 spaceProvided: 15
energyProvided: 0 energyProvided: 0
isDockable: true isDockable: true

View file

@ -4,8 +4,6 @@ app.game =
@map[i] = new Tile(i) @map[i] = new Tile(i)
@map[20*5+10].entity = new Base @map[20*5+10].entity = new Base
# TODO: BUG BUG: ... the base is some time replaced by a tile ...
@mouseX = 0 @mouseX = 0
@mouseY = 0 @mouseY = 0
@currentHoveredTile = new Tile(-1) @currentHoveredTile = new Tile(-1)
@ -158,7 +156,7 @@ app.game =
createMiner: -> createMiner: ->
if @currentSelectedTile and !@currentSelectedTile.entity if @currentSelectedTile and !@currentSelectedTile.entity
if @checkResource('lubinit', 10, true) if @checkResource('lubinit', 5, true)
@currentSelectedTile.entity = new Miner @currentSelectedTile.entity = new Miner
else else
@speechbubble.say 'nores' @speechbubble.say 'nores'
@ -168,7 +166,7 @@ app.game =
createSilo: -> createSilo: ->
if @currentSelectedTile if @currentSelectedTile
if @checkPosition(@currentSelectedTile) if @checkPosition(@currentSelectedTile)
if @checkResource('dirt', 10, true) if @checkResource('dirt', 5, true)
@currentSelectedTile.entity = new Silo @currentSelectedTile.entity = new Silo
else else
@speechbubble.say 'nores' @speechbubble.say 'nores'
@ -181,7 +179,7 @@ app.game =
createSolarpanel: -> createSolarpanel: ->
if @currentSelectedTile if @currentSelectedTile
if @checkPosition(@currentSelectedTile) if @checkPosition(@currentSelectedTile)
if @checkResource('notch', 10, true) if @checkResource('notch', 30, true)
@currentSelectedTile.entity = new Solarpanel @currentSelectedTile.entity = new Solarpanel
else else
@speechbubble.say 'nores' @speechbubble.say 'nores'
@ -230,7 +228,7 @@ app.game =
map: [] map: []
miners: [] miners: []
maxTileAmount: 15 maxTileAmount: 75
availableSiloStorage: -> availableSiloStorage: ->
space = 0 space = 0

View file

@ -73,7 +73,7 @@ app.game.hud =
showBuildInfo: -> showBuildInfo: ->
clearTimeout(@timeout) if @timeout clearTimeout(@timeout) if @timeout
@buildinfo = true @buildinfo = true
@timeout = window.setTimeout @hideBuildInfo, 4000 @timeout = window.setTimeout @hideBuildInfo, 6000
hideBuildInfo: -> hideBuildInfo: ->
app.game.hud.buildinfo = false app.game.hud.buildinfo = false

View file

@ -14,7 +14,7 @@ class Tile
@entity = null @entity = null
@isActive = false @isActive = false
@isBuildable = !(Math.round(Math.random()*10) == 5) @isBuildable = !(Math.round(Math.random()*10) == 5)
@isBuildable = true if @isBuildable == 20*5+10 @isBuildable = true if @position == 20*5+10
@randomSeed = Math.round(Math.random()*10) @randomSeed = Math.round(Math.random()*10)
click: (button)-> click: (button)->