diff --git a/scenes/main_scene.tscn b/scenes/main_scene.tscn index e1a0067..f5d53c2 100644 --- a/scenes/main_scene.tscn +++ b/scenes/main_scene.tscn @@ -248,13 +248,18 @@ text = "OCEAN" horizontal_alignment = 1 vertical_alignment = 1 -[node name="PressureInfo" type="PanelContainer" parent="UI/HUD/MarginContainer/HUDContainer"] +[node name="PressureStack" type="VBoxContainer" parent="UI/HUD/MarginContainer/HUDContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_constants/separation = 10 + +[node name="PressureInfo" type="PanelContainer" parent="UI/HUD/MarginContainer/HUDContainer/PressureStack"] custom_minimum_size = Vector2(200, 0) layout_mode = 2 size_flags_horizontal = 3 theme_override_styles/panel = SubResource("StyleBoxFlat_digital") -[node name="PressureBar" type="ProgressBar" parent="UI/HUD/MarginContainer/HUDContainer/PressureInfo"] +[node name="PressureBar" type="ProgressBar" parent="UI/HUD/MarginContainer/HUDContainer/PressureStack/PressureInfo"] custom_minimum_size = Vector2(0, 30) layout_mode = 2 size_flags_vertical = 1 @@ -262,11 +267,11 @@ theme_override_styles/background = SubResource("StyleBoxFlat_bar_bg") value = 100.0 show_percentage = false -[node name="VBoxContainer" type="VBoxContainer" parent="UI/HUD/MarginContainer/HUDContainer/PressureInfo"] +[node name="VBoxContainer" type="VBoxContainer" parent="UI/HUD/MarginContainer/HUDContainer/PressureStack/PressureInfo"] layout_mode = 2 theme_override_constants/separation = 5 -[node name="PressureLabel" type="Label" parent="UI/HUD/MarginContainer/HUDContainer/PressureInfo/VBoxContainer"] +[node name="PressureLabel" type="Label" parent="UI/HUD/MarginContainer/HUDContainer/PressureStack/PressureInfo/VBoxContainer"] layout_mode = 2 theme_override_colors/font_color = Color(0.780392, 0.780392, 0.780392, 1) theme_override_font_sizes/font_size = 20 @@ -275,6 +280,19 @@ text = "PRESSURE SYSTEM" label_settings = SubResource("LabelSettings_kkokr") horizontal_alignment = 1 +[node name="PauseToggle" type="Button" parent="UI/HUD/MarginContainer/HUDContainer/PressureStack"] +layout_mode = 2 +size_flags_horizontal = 3 +custom_minimum_size = Vector2(0, 60) +focus_mode = 0 +toggle_mode = true +theme_override_font_sizes/font_size = 32 +theme_override_styles/normal = SubResource("StyleBoxFlat_digital") +theme_override_styles/hover = SubResource("StyleBoxFlat_subway") +theme_override_styles/pressed = SubResource("StyleBoxFlat_subway") +text = "⏯" +tooltip_text = "Pause / Resume" + [node name="CooldownInfo" type="HBoxContainer" parent="UI/HUD/MarginContainer/HUDContainer"] visible = false layout_mode = 2 @@ -514,9 +532,10 @@ horizontal_alignment = 1 [node name="AchievementUI" parent="UI" instance=ExtResource("24_qr5t3")] layout_mode = 1 -offset_left = -190.0 -offset_top = 105.0 -offset_bottom = 525.0 +offset_left = -580.0 +offset_top = 80.0 +offset_right = -20.0 +offset_bottom = 980.0 [node name="CenterContainer" type="CenterContainer" parent="UI"] layout_mode = 1 diff --git a/scenes/popup_text.tscn b/scenes/popup_text.tscn index 5135b0c..7572e5f 100644 --- a/scenes/popup_text.tscn +++ b/scenes/popup_text.tscn @@ -15,6 +15,6 @@ render_priority = 1 outline_render_priority = 0 text = "Lorem Ipsum" font = SubResource("SystemFont_tmlj2") -font_size = 64 +font_size = 80 outline_size = 8 script = ExtResource("1_4m4vl") diff --git a/scenes/ui/achievement_item.tscn b/scenes/ui/achievement_item.tscn index 74891e7..0b27d02 100644 --- a/scenes/ui/achievement_item.tscn +++ b/scenes/ui/achievement_item.tscn @@ -18,7 +18,7 @@ corner_radius_bottom_left = 4 [node name="AchievementItem" type="PanelContainer"] anchors_preset = 10 anchor_right = 1.0 -offset_bottom = 72.0 +offset_bottom = 96.0 grow_horizontal = 2 mouse_filter = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_icon_bg") @@ -27,18 +27,18 @@ script = ExtResource("1_cxj3s") [node name="MarginContainer" type="MarginContainer" parent="."] layout_mode = 2 mouse_filter = 2 -theme_override_constants/margin_left = 4 -theme_override_constants/margin_top = 4 -theme_override_constants/margin_right = 4 -theme_override_constants/margin_bottom = 4 +theme_override_constants/margin_left = 8 +theme_override_constants/margin_top = 8 +theme_override_constants/margin_right = 8 +theme_override_constants/margin_bottom = 8 [node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"] layout_mode = 2 mouse_filter = 2 -theme_override_constants/separation = 16 +theme_override_constants/separation = 24 [node name="IconTexture" type="TextureRect" parent="MarginContainer/HBoxContainer"] -custom_minimum_size = Vector2(64, 64) +custom_minimum_size = Vector2(86, 86) layout_mode = 2 size_flags_vertical = 4 mouse_filter = 2 @@ -50,11 +50,11 @@ stretch_mode = 5 layout_mode = 2 size_flags_horizontal = 3 theme_override_colors/font_color = Color(0.780392, 0.780392, 0.780392, 1) -theme_override_font_sizes/font_size = 22 +theme_override_font_sizes/font_size = 30 text = "???" vertical_alignment = 1 [node name="BadgesContainer" type="HBoxContainer" parent="MarginContainer/HBoxContainer"] layout_mode = 2 mouse_filter = 2 -theme_override_constants/separation = 8 +theme_override_constants/separation = 12 diff --git a/scenes/ui/achievement_panel.tscn b/scenes/ui/achievement_panel.tscn index d370d7d..1092323 100644 --- a/scenes/ui/achievement_panel.tscn +++ b/scenes/ui/achievement_panel.tscn @@ -12,10 +12,10 @@ layout_mode = 3 anchors_preset = 1 anchor_left = 1.0 anchor_right = 1.0 -offset_left = -420.0 -offset_top = 100.0 +offset_left = -580.0 +offset_top = 80.0 offset_right = -20.0 -offset_bottom = 840.0 +offset_bottom = 980.0 grow_horizontal = 0 mouse_filter = 2 script = ExtResource("1_nkt0o") @@ -33,15 +33,15 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_main_panel") [node name="MarginContainer" type="MarginContainer" parent="PanelContainer"] layout_mode = 2 mouse_filter = 2 -theme_override_constants/margin_left = 18 -theme_override_constants/margin_top = 18 -theme_override_constants/margin_right = 18 -theme_override_constants/margin_bottom = 18 +theme_override_constants/margin_left = 26 +theme_override_constants/margin_top = 26 +theme_override_constants/margin_right = 26 +theme_override_constants/margin_bottom = 26 [node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer"] layout_mode = 2 mouse_filter = 2 -theme_override_constants/separation = 12 +theme_override_constants/separation = 18 [node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 @@ -54,7 +54,7 @@ vertical_scroll_mode = 0 layout_mode = 2 size_flags_horizontal = 3 mouse_filter = 2 -theme_override_constants/separation = 6 +theme_override_constants/separation = 10 [node name="badgesContainer" type="HBoxContainer" parent="PanelContainer/MarginContainer/VBoxContainer/ScrollContainer/AchievementContainer"] visible = false diff --git a/scripts/boss.gd b/scripts/boss.gd index 2f40547..530f2e9 100644 --- a/scripts/boss.gd +++ b/scripts/boss.gd @@ -12,7 +12,7 @@ signal boss_spawned_signal(max_health) signal boss_defeated_signal signal boss_health_bar_hidden -enum BossDialogSections {TUTORIAL1, TUTORIAL2, TUTORIAL3, TUTORIAL4, RESCUE_CALL, BOSS_INTRO, BOSS_KILLS_FRIEND, FRIEND_RESCUED, WIN, BOSS_DEFEATED, POST_INTRO_RESCUE, AK47_UNLOCKED} +enum BossDialogSections {TUTORIAL1, TUTORIAL2, TUTORIAL3, TUTORIAL4, RESCUE_CALL, BOSS_INTRO, BOSS_KILLS_FRIEND, FRIEND_RESCUED, WIN, BOSS_DEFEATED, POST_INTRO_RESCUE, AK47_UNLOCKED, DOCK_HINT} var boss_dialog_from = { BossDialogSections.TUTORIAL1: "John", @@ -27,6 +27,7 @@ var boss_dialog_from = { BossDialogSections.WIN: "Too Fishy", BossDialogSections.POST_INTRO_RESCUE: "John", BossDialogSections.AK47_UNLOCKED: "John", + BossDialogSections.DOCK_HINT: "John", } var dialog_depth_map = { diff --git a/scripts/game_state.gd b/scripts/game_state.gd index 977ab33..50b8b99 100644 --- a/scripts/game_state.gd +++ b/scripts/game_state.gd @@ -79,6 +79,7 @@ var health = 100.0 var headroom = 0 var death_screen = false var paused = true +var john_dock_hint_shown := false var inventory: Inv = Inv.new() @@ -168,6 +169,7 @@ func start_intro_mission(): is_first_time_player = true intro_mission_completed = false boss_encountered = false # Reset boss encounter flag for intro mission + john_dock_hint_shown = false # Reset game state properly for intro mission death_screen = false @@ -239,6 +241,7 @@ func complete_intro_mission(death_position: Vector3): print("Completing intro mission at position: ", death_position) friend_death_position = death_position intro_mission_completed = true + john_dock_hint_shown = false # Reset upgrades to 0 for normal player reset_upgrades() # Reset money to starting amount @@ -273,6 +276,7 @@ func start_normal_mode(): is_first_time_player = false intro_mission_completed = true # Intro mission is skipped in normal mode boss_encountered = false # Reset boss encounter flag in normal mode + john_dock_hint_shown = false # Initialize normal game state death_screen = false @@ -333,3 +337,9 @@ func restore_ui_after_intro_mission(): upgrade_menu.refresh_all_upgrades() else: print("Upgrade menu not found or missing rebuild method") + +func ensure_dock_hint() -> void: + if john_dock_hint_shown or is_intro(): + return + john_dock_hint_shown = true + Boss.setDialogStage(Boss.BossDialogSections.DOCK_HINT) diff --git a/scripts/hud.gd b/scripts/hud.gd index 230fa3b..c085edd 100644 --- a/scripts/hud.gd +++ b/scripts/hud.gd @@ -3,7 +3,7 @@ extends PanelContainer @onready var container = $MarginContainer/HUDContainer @onready var current_stage_label = $MarginContainer/HUDContainer/StageInfo/VBoxContainer/StageValue @onready var health_bar = $MarginContainer/HUDContainer/HealthInfo/HealthBar -@onready var pressure_headroom_bar = $MarginContainer/HUDContainer/PressureInfo/PressureBar +@onready var pressure_headroom_bar = $MarginContainer/HUDContainer/PressureStack/PressureInfo/PressureBar # Depth indicator @onready var depth_indicator = $MarginContainer/DepthIndicator @@ -35,8 +35,9 @@ extends PanelContainer # These might not be needed if all styling is via .tscn, but keep for now. @onready var health_info_panel = $MarginContainer/HUDContainer/HealthInfo @onready var stage_info_panel = $MarginContainer/HUDContainer/StageInfo -@onready var pressure_info_panel = $MarginContainer/HUDContainer/PressureInfo +@onready var pressure_info_panel = $MarginContainer/HUDContainer/PressureStack/PressureInfo @onready var cooldown_info_panel = $MarginContainer/HUDContainer/CooldownInfo +@onready var pause_button = $MarginContainer/HUDContainer/PressureStack/PauseToggle var _fill_style_override: StyleBoxFlat var _health_fill_override: StyleBoxFlat @@ -44,6 +45,7 @@ var _harpoon_fill_override: StyleBoxFlat var _buoy_fill_override: StyleBoxFlat var _drone_fill_override: StyleBoxFlat var _ak47_fill_override: StyleBoxFlat +var pause_menu: Control = null # Variables for smooth marker movement var current_marker_target_pos: float = 0 @@ -114,6 +116,7 @@ func _ready(): $MarginContainer.add_theme_constant_override("margin_right", 15) $MarginContainer.add_theme_constant_override("margin_top", 15) $MarginContainer.add_theme_constant_override("margin_bottom", 15) + _setup_pause_control() func create_cooldown_style() -> StyleBoxFlat: var style = StyleBoxFlat.new() @@ -202,6 +205,11 @@ func _process(delta: float) -> void: _ak47_fill_override.bg_color = COLOR_COOLDOWN_READY ak47_label.text = "AK47\n(%d/%d)" % [ak47.get_current_ammo(), max_ammo] + if is_instance_valid(pause_button): + pause_button.disabled = GameState.isDocked + if GameState.isDocked and pause_button.button_pressed: + pause_button.set_pressed_no_signal(false) + # Update the depth indicator display with smooth movement func update_depth_indicator(delta: float) -> void: if !is_instance_valid(marker_container) or !is_instance_valid(current_depth_marker) or !is_instance_valid(max_depth_marker): @@ -230,3 +238,32 @@ func update_depth_indicator(delta: float) -> void: # Apply smoothed positions to markers current_depth_marker.position.x = current_marker_pos max_depth_marker.position.x = max_marker_pos + +func _setup_pause_control() -> void: + var ui_root := get_parent() + if ui_root and ui_root.has_node("CenterContainer/PauseMenu"): + pause_menu = ui_root.get_node("CenterContainer/PauseMenu") + if is_instance_valid(pause_button): + pause_button.toggled.connect(_on_pause_button_toggled) + if pause_menu and pause_menu.has_signal("pause_state_changed"): + pause_menu.pause_state_changed.connect(_on_pause_state_changed) + if pause_menu and is_instance_valid(pause_button): + pause_button.set_pressed_no_signal(pause_menu.is_paused) + +func _on_pause_button_toggled(pressed: bool) -> void: + if GameState.isDocked: + if is_instance_valid(pause_button): + pause_button.set_pressed_no_signal(false) + return + if pause_menu: + if pressed and pause_menu.has_method("pause_game"): + pause_menu.pause_game() + elif not pressed and pause_menu.has_method("resume_game"): + pause_menu.resume_game() + else: + Input.action_press("esc") + Input.action_release("esc") + +func _on_pause_state_changed(paused: bool) -> void: + if is_instance_valid(pause_button): + pause_button.set_pressed_no_signal(paused) diff --git a/scripts/pause_menu.gd b/scripts/pause_menu.gd index 235e259..6b402ba 100644 --- a/scripts/pause_menu.gd +++ b/scripts/pause_menu.gd @@ -1,5 +1,7 @@ extends Control +signal pause_state_changed(paused: bool) + @onready var save_menu = $SaveMenu @onready var settings_menu = $SettingsMenu @onready var panel = $Panel @@ -63,6 +65,7 @@ func pause_game(): show_pause_elements(true) get_tree().paused = true is_paused = true + pause_state_changed.emit(true) func resume_game(): # Hide pause menu and resume the game @@ -71,6 +74,7 @@ func resume_game(): settings_menu.hide() get_tree().paused = false is_paused = false + pause_state_changed.emit(false) func show_pause_elements(show_elements: bool): if show_elements: diff --git a/scripts/player.gd b/scripts/player.gd index dfea23c..15fed72 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -462,6 +462,7 @@ func process_dock(delta): if not GameState.isDocked: onDock() GameState.isDocked = true + GameState.ensure_dock_hint() else: if GameState.isDocked: GameState.isDocked = false diff --git a/scripts/strings.gd b/scripts/strings.gd index baca71c..49e52bd 100644 --- a/scripts/strings.gd +++ b/scripts/strings.gd @@ -41,7 +41,8 @@ var boss_dialog_lines = { Boss.BossDialogSections.WIN: ["[color=#E0E0E0]You rescued your friend from the evil mind controlling blobfish![/color]", "[color=#E0E0E0]Congratulations, you beat our game. Feel free to keep fishing, the first game idea was created in Ludum dare 57.[/color]"], Boss.BossDialogSections.BOSS_DEFEATED: ["[color=#E0E0E0]The mind-controlling blobfish has been killed![/color]", "[color=#E0E0E0]Thank you! Come get us, we will follow your lead![/color]"], Boss.BossDialogSections.POST_INTRO_RESCUE: ["[color=#E0E0E0]Noo the blobfish used some crazy mind control on you. You have to rescue your friend, but first you need to get a better submarine to be able to beat the blobfish.[/color]"], - Boss.BossDialogSections.AK47_UNLOCKED: ["[color=#E0E0E0]Damn, that blobfish is no joke! [/color][color=#f21820ae]I need better weapons...[/color][color=#E0E0E0]\n\nThat's it! I heard about a [/color][color=#2C3E50]gun upgrade[/color][color=#E0E0E0] available at the dock. If I'm going to save my friend from that creature, I'll need some serious firepower.\n\nI should head back to the dock and check the [/color][color=#2C3E50]EQUIPMENT[/color][color=#E0E0E0] section for an [/color][color=#f21820ae]AK47[/color][color=#E0E0E0]. Time to show that blobfish who's boss![/color]"] + Boss.BossDialogSections.AK47_UNLOCKED: ["[color=#E0E0E0]Damn, that blobfish is no joke! [/color][color=#f21820ae]I need better weapons...[/color][color=#E0E0E0]\n\nThat's it! I heard about a [/color][color=#2C3E50]gun upgrade[/color][color=#E0E0E0] available at the dock. If I'm going to save my friend from that creature, I'll need some serious firepower.\n\nI should head back to the dock and check the [/color][color=#2C3E50]EQUIPMENT[/color][color=#E0E0E0] section for an [/color][color=#f21820ae]AK47[/color][color=#E0E0E0]. Time to show that blobfish who's boss![/color]"], + Boss.BossDialogSections.DOCK_HINT: ["[color=#E0E0E0]Swim away if you are done shopping.[/color]"] } var upgradeDescriptions = { diff --git a/scripts/touch_controls.gd b/scripts/touch_controls.gd index 4296bb7..37a12fb 100644 --- a/scripts/touch_controls.gd +++ b/scripts/touch_controls.gd @@ -68,22 +68,22 @@ func _should_show_controls() -> bool: func _initialize_buttons() -> void: buttons.clear() - buttons["harpoon"] = _make_button("throw", "action", "Harpoon", action_button_size, COLOR_PRIMARY_LIGHT) - buttons["shoot"] = _make_button("shoot", "action", "Gun", action_button_size * 0.9, COLOR_PRIMARY, GameState.Upgrade.AK47) - buttons["pickaxe"] = _make_button("swing_pickaxe", "action", "Pick", action_button_size * 0.85, COLOR_PRIMARY_DARK, GameState.Upgrade.PICKAXE_UNLOCKED, 0.0, true) + buttons["harpoon"] = _make_button("throw", "action", "🪝", action_button_size, COLOR_PRIMARY_LIGHT) + buttons["shoot"] = _make_button("shoot", "action", "✹", action_button_size * 0.9, COLOR_PRIMARY, GameState.Upgrade.AK47) + buttons["pickaxe"] = _make_button("swing_pickaxe", "action", "⛏", action_button_size * 0.85, COLOR_PRIMARY_DARK, GameState.Upgrade.PICKAXE_UNLOCKED, 0.0, true) - buttons["buoy"] = _make_button("upgrade_surface_buoy", "ability", "Buoy", ability_button_size, COLOR_ACCENT, GameState.Upgrade.SURFACE_BUOY, 0.0, true) - buttons["drone"] = _make_button("upgrade_drone_selling", "ability", "Drone", ability_button_size, COLOR_ACCENT_LIGHT, GameState.Upgrade.DRONE_SELLING, hold_threshold_default, true) - buttons["save"] = _make_button("inventory_save", "ability", "Save", ability_button_size, COLOR_PRIMARY_LIGHT, GameState.Upgrade.INVENTORY_SAVE, hold_threshold_default, true) + buttons["buoy"] = _make_button("upgrade_surface_buoy", "ability", "⚓", ability_button_size, COLOR_ACCENT, GameState.Upgrade.SURFACE_BUOY, 0.0, true) + buttons["drone"] = _make_button("upgrade_drone_selling", "ability", "✈", ability_button_size, COLOR_ACCENT_LIGHT, GameState.Upgrade.DRONE_SELLING, hold_threshold_default, true) + buttons["save"] = _make_button("inventory_save", "ability", "💾", ability_button_size, COLOR_PRIMARY_LIGHT, GameState.Upgrade.INVENTORY_SAVE, hold_threshold_default, true) - buttons["inventory"] = _make_button("inv_toggle", "utility", "Inventory", utility_button_size, COLOR_PRIMARY, -1, 0.0, true) - buttons["pause"] = _make_button("esc", "utility", "Pause", utility_button_size * Vector2(0.85, 0.85), COLOR_PRIMARY_DARK, -1, 0.0, true) + buttons["inventory"] = _make_button("inv_toggle", "utility", "🎒", utility_button_size, COLOR_PRIMARY, -1, 0.0, true) + buttons["pause"] = _make_button("esc", "utility", "⏯", utility_button_size * Vector2(0.85, 0.85), COLOR_PRIMARY_DARK, -1, 0.0, true) -func _make_button(action: String, group: String, label: String, size: Vector2, color: Color, requires_upgrade: int = -1, hold_threshold: float = 0.0, auto_release: bool = false) -> Dictionary: +func _make_button(action: String, group: String, glyph: String, size: Vector2, color: Color, requires_upgrade: int = -1, hold_threshold: float = 0.0, auto_release: bool = false) -> Dictionary: return { "action": action, "group": group, - "label": label, + "glyph": glyph, "size": size, "color": color, "requires_upgrade": requires_upgrade, @@ -283,6 +283,11 @@ func _is_button_available(name: String) -> bool: if not buttons.has(name): return false var data: Dictionary = buttons[name] + if name == "harpoon": + if GameState.is_intro(): + return false + if GameState.upgrades.has(GameState.Upgrade.HARPOON_ROTATION) and GameState.upgrades[GameState.Upgrade.HARPOON_ROTATION] > 0: + return false if name == "drone" and GameState.is_intro(): return false if data.requires_upgrade != -1: @@ -377,7 +382,7 @@ func _draw(): draw_circle(joystick_rest_position, joystick_handle_radius, handle_color) var font := get_theme_default_font() - var font_size := get_theme_default_font_size() + var font_size := int(get_theme_default_font_size() * 1.2) for name in buttons.keys(): var data: Dictionary = buttons[name] if not data.visible or data.rect.size == Vector2.ZERO: @@ -390,7 +395,7 @@ func _draw(): draw_circle(center, radius, fill_color) draw_arc(center, radius, 0.0, TAU, 48, fill_color.darkened(0.25), 4.5) if font: - var text: String = data.label - var text_size: Vector2 = font.get_string_size(text, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size) + var glyph: String = data.get("glyph", "") + var text_size: Vector2 = font.get_string_size(glyph, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size) var text_pos: Vector2 = center - text_size * 0.5 + Vector2(0, text_size.y * 0.35) - draw_string(font, text_pos, text, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(0.1, 0.1, 0.1, 1.0)) + draw_string(font, text_pos, glyph, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(0.1, 0.1, 0.1, 1.0))