Skip to content

Commit a64aeaf

Browse files
committed
update co2 system
1 parent 773adb2 commit a64aeaf

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

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 += 0.02 * GlobalVars.placedbuildings #put multiplicaton from buildings here
28+
$Camera2D/Climatechange.value += 0.002 * GlobalVars.placedbuildings #put multiplicaton from buildings here
2929
pass # Replace with function body.
3030

3131
func _on_powerplantbutton_mouse_entered():

main scene.tscn

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ theme_override_font_sizes/font_size = 200
279279
text = "Oil pump:
280280
-Costs 5 bits
281281
-Generates 1 oil per sec
282-
-Produces no emmisons
282+
-low carbon generation
283283
"
284284

285285
[node name="recyclepanel" type="Panel" parent="Camera2D"]
@@ -398,10 +398,10 @@ text = "Bank
398398
-Costs 5 bits
399399
-Uses 5 power ps
400400
-Generates 1 bit ps
401-
-Low Carbon generation
401+
-No Carbon generation
402402
"
403403

404-
[node name="banktext2" type="Label" parent="Camera2D"]
404+
[node name="climatetext" type="Label" parent="Camera2D"]
405405
offset_left = 68.0
406406
offset_top = -133.0
407407
offset_right = 1458.0

place on tilemap.gd

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,28 @@ func _on_bankbutton_pressed():
2121
func _on_coalminebutton_pressed():
2222
placingvalue = 5
2323

24+
# noemmissions = [-1,0,2,6]
25+
const lowemmissions = [3,4]
26+
const medemmissions = [5]
27+
const highemmissions = [1]
28+
2429
func _input(event):
2530
# Mouse in viewport coordinates.
2631

2732
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:
33+
if get_cell_source_id(0, Vector2i(floor(get_local_mouse_position()/32))) in lowemmissions:
34+
GlobalVars.placedbuildings -= 1
35+
if get_cell_source_id(0, Vector2i(floor(get_local_mouse_position()/32))) in medemmissions:
36+
GlobalVars.placedbuildings -= 3
37+
if get_cell_source_id(0, Vector2i(floor(get_local_mouse_position()/32))) in highemmissions:
38+
GlobalVars.placedbuildings -= 6
39+
if placingvalue in lowemmissions:
2940
GlobalVars.placedbuildings += 1
41+
if placingvalue in medemmissions:
42+
GlobalVars.placedbuildings += 3
43+
if placingvalue in highemmissions:
44+
GlobalVars.placedbuildings += 6
45+
print(GlobalVars.placedbuildings)
3046
set_cell(0, Vector2i(floor(get_local_mouse_position()/32)), placingvalue, Vector2i(0,0))
3147

3248

0 commit comments

Comments
 (0)