Skip to content

Commit

Permalink
Merge pull request #13 from T4g1/fixtodo
Browse files Browse the repository at this point in the history
[fix] Pop diff removed, removed todo
  • Loading branch information
T4g1 authored Sep 15, 2019
2 parents cf1d98e + 91dc044 commit 465bceb
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 17 deletions.
3 changes: 0 additions & 3 deletions nodes/City/City.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ const RED = Color(1.0, 0.0, 0.0, 0.5)
const GREEN = Color(0.0, 1.0, 0.0, 0.5)
const BARELY_VISIBLE = Color(1.0, 1.0, 1.0, 0.2)

onready var bloc_scene = preload("res://nodes/Bloc/Bloc.tscn")

export (Vector2) var starting_point = Vector2(7, 7)

func _ready():
Expand Down Expand Up @@ -50,7 +48,6 @@ func merge(polymino: Polymino):
for y in range(polymino.TETROMINO_SIZE):
var tile = polymino.get_node("Grid").get_cell(x, y)
if tile != -1:
# TODO configure tile is set_cell
$Grid.set_cell(cell_position.x + x, cell_position.y + y, tile)

for b in polymino.get_blocs():
Expand Down
1 change: 1 addition & 0 deletions nodes/GUIResources/GUIResources.gd
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func _ready():
resource.update_diff(0)

population.update_total(0)
population.update_diff(0)

func update_population(value: int):
population.update_total(value)
Expand Down
1 change: 1 addition & 0 deletions nodes/GUIResources/GUIResources.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ anchor_bottom = 0.8
margin_left = 0.0
margin_right = 80.0
icon = ExtResource( 3 )
show_diff = false

[node name="ConsumeBar" type="Control" parent="Container"]
margin_left = 104.101
Expand Down
9 changes: 4 additions & 5 deletions nodes/Polymino/Polymino.gd
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ var blocs: Array = []
func set_shape(new_shape):
if !has_node("Grid"):
return

shape = new_shape
var tiles := []

for __ in range(0, TETROMINO_SIZE):
# Create Bloc from prefab
var bloc: Bloc = bloc_packed.instance()
Expand All @@ -61,8 +61,7 @@ func set_shape(new_shape):
tiles.push_front(ResourceType.TYPES_TILES_ID[type])
else:
tiles.push_front(8)

# TODO give types to set_content

$Grid.set_content(PATTERN[shape], TETROMINO_SIZE, tiles)

func _on_clicked():
Expand All @@ -78,7 +77,7 @@ func get_production(type):
total += bloc.production
else:
total -= 1

return total

func get_production_food():
Expand Down
14 changes: 6 additions & 8 deletions nodes/Pool/Pool.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var POOL_SIZE := 4

func _ready():
pass

func generate_new_pool():
# flush
for c in get_children():
Expand All @@ -25,24 +25,22 @@ func generate_new_pool():

func _add_polymino():
var control = Control.new()

var polymino: Polymino = packed_polymino.instance()
polymino.set_shape(randi() % Polymino.PolyminoShape.size())

var production = gui_production.instance()
production.rect_scale = Vector2(0.5, 0.5)
production.rect_position.x = -60
production.rect_position.y = 35

# TODO: Compute real values


production.set_food(polymino.get_production_food())
production.set_wood(polymino.get_production_wood())
production.set_rock(polymino.get_production_rock())
production.set_gold(polymino.get_production_gold())

add_child(control)
control.add_child(polymino)
control.add_child(production)

emit_signal("add_polymino", polymino)
1 change: 0 additions & 1 deletion scenes/Game/game.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ margin_left = 512.0
margin_top = 238.0
margin_right = 512.0
margin_bottom = 238.0
starting_point = Vector2( 7, 7 )

[node name="Pool" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 480.0
Expand Down

0 comments on commit 465bceb

Please sign in to comment.