Skip to content

Commit 6ea7a52

Browse files
committed
increase climate change based on buildings placed
1 parent ed9b9fc commit 6ea7a52

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

global.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ var stime = ""
55
var power = 0
66
var spower = ""
77
var season = 0
8+
var placedbuildings = 0

main scene.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func _process(delta):
2525

2626

2727
func _on_timer_timeout():
28-
$Camera2D/Climatechange.value += 1 #put multiplicaton from buildings here
28+
$Camera2D/Climatechange.value += 0.02 * GlobalVars.placedbuildings #put multiplicaton from buildings here
2929
pass # Replace with function body.
3030

3131
func _on_powerplantbutton_mouse_entered():

place on tilemap.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ func _input(event):
2525
# Mouse in viewport coordinates.
2626

2727
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.is_pressed() == true and mouseontilemap:
28+
if get_cell_source_id(0, Vector2i(floor(get_local_mouse_position()/32))) < 1:
29+
GlobalVars.placedbuildings += 1
2830
set_cell(0, Vector2i(floor(get_local_mouse_position()/32)), placingvalue, Vector2i(0,0))
2931

3032

0 commit comments

Comments
 (0)