Small Godot Wild Jam game
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Stop the player from opening multiple decisions at once & add the ability to pause on decision menu

+21 -2
+10
Scenes/dialogue/dialogue_container.gd
··· 58 58 if Global.available_doctors > 0: 59 59 var was_correct := choice_check(Global.UnitType.DOCTOR) 60 60 SignalBus.spawn_unit_request.emit(Global.UnitType.DOCTOR, Global.get_target_location(), was_correct) 61 + Global.is_currently_in_decision = false 62 + 63 + if Global.PAUSE_ON_EVENT: 64 + get_tree().paused = false 65 + 61 66 queue_free() 62 67 else: 63 68 SignalBus.play_error.emit() ··· 67 72 if Global.available_priests > 0: 68 73 var was_correct := choice_check(Global.UnitType.PRIEST) 69 74 SignalBus.spawn_unit_request.emit(Global.UnitType.PRIEST, Global.get_target_location(), was_correct) 75 + Global.is_currently_in_decision = false 76 + 77 + if Global.PAUSE_ON_EVENT: 78 + get_tree().paused = false 79 + 70 80 queue_free() 71 81 else: 72 82 SignalBus.play_error.emit()
+1
Scenes/dialogue/dialogue_container.tscn
··· 13 13 shadow_offset = Vector2(1, 2) 14 14 15 15 [node name="DialogueContainer" type="Control"] 16 + process_mode = 3 16 17 custom_minimum_size = Vector2(0, 192) 17 18 layout_mode = 3 18 19 anchors_preset = 12
+4 -1
Scenes/house_base/house_base.tscn
··· 27 27 28 28 func _on_event_signal_ping_input_event(viewport: Node, event: InputEvent, shape_idx: int) -> void: 29 29 if event.is_action_pressed(\"interact\"): 30 - if Global.can_spawn_unit(): 30 + if Global.can_spawn_unit() and !Global.is_currently_in_decision: 31 + Global.is_currently_in_decision = true 31 32 event_signal_ping.visible = false 32 33 has_event = false 33 34 var nav: NavPoint = find_children(\"*\", \"NavPoint\").front() 34 35 SignalBus.event_pin_clicked.emit(name, nav.global_position, house_type) 35 36 print(name) 37 + if Global.PAUSE_ON_EVENT: 38 + get_tree().paused = true 36 39 else: 37 40 SignalBus.play_error.emit() 38 41
+6 -1
Scripts/global.gd
··· 1 1 extends Node 2 2 3 + #region DEV OPTIONS 4 + const PAUSE_ON_EVENT: bool = true # Pauses the game while the player is making decisions 5 + #endregion 6 + 3 7 #region Varaibles 4 8 var debug_mode: bool = false 5 - var rng := RandomNumberGenerator.new() 9 + var is_currently_in_decision: bool = false 10 + @onready var rng := RandomNumberGenerator.new() 6 11 7 12 var population_total: int = 150 8 13