diff --git a/the-scavanger/.godot/editor/editor_layout.cfg b/the-scavanger/.godot/editor/editor_layout.cfg index 7e1240a..e1e3f15 100644 --- a/the-scavanger/.godot/editor/editor_layout.cfg +++ b/the-scavanger/.godot/editor/editor_layout.cfg @@ -10,7 +10,7 @@ dock_filesystem_display_mode=0 dock_filesystem_file_sort=0 dock_filesystem_file_list_display_mode=1 dock_filesystem_selected_paths=PackedStringArray("res://scenes/player-npc/player.tscn") -dock_filesystem_uncollapsed_paths=PackedStringArray("Favorites", "res://", "res://sprites/particles/", "res://scenes/player-npc/", "res://assets/terrain/") +dock_filesystem_uncollapsed_paths=PackedStringArray("Favorites", "res://", "res://sprites/particles/", "res://scenes/", "res://scenes/player-npc/", "res://assets/terrain/") dock_node_current_tab=0 dock_history_include_scene=true dock_history_include_global=true @@ -31,29 +31,29 @@ dock_5="Inspector,Node,History" open_scenes=PackedStringArray("res://scenes/maps/map.tscn", "res://scenes/player-npc/player.tscn", "res://scenes/enemies/slime.tscn") current_scene="res://scenes/player-npc/player.tscn" center_split_offset=-289 -selected_default_debugger_tab_idx=0 +selected_default_debugger_tab_idx=1 selected_main_editor_idx=2 selected_bottom_panel_item=0 [EditorWindow] screen=2 -mode="maximized" -position=Vector2i(1920, 23) -size=Vector2i(1152, 648) +mode="windowed" +position=Vector2i(1921, 31) +size=Vector2i(1416, 1000) [ScriptEditor] open_scripts=["res://scripts/global.gd", "res://scripts/player.gd", "res://scripts/slime.gd"] selected_script="res://scripts/player.gd" -open_help=[] +open_help=["Node"] script_split_offset=200 list_split_offset=0 zoom_factor=0.928575 [GameView] -floating_window_rect=Rect2i(2298, 151, 1164, 695) +floating_window_rect=Rect2i(2053, 94, 1164, 695) floating_window_screen=2 [ShaderEditor] diff --git a/the-scavanger/.godot/editor/filesystem_cache10 b/the-scavanger/.godot/editor/filesystem_cache10 index 98c5894..cad9dda 100644 --- a/the-scavanger/.godot/editor/filesystem_cache10 +++ b/the-scavanger/.godot/editor/filesystem_cache10 @@ -1,5 +1,5 @@ ea4bc82a6ad023ab7ee23ee620429895 -::res://::1744892296 +::res://::1744911067 README.md::TextFile/TextFile::-1::1744816260::0::1::::<><><>0<>0<><>:: ::res://addons/::1744816286 ::res://addons/dialogic/::1744816286 @@ -638,16 +638,16 @@ impactWood_light_003.ogg::AudioStreamOggVorbis/AudioStreamOggVorbis::39778551762 dungeon_tilemap.png::CompressedTexture2D/CompressedTexture2D::8061865866911565813::1744792307::1744795216::1::::<><><>0<>0<>f72357e1a5fc8e72e24e704a7ba19886<>res://.godot/imported/dungeon_tilemap.png-68df297cfdb861c9d71310f03207f420.ctex:: town_tilemap.png::CompressedTexture2D/CompressedTexture2D::9087710348786756863::1744792307::1744795216::1::::<><><>0<>0<>3bfeccc788daeaf3e35efcb3add29f22<>res://.godot/imported/town_tilemap.png-2998e8eb9fc51ed5db3b69c6ee26a142.ctex:: ::res://scenes/::1744816287 -::res://scenes/enemies/::1744820177 -slime.tscn::PackedScene::2402754897815220369::1744820177::0::1::::<><><>0<>0<><>::uid://bnpn02r7cngft::::res://scripts/slime.gd<>uid://ijn3ut4pdyam::::res://sprites/characters/slime.png -::res://scenes/maps/::1744838668 -map.tscn::PackedScene::3973745883842296891::1744838668::0::1::::<><><>0<>0<><>::uid://d2qfi5sncf72b::::res://assets/terrain/town_tilemap.png<>uid://dm4h0uo6gjp22::::res://assets/terrain/dungeon_tilemap.png<>uid://bah6a0tn6u066::::res://scenes/enemies/slime.tscn<>uid://d2xgp0scnb5s3::::res://scenes/player-npc/player.tscn -::res://scenes/player-npc/::1744816287 -player.tscn::PackedScene/PackedScene::9102233947513275536::1744814481::0::1::::<><><>0<>0<><>::uid://cxcuos53tbyxg::::res://scripts/player.gd<>uid://bsbojappb6j6v::::res://sprites/characters/player.png -::res://scripts/::1744831051 -global.gd::GDScript::5883560734693615925::1744823557::0::1::::<>Node<><>0<>0<><>:: -player.gd::GDScript::6392553860601149484::1744831051::0::1::::<>CharacterBody2D<><>0<>0<><>:: -slime.gd::GDScript::3330676728901258397::1744823524::0::1::::<>CharacterBody2D<><>0<>0<><>:: +::res://scenes/enemies/::1744910723 +slime.tscn::PackedScene::2402754897815220369::1744910723::0::1::::<><><>0<>0<><>::uid://bnpn02r7cngft::::res://scripts/slime.gd<>uid://ijn3ut4pdyam::::res://sprites/characters/slime.png +::res://scenes/maps/::1744910722 +map.tscn::PackedScene::3973745883842296891::1744910722::0::1::::<><><>0<>0<><>::uid://d2qfi5sncf72b::::res://assets/terrain/town_tilemap.png<>uid://dm4h0uo6gjp22::::res://assets/terrain/dungeon_tilemap.png<>uid://bah6a0tn6u066::::res://scenes/enemies/slime.tscn<>uid://d2xgp0scnb5s3::::res://scenes/player-npc/player.tscn +::res://scenes/player-npc/::1744910723 +player.tscn::PackedScene::9102233947513275536::1744910723::0::1::::<><><>0<>0<><>::uid://cxcuos53tbyxg::::res://scripts/player.gd<>uid://bsbojappb6j6v::::res://sprites/characters/player.png +::res://scripts/::1744910719 +global.gd::GDScript/GDScript::5883560734693615925::1744823557::0::1::::<>Node<><>0<>0<><>:: +player.gd::GDScript::6392553860601149484::1744910719::0::1::::<>CharacterBody2D<><>0<>0<><>:: +slime.gd::GDScript/GDScript::3330676728901258397::1744823524::0::1::::<>CharacterBody2D<><>0<>0<><>:: ::res://sprites/::1744816287 icon.svg::CompressedTexture2D/CompressedTexture2D::7419309778608950522::1744795028::1744795062::1::::<><><>0<>0<>34e689a90ac55dc880b59a651c559a89<>res://.godot/imported/icon.svg-964d8c66fbd3bda40c44ca195472a8e1.ctex:: ::res://sprites/characters/::1744816287 diff --git a/the-scavanger/.godot/editor/filesystem_update4 b/the-scavanger/.godot/editor/filesystem_update4 index 3ce91ab..e2d6150 100644 --- a/the-scavanger/.godot/editor/filesystem_update4 +++ b/the-scavanger/.godot/editor/filesystem_update4 @@ -1,4 +1,4 @@ +res://scenes/player-npc/player.tscn res://scripts/player.gd res://scenes/maps/map.tscn -res://scenes/player-npc/player.tscn res://scenes/enemies/slime.tscn diff --git a/the-scavanger/.godot/editor/map.tscn-editstate-a2d9d4e2619cfe9f508a7ce437bf36bc.cfg b/the-scavanger/.godot/editor/map.tscn-editstate-a2d9d4e2619cfe9f508a7ce437bf36bc.cfg index 8f6c460..cf94d49 100644 --- a/the-scavanger/.godot/editor/map.tscn-editstate-a2d9d4e2619cfe9f508a7ce437bf36bc.cfg +++ b/the-scavanger/.godot/editor/map.tscn-editstate-a2d9d4e2619cfe9f508a7ce437bf36bc.cfg @@ -192,4 +192,4 @@ Game={ "hide_selection": true, "select_mode": 1 } -selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@21272/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@54/@VBoxContainer@55/@EditorMainScreen@102/MainScreen/@CanvasItemEditor@11482/@VSplitContainer@11134/@HSplitContainer@11136/@HSplitContainer@11138/@Control@11139/@SubViewportContainer@11140/@SubViewport@11141/Player/TextEdit")]) +selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@21272/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@54/@VBoxContainer@55/@EditorMainScreen@102/MainScreen/@CanvasItemEditor@11482/@VSplitContainer@11134/@HSplitContainer@11136/@HSplitContainer@11138/@Control@11139/@SubViewportContainer@11140/@SubViewport@11141/Player")]) diff --git a/the-scavanger/.godot/editor/player.tscn-editstate-b73a784f178a47915fc66b3add4a1dff.cfg b/the-scavanger/.godot/editor/player.tscn-editstate-b73a784f178a47915fc66b3add4a1dff.cfg index fba6975..b94295e 100644 --- a/the-scavanger/.godot/editor/player.tscn-editstate-b73a784f178a47915fc66b3add4a1dff.cfg +++ b/the-scavanger/.godot/editor/player.tscn-editstate-b73a784f178a47915fc66b3add4a1dff.cfg @@ -8,7 +8,7 @@ Anim={ "grid_snap_active": false, "grid_step": Vector2(8, 8), "grid_visibility": 1, -"ofs": Vector2(-210.168, -100.509), +"ofs": Vector2(-200.49, -85.6174), "primary_grid_step": Vector2i(8, 8), "show_group_gizmos": true, "show_guides": true, @@ -192,4 +192,4 @@ Game={ "hide_selection": false, "select_mode": 0 } -selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@21272/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@54/@VBoxContainer@55/@EditorMainScreen@102/MainScreen/@CanvasItemEditor@11482/@VSplitContainer@11134/@HSplitContainer@11136/@HSplitContainer@11138/@Control@11139/@SubViewportContainer@11140/@SubViewport@11141/Player/TextEdit")]) +selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@21272/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@54/@VBoxContainer@55/@EditorMainScreen@102/MainScreen/@CanvasItemEditor@11482/@VSplitContainer@11134/@HSplitContainer@11136/@HSplitContainer@11138/@Control@11139/@SubViewportContainer@11140/@SubViewport@11141/Player")]) diff --git a/the-scavanger/.godot/editor/project_metadata.cfg b/the-scavanger/.godot/editor/project_metadata.cfg index c458db9..ac17797 100644 --- a/the-scavanger/.godot/editor/project_metadata.cfg +++ b/the-scavanger/.godot/editor/project_metadata.cfg @@ -6,7 +6,7 @@ use_advanced_connections=false [recent_files] scenes=["res://scenes/enemies/slime.tscn", "res://scenes/player-npc/player.tscn", "res://scenes/maps/map.tscn", "res://scenes/maps/south.tscn", "res://scenes/maps/north.tscn", "res://scenes/maps/main.tscn", "res://scenes/maps/east.tscn", "res://scenes/enemy-no-animation.tscn", "res://scenes/main.tscn", "res://scenes/slime.tscn"] -scripts=["res://scripts/global.gd", "res://scripts/slime.gd", "res://scripts/enemy.gd", "res://scripts/player.gd", "res://scripts/world.gd", "res://scripts/cliff_side.gd"] +scripts=["Node", "res://scripts/player.gd", "res://scripts/global.gd", "res://scripts/slime.gd", "res://scripts/enemy.gd", "res://scripts/world.gd", "res://scripts/cliff_side.gd"] [uid_upgrade_tool] @@ -38,3 +38,7 @@ snap_mode=2 [game_view] embed_size_mode=0 + +[quick_open_dialog] + +last_mode=1 diff --git a/the-scavanger/.godot/editor/script_editor_cache.cfg b/the-scavanger/.godot/editor/script_editor_cache.cfg index ee7e4ca..f1ce6c1 100644 --- a/the-scavanger/.godot/editor/script_editor_cache.cfg +++ b/the-scavanger/.godot/editor/script_editor_cache.cfg @@ -3,11 +3,11 @@ state={ "bookmarks": PackedInt32Array(), "breakpoints": PackedInt32Array(), -"column": 28, +"column": 15, "folded_lines": Array[int]([]), "h_scroll_position": 0, -"row": 412, -"scroll_position": 397.0, +"row": 13, +"scroll_position": 0.0, "selection": false, "syntax_highlighter": "GDScript" } diff --git a/the-scavanger/.godot/editor/slime.tscn-editstate-1d5fdaa6118f033b4cb4a73d58a8d8b8.cfg b/the-scavanger/.godot/editor/slime.tscn-editstate-1d5fdaa6118f033b4cb4a73d58a8d8b8.cfg index dd1453e..d58849d 100644 --- a/the-scavanger/.godot/editor/slime.tscn-editstate-1d5fdaa6118f033b4cb4a73d58a8d8b8.cfg +++ b/the-scavanger/.godot/editor/slime.tscn-editstate-1d5fdaa6118f033b4cb4a73d58a8d8b8.cfg @@ -192,4 +192,4 @@ Game={ "hide_selection": false, "select_mode": 0 } -selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@21272/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@54/@VBoxContainer@55/@EditorMainScreen@102/MainScreen/@CanvasItemEditor@11482/@VSplitContainer@11134/@HSplitContainer@11136/@HSplitContainer@11138/@Control@11139/@SubViewportContainer@11140/@SubViewport@11141/Player/TextEdit")]) +selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@21272/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@54/@VBoxContainer@55/@EditorMainScreen@102/MainScreen/@CanvasItemEditor@11482/@VSplitContainer@11134/@HSplitContainer@11136/@HSplitContainer@11138/@Control@11139/@SubViewportContainer@11140/@SubViewport@11141/Player")]) diff --git a/the-scavanger/scripts/player.gd b/the-scavanger/scripts/player.gd index 9eff27c..baa891d 100644 --- a/the-scavanger/scripts/player.gd +++ b/the-scavanger/scripts/player.gd @@ -1,7 +1,7 @@ extends CharacterBody2D -const speed = 250 # return to 100 before handin -const dodge_speed = 500 # Speed during dodge --> return to 200 before handin +const speed = 100 +const dodge_speed = 200 # Speed during dodge const dodge_duration = 0.5 # How long the dodge lasts (in seconds) const dodge_cooldown_time = 3.0 # Dodge cooldown (in seconds) @@ -11,7 +11,7 @@ var dodge_cooldown_active = false var enemy_in_attack_range = false var enemy_attack_cooldown = true -var healt = 64806524502 # return to 100 before turnin +var healt = 100 # return to 100 before turnin var player_alive = true var attack_ip = false @@ -23,6 +23,63 @@ var has_red_potion = false var has_green_potion = false var coin_count = 0 +var word_chunks = [] # Array to store the tokenized words +var current_chunk_index = 0 # Keeps track of the current chunk + +# Function to prepare and show text in 5-word chunks +func show_text_in_chunks(full_text: String) -> void: + # Add mystical Latin phrase at the end for a wizard or knight + full_text += " Ave Domine Limosus, dominator omnium slime!" + + # Split the full text into words, keeping punctuation separate + word_chunks = tokenize_text(full_text) + current_chunk_index = 0 + $"TextEdit".visible = true + $"TextEdit".text = "" # Clear the text before starting + + set_process(true) # Enable processing for the _process function + +# Function to tokenize the text into words and punctuation separately +func tokenize_text(text: String) -> Array: + var regex = RegEx.new() + regex.compile(r"[\w']+|[.,!?;]") # Regular expression to split words and punctuation + var matches = regex.search_all(text) + var tokens = [] + for match in matches: + tokens.append(match.strings[0]) # Append each matched token + return tokens + +# Process function to handle input and display text chunks +func _process(delta): + # Check if there are more chunks to display and listen for input + if current_chunk_index * 5 < word_chunks.size(): + if Input.is_action_just_pressed("ui_accept"): # Trigger on just pressed input + _display_next_chunk() + # If all chunks are displayed, show an empty chunk and hide the TextEdit + elif current_chunk_index * 5 >= word_chunks.size() and $"TextEdit".visible: + _display_empty_chunk() + +# Function to display only the next chunk of 5 words +func _display_next_chunk() -> void: + # Clear the current text + $"TextEdit".text = "" + + # Show the next 5 words + var start = current_chunk_index * 5 + var end = min(start + 5, word_chunks.size()) # Ensure we don't go beyond the last word + var chunk_text = " ".join(word_chunks.slice(start, end)) # Join the next 5 words + $"TextEdit".text = chunk_text # Display only the current 5 words + + # Move to the next chunk + current_chunk_index += 1 + +# Function to display an empty chunk before closing the text +func _display_empty_chunk() -> void: + # Display an empty chunk (effectively clearing the TextEdit) + $"TextEdit".text = "" + # Hide the TextEdit after the empty chunk + $"TextEdit".visible = false + func resetGame(): has_blue_potion = false @@ -224,9 +281,12 @@ func update_dodge_cooldown(delta): func gameEnd() -> void: + while $"TextEdit".visible: + await get_tree().create_timer(1.0).timeout print("The game has been beaten!") queue_free() get_tree().quit() + func enterHouseNico(body: Node2D) -> void: @@ -386,7 +446,7 @@ func pickUpCoin7(body: Node2D) -> void: func wizardTalking(body: Node2D) -> void: if body == self: if has_blue_potion and has_green_potion and has_red_potion: - print( + show_text_in_chunks( "By the stars, you actually did it! You brought all three potions—red, green, and blue! ...Oh. Uh, yeah—about that. So here's the thing... @@ -397,25 +457,15 @@ func wizardTalking(body: Node2D) -> void: No refunds!" ) + gameEnd() else: - var text = "Ah... you're not from this world, are you? Curious. Your aura—it's foreign, like a breeze from a land long forgotten. - Fear not! I can send you back... but the spell requires three ancient potions: red, green, and blue. They're scattered deep within this slime-infested forest. Charming place, really. - - Oh, before you go stumbling into a slime's belly, a few pointers: - WASD or arrow keys to move, - Spacebar for a quick dodge—handy for avoiding gooey hugs, - and to deal with trouble, just left-click or press E to strike. - - Now go! The forest won’t wait... and neither will the slimes." - $"TextEdit".visible = true - while Input.is_action_just_pressed("ui_accept"): - $"TextEdit".text = "test" + show_text_in_chunks("Ah... you're not from this world, are you? Curious. Your aura—it's foreign, like a breeze from a land long forgotten. Fear not! I can send you back... but the spell requires three ancient potions: red, green, and blue. They're scattered deep within this slime-infested forest. Charming place, really. Oh, before you go stumbling into a slime's belly, a few pointers: WASD or arrow keys to move, Spacebar for a quick dodge—handy for avoiding gooey hugs, and to deal with trouble, just left-click or press E to strike. Now go! The forest won’t wait... and neither will the slimes.") func knightTalking(body: Node2D) -> void: if body == self and coin_count >= 6: - print( + show_text_in_chunks( "...Well now. You actually returned... and with all seven coins of Lazaret, no less. Many have entered that cursed dungeon—most were not so fortunate. @@ -430,7 +480,7 @@ func knightTalking(body: Node2D) -> void: $"../north/StaticBody2D2".queue_free() coin_count = 0 elif body == self: - print( + show_text_in_chunks( "Ah, I see your eyes are fixed on that glowing prize beyond the gate—the blue potion. So close you could almost taste it… yet still out of reach. Know this: that potion is not yours for the taking—not yet. Only those who prove their worth may claim it.