Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions scenes/main_scene.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -248,25 +248,30 @@ 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
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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scenes/popup_text.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -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")
18 changes: 9 additions & 9 deletions scenes/ui/achievement_item.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand All @@ -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
18 changes: 9 additions & 9 deletions scenes/ui/achievement_panel.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion scripts/boss.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 = {
Expand Down
10 changes: 10 additions & 0 deletions scripts/game_state.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
41 changes: 39 additions & 2 deletions scripts/hud.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -35,15 +35,17 @@ 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
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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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)
4 changes: 4 additions & 0 deletions scripts/pause_menu.gd
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions scripts/player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion scripts/strings.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Loading