polished
This commit is contained in:
BIN
assets/audio/music/boss_theme.ogg
Normal file
BIN
assets/audio/music/boss_theme.ogg
Normal file
Binary file not shown.
19
assets/audio/music/boss_theme.ogg.import
Normal file
19
assets/audio/music/boss_theme.ogg.import
Normal file
@@ -0,0 +1,19 @@
|
||||
[remap]
|
||||
|
||||
importer="oggvorbisstr"
|
||||
type="AudioStreamOggVorbis"
|
||||
uid="uid://c7558jjqywld1"
|
||||
path="res://.godot/imported/boss_theme.ogg-21f82e37c31edcb14c9d4989298d979c.oggvorbisstr"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/music/boss_theme.ogg"
|
||||
dest_files=["res://.godot/imported/boss_theme.ogg-21f82e37c31edcb14c9d4989298d979c.oggvorbisstr"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
||||
BIN
assets/audio/music/halloween_creepy.mp3
Normal file
BIN
assets/audio/music/halloween_creepy.mp3
Normal file
Binary file not shown.
19
assets/audio/music/halloween_creepy.mp3.import
Normal file
19
assets/audio/music/halloween_creepy.mp3.import
Normal file
@@ -0,0 +1,19 @@
|
||||
[remap]
|
||||
|
||||
importer="mp3"
|
||||
type="AudioStreamMP3"
|
||||
uid="uid://dca4ojv05k3di"
|
||||
path="res://.godot/imported/halloween_creepy.mp3-d7670ccf72b9536d5da440dbf5576e5a.mp3str"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/music/halloween_creepy.mp3"
|
||||
dest_files=["res://.godot/imported/halloween_creepy.mp3-d7670ccf72b9536d5da440dbf5576e5a.mp3str"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
||||
BIN
assets/audio/sounds/explosion.wav
Normal file
BIN
assets/audio/sounds/explosion.wav
Normal file
Binary file not shown.
24
assets/audio/sounds/explosion.wav.import
Normal file
24
assets/audio/sounds/explosion.wav.import
Normal file
@@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://d8qefwc57uvj"
|
||||
path="res://.godot/imported/explosion.wav-86bdf57e061d88558bde2b5f068d2843.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/sounds/explosion.wav"
|
||||
dest_files=["res://.godot/imported/explosion.wav-86bdf57e061d88558bde2b5f068d2843.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
BIN
assets/audio/sounds/hit.wav
Normal file
BIN
assets/audio/sounds/hit.wav
Normal file
Binary file not shown.
24
assets/audio/sounds/hit.wav.import
Normal file
24
assets/audio/sounds/hit.wav.import
Normal file
@@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://byy52fo287btu"
|
||||
path="res://.godot/imported/hit.wav-02af4ab152ad451e5e43395285cc83ec.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/sounds/hit.wav"
|
||||
dest_files=["res://.godot/imported/hit.wav-02af4ab152ad451e5e43395285cc83ec.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 7.6 KiB |
@@ -1,10 +1,10 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://73jm5qjy52vq"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d1wt4ma6055l8" path="res://addons/dialogue_manager/example_balloon/example_balloon.gd" id="1_36de5"]
|
||||
[ext_resource type="Script" uid="uid://d1wt4ma6055l8" path="res://example_balloon/example_balloon.gd" id="1_36de5"]
|
||||
[ext_resource type="PackedScene" uid="uid://ckvgyvclnwggo" path="res://addons/dialogue_manager/dialogue_label.tscn" id="2_a8ve6"]
|
||||
[ext_resource type="Script" uid="uid://bb52rsfwhkxbn" path="res://addons/dialogue_manager/dialogue_responses_menu.gd" id="3_72ixx"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_spyqn"]
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qkmqt"]
|
||||
bg_color = Color(0, 0, 0, 1)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
@@ -16,7 +16,7 @@ corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ri4m3"]
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_nlsx6"]
|
||||
bg_color = Color(0.121569, 0.121569, 0.121569, 1)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
@@ -28,7 +28,7 @@ corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_e0njw"]
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_1337t"]
|
||||
bg_color = Color(0, 0, 0, 1)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
@@ -40,7 +40,7 @@ corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qkmqt"]
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_kmygl"]
|
||||
bg_color = Color(0, 0, 0, 1)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
@@ -53,15 +53,15 @@ corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="Theme" id="Theme_qq3yp"]
|
||||
default_font_size = 20
|
||||
Button/styles/disabled = SubResource("StyleBoxFlat_spyqn")
|
||||
Button/styles/focus = SubResource("StyleBoxFlat_ri4m3")
|
||||
Button/styles/hover = SubResource("StyleBoxFlat_e0njw")
|
||||
Button/styles/normal = SubResource("StyleBoxFlat_e0njw")
|
||||
Button/styles/disabled = SubResource("StyleBoxFlat_qkmqt")
|
||||
Button/styles/focus = SubResource("StyleBoxFlat_nlsx6")
|
||||
Button/styles/hover = SubResource("StyleBoxFlat_1337t")
|
||||
Button/styles/normal = SubResource("StyleBoxFlat_1337t")
|
||||
MarginContainer/constants/margin_bottom = 15
|
||||
MarginContainer/constants/margin_left = 30
|
||||
MarginContainer/constants/margin_right = 30
|
||||
MarginContainer/constants/margin_top = 15
|
||||
PanelContainer/styles/panel = SubResource("StyleBoxFlat_qkmqt")
|
||||
PanelContainer/styles/panel = SubResource("StyleBoxFlat_kmygl")
|
||||
|
||||
[node name="ExampleBalloon" type="CanvasLayer"]
|
||||
layer = 100
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://13s5spsk34qu"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d1wt4ma6055l8" path="res://addons/dialogue_manager/example_balloon/example_balloon.gd" id="1_s2gbs"]
|
||||
[ext_resource type="Script" uid="uid://d1wt4ma6055l8" path="res://example_balloon/example_balloon.gd" id="1_s2gbs"]
|
||||
[ext_resource type="PackedScene" uid="uid://ckvgyvclnwggo" path="res://addons/dialogue_manager/dialogue_label.tscn" id="2_hfvdi"]
|
||||
[ext_resource type="Script" uid="uid://bb52rsfwhkxbn" path="res://addons/dialogue_manager/dialogue_responses_menu.gd" id="3_1j1j0"]
|
||||
|
||||
110
export_presets.cfg
Normal file
110
export_presets.cfg
Normal file
@@ -0,0 +1,110 @@
|
||||
[preset.0]
|
||||
|
||||
name="Linux"
|
||||
platform="Linux"
|
||||
runnable=true
|
||||
advanced_options=false
|
||||
dedicated_server=false
|
||||
custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path="../../../stolen souls/hood.x86_64"
|
||||
patches=PackedStringArray()
|
||||
encryption_include_filters=""
|
||||
encryption_exclude_filters=""
|
||||
seed=0
|
||||
encrypt_pck=false
|
||||
encrypt_directory=false
|
||||
script_export_mode=2
|
||||
|
||||
[preset.0.options]
|
||||
|
||||
custom_template/debug=""
|
||||
custom_template/release=""
|
||||
debug/export_console_wrapper=1
|
||||
binary_format/embed_pck=true
|
||||
texture_format/s3tc_bptc=true
|
||||
texture_format/etc2_astc=false
|
||||
shader_baker/enabled=true
|
||||
binary_format/architecture="x86_64"
|
||||
ssh_remote_deploy/enabled=false
|
||||
ssh_remote_deploy/host="user@host_ip"
|
||||
ssh_remote_deploy/port="22"
|
||||
ssh_remote_deploy/extra_args_ssh=""
|
||||
ssh_remote_deploy/extra_args_scp=""
|
||||
ssh_remote_deploy/run_script="#!/usr/bin/env bash
|
||||
export DISPLAY=:0
|
||||
unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
|
||||
\"{temp_dir}/{exe_name}\" {cmd_args}"
|
||||
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
|
||||
kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\")
|
||||
rm -rf \"{temp_dir}\""
|
||||
|
||||
[preset.1]
|
||||
|
||||
name="Windows Desktop"
|
||||
platform="Windows Desktop"
|
||||
runnable=true
|
||||
advanced_options=false
|
||||
dedicated_server=false
|
||||
custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path="../../../stolen souls/hood.exe"
|
||||
patches=PackedStringArray()
|
||||
encryption_include_filters=""
|
||||
encryption_exclude_filters=""
|
||||
seed=0
|
||||
encrypt_pck=false
|
||||
encrypt_directory=false
|
||||
script_export_mode=2
|
||||
|
||||
[preset.1.options]
|
||||
|
||||
custom_template/debug=""
|
||||
custom_template/release=""
|
||||
debug/export_console_wrapper=1
|
||||
binary_format/embed_pck=true
|
||||
texture_format/s3tc_bptc=true
|
||||
texture_format/etc2_astc=false
|
||||
shader_baker/enabled=true
|
||||
binary_format/architecture="x86_64"
|
||||
codesign/enable=false
|
||||
codesign/timestamp=true
|
||||
codesign/timestamp_server_url=""
|
||||
codesign/digest_algorithm=1
|
||||
codesign/description=""
|
||||
codesign/custom_options=PackedStringArray()
|
||||
application/modify_resources=true
|
||||
application/icon=""
|
||||
application/console_wrapper_icon=""
|
||||
application/icon_interpolation=4
|
||||
application/file_version=""
|
||||
application/product_version=""
|
||||
application/company_name=""
|
||||
application/product_name=""
|
||||
application/file_description=""
|
||||
application/copyright=""
|
||||
application/trademarks=""
|
||||
application/export_angle=0
|
||||
application/export_d3d12=0
|
||||
application/d3d12_agility_sdk_multiarch=true
|
||||
ssh_remote_deploy/enabled=false
|
||||
ssh_remote_deploy/host="user@host_ip"
|
||||
ssh_remote_deploy/port="22"
|
||||
ssh_remote_deploy/extra_args_ssh=""
|
||||
ssh_remote_deploy/extra_args_scp=""
|
||||
ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}'
|
||||
$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}'
|
||||
$trigger = New-ScheduledTaskTrigger -Once -At 00:00
|
||||
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries
|
||||
$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings
|
||||
Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true
|
||||
Start-ScheduledTask -TaskName godot_remote_debug
|
||||
while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 }
|
||||
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue"
|
||||
ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
|
||||
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
|
||||
Remove-Item -Recurse -Force '{temp_dir}'"
|
||||
@@ -10,7 +10,7 @@ config_version=5
|
||||
|
||||
[application]
|
||||
|
||||
config/name="hood"
|
||||
config/name="The House of Stolen Souls"
|
||||
run/main_scene="uid://dgq21ggr3br2g"
|
||||
run/print_header=false
|
||||
config/features=PackedStringArray("4.5", "Forward Plus")
|
||||
@@ -18,7 +18,7 @@ boot_splash/bg_color=Color(0, 0, 0, 1)
|
||||
boot_splash/show_image=false
|
||||
boot_splash/fullsize=false
|
||||
boot_splash/use_filter=false
|
||||
config/icon="res://icon.svg"
|
||||
config/icon="uid://bdd7wo7tepih2"
|
||||
|
||||
[autoload]
|
||||
|
||||
@@ -126,6 +126,7 @@ common/physics_interpolation=true
|
||||
[rendering]
|
||||
|
||||
textures/canvas_textures/default_texture_filter=0
|
||||
textures/vram_compression/import_etc2_astc=true
|
||||
textures/default_filters/use_nearest_mipmap_filter=true
|
||||
2d/snap/snap_2d_transforms_to_pixel=true
|
||||
2d/snap/snap_2d_vertices_to_pixel=true
|
||||
|
||||
@@ -124,7 +124,7 @@ animations = [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_et1j0")
|
||||
}],
|
||||
"loop": true,
|
||||
"loop": false,
|
||||
"name": &"default",
|
||||
"speed": 10.0
|
||||
}]
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://cjbbslcx6vjjy"]
|
||||
[gd_scene load_steps=9 format=3 uid="uid://cjbbslcx6vjjy"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b08q3lqbuoolb" path="res://scripts/autoloads/nodes/event_manager.gd" id="1_xplee"]
|
||||
[ext_resource type="PackedScene" uid="uid://c5wjwnlubyich" path="res://scenes/menus/util/dialog.tscn" id="2_swnhv"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://bl36fbm1g0x3" path="res://resources/explosion_animation.tres" id="3_gml0k"]
|
||||
[ext_resource type="AudioStream" uid="uid://d8qefwc57uvj" path="res://assets/audio/sounds/explosion.wav" id="4_ib5t8"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_swnhv"]
|
||||
length = 0.001
|
||||
@@ -39,6 +42,20 @@ _data = {
|
||||
&"transition": SubResource("Animation_xplee")
|
||||
}
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_gml0k"]
|
||||
script/source = "extends Control
|
||||
|
||||
func _ready() -> void:
|
||||
hide()
|
||||
|
||||
func explode():
|
||||
show()
|
||||
$AnimatedSprite2D.play(\"default\")
|
||||
$AudioStreamPlayer.play()
|
||||
await $AnimatedSprite2D.animation_finished
|
||||
hide()
|
||||
"
|
||||
|
||||
[node name="EventManager" type="CanvasLayer"]
|
||||
script = ExtResource("1_xplee")
|
||||
|
||||
@@ -56,3 +73,23 @@ color = Color(0, 0, 0, 1)
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_gml0k")
|
||||
}
|
||||
|
||||
[node name="Dialogue" parent="." instance=ExtResource("2_swnhv")]
|
||||
visible = false
|
||||
|
||||
[node name="Explosion" type="Control" parent="."]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_gml0k")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Explosion"]
|
||||
position = Vector2(183.00002, 80.99999)
|
||||
scale = Vector2(0.54950494, 0.5088008)
|
||||
sprite_frames = ExtResource("3_gml0k")
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="Explosion"]
|
||||
stream = ExtResource("4_ib5t8")
|
||||
|
||||
@@ -67,10 +67,8 @@ rotation = 1.5707964
|
||||
shape = SubResource("CapsuleShape2D_04wrl")
|
||||
|
||||
[node name="NavigationAgent2D" type="NavigationAgent2D" parent="."]
|
||||
target_desired_distance = 20.0
|
||||
avoidance_enabled = true
|
||||
radius = 16.0
|
||||
neighbor_distance = 48.0
|
||||
|
||||
[node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
|
||||
|
||||
@@ -80,7 +78,7 @@ collision_mask = 2
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" groups=["Enemy"]]
|
||||
shape = SubResource("CircleShape2D_04wrl")
|
||||
debug_color = Color(0.4897036, 0.51211786, 0.7549306, 0.41960785)
|
||||
debug_color = Color(0.49019608, 0.5137255, 0.75686276, 0)
|
||||
|
||||
[node name="FollowUpdateTimer" type="Timer" parent="."]
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,8 +1,18 @@
|
||||
[gd_scene load_steps=15 format=4 uid="uid://bdpobbbi6apq5"]
|
||||
[gd_scene load_steps=20 format=4 uid="uid://bdpobbbi6apq5"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://2aopgpvv473r" path="res://assets/textures/tilemaps/level_interior_tileset.png" id="1_satx0"]
|
||||
[ext_resource type="PackedScene" uid="uid://dfbomt0l6b1o4" path="res://scenes/player.tscn" id="2_0t8x2"]
|
||||
[ext_resource type="PackedScene" uid="uid://sr8t2lu6apr4" path="res://scenes/enemies/skull.tscn" id="3_u5kpk"]
|
||||
[ext_resource type="AudioStream" uid="uid://c7558jjqywld1" path="res://assets/audio/music/boss_theme.ogg" id="4_ij6uy"]
|
||||
[ext_resource type="Texture2D" uid="uid://dsapnb753puib" path="res://assets/textures/spritesheets/dark_house_assets.png" id="5_piajy"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_piajy"]
|
||||
script/source = "extends Node2D
|
||||
|
||||
func _on_child_exiting_tree(_node: Node) -> void:
|
||||
if get_tree().get_node_count_in_group(\"Enemy\") == 0:
|
||||
get_tree().call_deferred(\"change_scene_to_file\", \"res://scenes/menus/win.tscn\")
|
||||
"
|
||||
|
||||
[sub_resource type="NavigationPolygon" id="NavigationPolygon_0t8x2"]
|
||||
vertices = PackedVector2Array(16, 16, 2, 16, 2, 10, 16, 10)
|
||||
@@ -131,8 +141,53 @@ terrain_set_0/terrain_0/color = Color(0.5, 0.34375, 0.25, 1)
|
||||
navigation_layer_0/layers = 1
|
||||
sources/1 = SubResource("TileSetAtlasSource_u5kpk")
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_v45sh"]
|
||||
texture = ExtResource("5_piajy")
|
||||
texture_region_size = Vector2i(32, 32)
|
||||
0:0/0 = 0
|
||||
1:0/0 = 0
|
||||
2:0/0 = 0
|
||||
3:0/0 = 0
|
||||
4:0/0 = 0
|
||||
0:1/0 = 0
|
||||
0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
1:1/0 = 0
|
||||
1:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
2:1/0 = 0
|
||||
2:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
3:1/0 = 0
|
||||
4:1/0 = 0
|
||||
6:1/0 = 0
|
||||
7:1/0 = 0
|
||||
0:2/0 = 0
|
||||
1:2/0 = 0
|
||||
2:2/0 = 0
|
||||
3:2/0 = 0
|
||||
4:2/0 = 0
|
||||
5:2/0 = 0
|
||||
6:2/0 = 0
|
||||
7:2/0 = 0
|
||||
0:3/0 = 0
|
||||
0:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
1:3/0 = 0
|
||||
1:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
2:3/0 = 0
|
||||
2:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
3:3/0 = 0
|
||||
3:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
4:3/0 = 0
|
||||
5:3/0 = 0
|
||||
6:3/0 = 0
|
||||
7:3/0 = 0
|
||||
|
||||
[sub_resource type="TileSet" id="TileSet_l6efi"]
|
||||
tile_size = Vector2i(32, 32)
|
||||
physics_layer_0/collision_layer = 1
|
||||
sources/1 = SubResource("TileSetAtlasSource_v45sh")
|
||||
|
||||
[node name="Lvl1" type="Node2D"]
|
||||
y_sort_enabled = true
|
||||
script = SubResource("GDScript_piajy")
|
||||
|
||||
[node name="TileMapLayer" type="TileMapLayer" parent="."]
|
||||
z_index = -1
|
||||
@@ -153,3 +208,14 @@ position = Vector2(8, -106)
|
||||
|
||||
[node name="Skull3" parent="." instance=ExtResource("3_u5kpk")]
|
||||
position = Vector2(140, -102)
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("4_ij6uy")
|
||||
autoplay = true
|
||||
|
||||
[node name="TileMapLayer2" type="TileMapLayer" parent="."]
|
||||
y_sort_enabled = true
|
||||
tile_map_data = PackedByteArray("AAD7//3/AQAAAAMAAAD7//z/AQAAAAIAAAD8//3/AQABAAMAAAD8//z/AQABAAIAAAABAP3/AQACAAMAAAACAP3/AQADAAMAAAABAPz/AQACAAIAAAACAPz/AQADAAIAAAAEAP7/AQACAAEAAAAEAP3/AQACAAAAAAAEAAEAAQAAAAAAAAAEAAIAAQAAAAEAAAD7/wEAAQABAAAAAAD7/wIAAQABAAEAAAA=")
|
||||
tile_set = SubResource("TileSet_l6efi")
|
||||
|
||||
[connection signal="child_exiting_tree" from="." to="." method="_on_child_exiting_tree"]
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://dgq21ggr3br2g"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://dgq21ggr3br2g"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bfgqkpn60hhwj" path="res://scripts/menus/main_menu.gd" id="1_xqga4"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcnjviy00bral" path="res://assets/textures/ui.png" id="2_2o76q"]
|
||||
[ext_resource type="PackedScene" uid="uid://cd657k2lc3gyc" path="res://scenes/menus/profile_creator.tscn" id="2_ovrgc"]
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_6bivr"]
|
||||
texture = ExtResource("2_2o76q")
|
||||
texture_margin_left = 30.0
|
||||
texture_margin_right = 30.0
|
||||
region_rect = Rect2(0, 0, 96, 15)
|
||||
|
||||
[node name="MainMenu" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
@@ -43,6 +50,7 @@ grow_vertical = 2
|
||||
|
||||
[node name="Button" type="Button" parent="TabContainer/Main/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/normal = SubResource("StyleBoxTexture_6bivr")
|
||||
text = "Start"
|
||||
|
||||
[node name="ProfileCreator" parent="TabContainer" instance=ExtResource("2_ovrgc")]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://dh8wt018qxj2y"]
|
||||
[gd_scene load_steps=12 format=3 uid="uid://dh8wt018qxj2y"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b5c8ov4lhocb8" path="res://scripts/menus/pumpkin_carve.gd" id="1_vvdcc"]
|
||||
[ext_resource type="Texture2D" uid="uid://cb8q0hsocixew" path="res://assets/textures/pumpkin_inner.png" id="2_fcp78"]
|
||||
@@ -17,6 +17,16 @@ events = [SubResource("InputEventAction_0qx04")]
|
||||
atlas = ExtResource("4_0qx04")
|
||||
region = Rect2(346, 130, 12, 11)
|
||||
|
||||
[sub_resource type="InputEventAction" id="InputEventAction_wfn45"]
|
||||
action = &"ui_text_submit"
|
||||
|
||||
[sub_resource type="Shortcut" id="Shortcut_sr4y0"]
|
||||
events = [SubResource("InputEventAction_wfn45")]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_6yd03"]
|
||||
atlas = ExtResource("4_0qx04")
|
||||
region = Rect2(128, 272, 16, 15)
|
||||
|
||||
[node name="PumpkinCarve" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
@@ -80,21 +90,26 @@ grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("3_0qx04")
|
||||
|
||||
[node name="UndoButton" type="Button" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 3
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -44.0
|
||||
offset_top = -44.0
|
||||
offset_right = -24.0
|
||||
offset_bottom = -25.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 15.0
|
||||
offset_top = 15.0
|
||||
offset_right = 63.0
|
||||
offset_bottom = 38.0
|
||||
|
||||
[node name="UndoButton" type="Button" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
tooltip_text = "Undo"
|
||||
shortcut = SubResource("Shortcut_wfn45")
|
||||
icon = SubResource("AtlasTexture_wfn45")
|
||||
|
||||
[connection signal="pressed" from="UndoButton" to="." method="_on_undo_button_pressed"]
|
||||
[node name="Finish" type="Button" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
tooltip_text = "Finish"
|
||||
shortcut = SubResource("Shortcut_sr4y0")
|
||||
icon = SubResource("AtlasTexture_6yd03")
|
||||
|
||||
[connection signal="pressed" from="HBoxContainer/UndoButton" to="." method="_on_undo_button_pressed"]
|
||||
[connection signal="pressed" from="HBoxContainer/Finish" to="." method="_on_finish_pressed"]
|
||||
|
||||
201
scenes/menus/util/dialog.tscn
Normal file
201
scenes/menus/util/dialog.tscn
Normal file
@@ -0,0 +1,201 @@
|
||||
[gd_scene load_steps=11 format=3 uid="uid://c5wjwnlubyich"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://ckvgyvclnwggo" path="res://addons/dialogue_manager/dialogue_label.tscn" id="1_ms3k6"]
|
||||
[ext_resource type="Script" uid="uid://cky2m61jgkbsi" path="res://scripts/menus/util/dialog.gd" id="1_o34ae"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcnjviy00bral" path="res://assets/textures/ui.png" id="2_8mfvc"]
|
||||
[ext_resource type="Script" uid="uid://bb52rsfwhkxbn" path="res://addons/dialogue_manager/dialogue_responses_menu.gd" id="2_o34ae"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_spyqn"]
|
||||
bg_color = Color(0, 0, 0, 1)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
border_width_right = 3
|
||||
border_width_bottom = 3
|
||||
border_color = Color(0.329412, 0.329412, 0.329412, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ri4m3"]
|
||||
bg_color = Color(0.121569, 0.121569, 0.121569, 1)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
border_width_right = 3
|
||||
border_width_bottom = 3
|
||||
border_color = Color(1, 1, 1, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_e0njw"]
|
||||
bg_color = Color(0, 0, 0, 1)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
border_width_right = 3
|
||||
border_width_bottom = 3
|
||||
border_color = Color(0.6, 0.6, 0.6, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qkmqt"]
|
||||
bg_color = Color(0, 0, 0, 1)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
border_width_right = 3
|
||||
border_width_bottom = 3
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="Theme" id="Theme_8mfvc"]
|
||||
default_font_size = 20
|
||||
Button/styles/disabled = SubResource("StyleBoxFlat_spyqn")
|
||||
Button/styles/focus = SubResource("StyleBoxFlat_ri4m3")
|
||||
Button/styles/hover = SubResource("StyleBoxFlat_e0njw")
|
||||
Button/styles/normal = SubResource("StyleBoxFlat_e0njw")
|
||||
MarginContainer/constants/margin_bottom = 15
|
||||
MarginContainer/constants/margin_left = 30
|
||||
MarginContainer/constants/margin_right = 30
|
||||
MarginContainer/constants/margin_top = 15
|
||||
PanelContainer/styles/panel = SubResource("StyleBoxFlat_qkmqt")
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_8mfvc"]
|
||||
texture = ExtResource("2_8mfvc")
|
||||
region_rect = Rect2(17, 17, 78, 30)
|
||||
|
||||
[node name="Dialogue" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_o34ae")
|
||||
|
||||
[node name="Balloon" type="Control" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_top = -2.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = SubResource("Theme_8mfvc")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Balloon"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 12
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_top = -104.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="Balloon/MarginContainer"]
|
||||
clip_children = 2
|
||||
layout_mode = 2
|
||||
mouse_filter = 1
|
||||
theme_override_styles/panel = SubResource("StyleBoxTexture_8mfvc")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Balloon/MarginContainer/PanelContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 8
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Balloon/MarginContainer/PanelContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CharacterLabel" type="RichTextLabel" parent="Balloon/MarginContainer/PanelContainer/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
modulate = Color(1, 1, 1, 0.501961)
|
||||
layout_mode = 2
|
||||
mouse_filter = 1
|
||||
bbcode_enabled = true
|
||||
fit_content = true
|
||||
scroll_active = false
|
||||
|
||||
[node name="DialogueLabel" parent="Balloon/MarginContainer/PanelContainer/MarginContainer/VBoxContainer" instance=ExtResource("1_ms3k6")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="PanelContainer2" type="PanelContainer" parent="Balloon/MarginContainer"]
|
||||
clip_children = 2
|
||||
layout_mode = 2
|
||||
mouse_filter = 1
|
||||
theme_override_styles/panel = SubResource("StyleBoxTexture_8mfvc")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Balloon/MarginContainer/PanelContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 8
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Balloon/MarginContainer/PanelContainer2/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CharacterLabel" type="RichTextLabel" parent="Balloon/MarginContainer/PanelContainer2/MarginContainer/VBoxContainer"]
|
||||
modulate = Color(1, 1, 1, 0.501961)
|
||||
layout_mode = 2
|
||||
mouse_filter = 1
|
||||
bbcode_enabled = true
|
||||
fit_content = true
|
||||
scroll_active = false
|
||||
|
||||
[node name="DialogueLabel" parent="Balloon/MarginContainer/PanelContainer2/MarginContainer/VBoxContainer" instance=ExtResource("1_ms3k6")]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="PanelContainer3" type="PanelContainer" parent="Balloon/MarginContainer"]
|
||||
clip_children = 2
|
||||
layout_mode = 2
|
||||
mouse_filter = 1
|
||||
theme_override_styles/panel = SubResource("StyleBoxTexture_8mfvc")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Balloon/MarginContainer/PanelContainer3"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 8
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Balloon/MarginContainer/PanelContainer3/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CharacterLabel" type="RichTextLabel" parent="Balloon/MarginContainer/PanelContainer3/MarginContainer/VBoxContainer"]
|
||||
modulate = Color(1, 1, 1, 0.501961)
|
||||
layout_mode = 2
|
||||
mouse_filter = 1
|
||||
bbcode_enabled = true
|
||||
fit_content = true
|
||||
scroll_active = false
|
||||
|
||||
[node name="DialogueLabel" parent="Balloon/MarginContainer/PanelContainer3/MarginContainer/VBoxContainer" instance=ExtResource("1_ms3k6")]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="ResponsesMenu" type="VBoxContainer" parent="Balloon" node_paths=PackedStringArray("response_template")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -290.5
|
||||
offset_top = -35.0
|
||||
offset_right = 290.5
|
||||
offset_bottom = 35.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_vertical = 8
|
||||
theme_override_constants/separation = 2
|
||||
alignment = 1
|
||||
script = ExtResource("2_o34ae")
|
||||
response_template = NodePath("ResponseExample")
|
||||
|
||||
[node name="ResponseExample" type="Button" parent="Balloon/ResponsesMenu"]
|
||||
layout_mode = 2
|
||||
text = "Response example"
|
||||
64
scenes/menus/win.tscn
Normal file
64
scenes/menus/win.tscn
Normal file
@@ -0,0 +1,64 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dgkxrqfvnffwn"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_16ftr"]
|
||||
script/source = "extends Control
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
EventManager.explosion.explode()
|
||||
|
||||
func _on_button_pressed() -> void:
|
||||
get_tree().quit()
|
||||
"
|
||||
|
||||
[node name="Win" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_16ftr")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 1)
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -53.5
|
||||
offset_top = -21.0
|
||||
offset_right = 53.5
|
||||
offset_bottom = 21.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
bbcode_enabled = true
|
||||
text = "[rainbow][center][wave]YAY YOU WON MY UNFINISHED GAME"
|
||||
|
||||
[node name="Button" type="Button" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -19.0
|
||||
offset_top = 40.5
|
||||
offset_right = 19.0
|
||||
offset_bottom = 61.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "Close"
|
||||
|
||||
[connection signal="pressed" from="Button" to="." method="_on_button_pressed"]
|
||||
@@ -1,9 +1,10 @@
|
||||
[gd_scene load_steps=31 format=3 uid="uid://dfbomt0l6b1o4"]
|
||||
[gd_scene load_steps=32 format=3 uid="uid://dfbomt0l6b1o4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dxvslwwnnlosy" path="res://scripts/player.gd" id="1_3vyb7"]
|
||||
[ext_resource type="Texture2D" uid="uid://d06cv484ev2n3" path="res://assets/textures/spritesheets/normal_player.png" id="2_qhqgy"]
|
||||
[ext_resource type="PackedScene" uid="uid://c48stuhi2qml3" path="res://scenes/menus/hud.tscn" id="3_qhqgy"]
|
||||
[ext_resource type="Texture2D" uid="uid://c1yunf5rn1ncd" path="res://assets/textures/spritesheets/attack.png" id="4_dqkch"]
|
||||
[ext_resource type="AudioStream" uid="uid://byy52fo287btu" path="res://assets/audio/sounds/hit.wav" id="5_qlg0r"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dqkch"]
|
||||
atlas = ExtResource("2_qhqgy")
|
||||
@@ -268,3 +269,6 @@ frame = 5
|
||||
frame_progress = 1.0
|
||||
offset = Vector2(0, 24)
|
||||
flip_v = true
|
||||
|
||||
[node name="Hit" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("5_qlg0r")
|
||||
|
||||
@@ -4,6 +4,7 @@ var player_free: bool = true
|
||||
var player: Player
|
||||
|
||||
@onready var animation_player: AnimationPlayer = $AnimationPlayer
|
||||
@onready var explosion: Control = $Explosion
|
||||
|
||||
enum Events { NONE, PUMPKIN_CARVE, OUTSIDE_NORMAL }
|
||||
var current_event: Events = Events.NONE
|
||||
@@ -23,10 +24,13 @@ func run_event(event: Events, player_postion: Vector2 = Vector2.ZERO):
|
||||
player_free = false
|
||||
transition_scene_file("uid://ccfdsdgaon63m") # scenes/levels/home.tscn
|
||||
await get_tree().scene_changed
|
||||
explosion.explode()
|
||||
await get_tree().create_timer(2).timeout
|
||||
var pumpkin_carve: Control = preload("res://scenes/menus/pumpkin_carve.tscn").instantiate()
|
||||
add_child(pumpkin_carve)
|
||||
|
||||
Events.NONE:
|
||||
player_free = true
|
||||
|
||||
func transition_scene_file(scene: String) -> void:
|
||||
if !animation_player.is_playing():
|
||||
transition_start()
|
||||
|
||||
@@ -20,6 +20,9 @@ func _ready() -> void:
|
||||
navigation_agent_2d.avoidance_priority = randf_range(0.5, 1.0)
|
||||
attack_cooldown_offset = randf_range(0.0, 0.5)
|
||||
animated_sprite.speed_scale = randf_range(0.4, 1.2)
|
||||
|
||||
follow_update_timer.one_shot = false
|
||||
follow_update_timer.autostart = false
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if flicker_timer > 0.0:
|
||||
@@ -28,10 +31,24 @@ func _process(delta: float) -> void:
|
||||
if flicker_timer <= 0.0:
|
||||
animated_sprite.modulate = Color(1, 1, 1)
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if !idle and target:
|
||||
if navigation_agent_2d.is_navigation_finished():
|
||||
velocity = Vector2.ZERO
|
||||
else:
|
||||
var next_pos: Vector2 = navigation_agent_2d.get_next_path_position()
|
||||
var direction: Vector2 = (next_pos - global_position).normalized()
|
||||
velocity = direction * speed * delta
|
||||
else:
|
||||
velocity = Vector2.ZERO
|
||||
|
||||
move_and_slide()
|
||||
|
||||
func _on_area_body_entered(body: Node2D) -> void:
|
||||
if body is Player:
|
||||
idle = false
|
||||
target = body
|
||||
navigation_agent_2d.target_position = target.global_position
|
||||
follow_update_timer.start()
|
||||
animated_sprite.play()
|
||||
|
||||
@@ -53,30 +70,12 @@ func _on_attack_area_body_exited(body: Node2D) -> void:
|
||||
in_attack_range = false
|
||||
attack_timer.stop()
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if !idle && target:
|
||||
if !navigation_agent_2d.is_navigation_finished():
|
||||
var next_path_pos: Vector2 = navigation_agent_2d.get_next_path_position()
|
||||
var direction: Vector2 = (next_path_pos - global_position).normalized()
|
||||
var desired_velocity: Vector2 = direction * speed * delta
|
||||
navigation_agent_2d.set_velocity(desired_velocity)
|
||||
else:
|
||||
velocity = Vector2.ZERO
|
||||
move_and_slide()
|
||||
else:
|
||||
velocity = Vector2.ZERO
|
||||
move_and_slide()
|
||||
|
||||
func _on_follow_update_timer_timeout() -> void:
|
||||
if target && !idle:
|
||||
if target and !idle:
|
||||
navigation_agent_2d.target_position = target.global_position
|
||||
|
||||
func _on_navigation_agent2d_velocity_computed(safe_velocity: Vector2) -> void:
|
||||
velocity = safe_velocity
|
||||
move_and_slide()
|
||||
|
||||
func _on_attack_timer_timeout() -> void:
|
||||
if target && in_attack_range:
|
||||
if target and in_attack_range:
|
||||
target.health -= DAMAGE
|
||||
|
||||
func _on_fightable_fought(player: Player) -> void:
|
||||
|
||||
@@ -89,3 +89,7 @@ func save_image() -> void:
|
||||
|
||||
func _on_undo_button_pressed() -> void:
|
||||
undo()
|
||||
|
||||
func _on_finish_pressed() -> void:
|
||||
EventManager.run_event(EventManager.Events.NONE)
|
||||
queue_free()
|
||||
|
||||
176
scripts/menus/util/dialog.gd
Normal file
176
scripts/menus/util/dialog.gd
Normal file
@@ -0,0 +1,176 @@
|
||||
extends Control
|
||||
## A basic dialogue balloon for use with Dialogue Manager.
|
||||
|
||||
## The action to use for advancing the dialogue
|
||||
@export var next_action: StringName = &"ui_accept"
|
||||
|
||||
## The action to use to skip typing the dialogue
|
||||
@export var skip_action: StringName = &"ui_cancel"
|
||||
|
||||
## The dialogue resource
|
||||
var resource: DialogueResource
|
||||
|
||||
## Temporary game states
|
||||
var temporary_game_states: Array = []
|
||||
|
||||
## See if we are waiting for the player
|
||||
var is_waiting_for_input: bool = false
|
||||
|
||||
## See if we are running a long mutation and should hide the balloon
|
||||
var will_hide_balloon: bool = false
|
||||
|
||||
## A dictionary to store any ephemeral variables
|
||||
var locals: Dictionary = {}
|
||||
|
||||
var _locale: String = TranslationServer.get_locale()
|
||||
|
||||
## The current line
|
||||
var dialogue_line: DialogueLine:
|
||||
set(value):
|
||||
if value:
|
||||
dialogue_line = value
|
||||
apply_dialogue_line()
|
||||
else:
|
||||
await get_tree().create_timer(.2).timeout # prevent dialogue trigger loop
|
||||
balloon.hide()
|
||||
get:
|
||||
return dialogue_line
|
||||
|
||||
## A cooldown timer for delaying the balloon hide when encountering a mutation.
|
||||
var mutation_cooldown: Timer = Timer.new()
|
||||
|
||||
## The base balloon anchor
|
||||
@onready var balloon: Control = %Balloon
|
||||
|
||||
## The label showing the name of the currently speaking character
|
||||
@onready var character_label: RichTextLabel = %CharacterLabel
|
||||
|
||||
## The label showing the currently spoken dialogue
|
||||
@onready var dialogue_label: DialogueLabel = %DialogueLabel
|
||||
|
||||
## The menu of responses
|
||||
@onready var responses_menu: DialogueResponsesMenu = %ResponsesMenu
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
balloon.hide()
|
||||
Engine.get_singleton("DialogueManager").mutated.connect(_on_mutated)
|
||||
|
||||
# If the responses menu doesn't have a next action set, use this one
|
||||
if responses_menu.next_action.is_empty():
|
||||
responses_menu.next_action = next_action
|
||||
|
||||
mutation_cooldown.timeout.connect(_on_mutation_cooldown_timeout)
|
||||
add_child(mutation_cooldown)
|
||||
|
||||
|
||||
func _unhandled_input(_event: InputEvent) -> void:
|
||||
# Only the balloon is allowed to handle input while it's showing
|
||||
get_viewport().set_input_as_handled()
|
||||
|
||||
|
||||
func _notification(what: int) -> void:
|
||||
## Detect a change of locale and update the current dialogue line to show the new language
|
||||
if what == NOTIFICATION_TRANSLATION_CHANGED and _locale != TranslationServer.get_locale() and is_instance_valid(dialogue_label):
|
||||
_locale = TranslationServer.get_locale()
|
||||
var visible_ratio = dialogue_label.visible_ratio
|
||||
self.dialogue_line = await resource.get_next_dialogue_line(dialogue_line.id)
|
||||
if visible_ratio < 1:
|
||||
dialogue_label.skip_typing()
|
||||
|
||||
|
||||
## Start some dialogue
|
||||
func start(dialogue_resource: DialogueResource, title: String, extra_game_states: Array = []) -> void:
|
||||
temporary_game_states = [self] + extra_game_states
|
||||
is_waiting_for_input = false
|
||||
resource = dialogue_resource
|
||||
self.dialogue_line = await resource.get_next_dialogue_line(title, temporary_game_states)
|
||||
|
||||
|
||||
## Apply any changes to the balloon given a new [DialogueLine].
|
||||
func apply_dialogue_line() -> void:
|
||||
mutation_cooldown.stop()
|
||||
|
||||
is_waiting_for_input = false
|
||||
balloon.focus_mode = Control.FOCUS_ALL
|
||||
balloon.grab_focus()
|
||||
|
||||
character_label.visible = not dialogue_line.character.is_empty()
|
||||
character_label.text = tr(dialogue_line.character, "dialogue")
|
||||
|
||||
dialogue_label.hide()
|
||||
dialogue_label.dialogue_line = dialogue_line
|
||||
|
||||
responses_menu.hide()
|
||||
responses_menu.responses = dialogue_line.responses
|
||||
|
||||
# Show our balloon
|
||||
balloon.show()
|
||||
will_hide_balloon = false
|
||||
|
||||
dialogue_label.show()
|
||||
if not dialogue_line.text.is_empty():
|
||||
dialogue_label.type_out()
|
||||
await dialogue_label.finished_typing
|
||||
|
||||
# Wait for input
|
||||
if dialogue_line.responses.size() > 0:
|
||||
balloon.focus_mode = Control.FOCUS_NONE
|
||||
responses_menu.show()
|
||||
elif dialogue_line.time != "":
|
||||
var time = dialogue_line.text.length() * 0.02 if dialogue_line.time == "auto" else dialogue_line.time.to_float()
|
||||
await get_tree().create_timer(time).timeout
|
||||
next(dialogue_line.next_id)
|
||||
else:
|
||||
is_waiting_for_input = true
|
||||
balloon.focus_mode = Control.FOCUS_ALL
|
||||
balloon.grab_focus()
|
||||
|
||||
|
||||
## Go to the next line
|
||||
func next(next_id: String) -> void:
|
||||
self.dialogue_line = await resource.get_next_dialogue_line(next_id, temporary_game_states)
|
||||
|
||||
|
||||
#region Signals
|
||||
|
||||
|
||||
func _on_mutation_cooldown_timeout() -> void:
|
||||
if will_hide_balloon:
|
||||
will_hide_balloon = false
|
||||
balloon.hide()
|
||||
|
||||
|
||||
func _on_mutated(_mutation: Dictionary) -> void:
|
||||
is_waiting_for_input = false
|
||||
will_hide_balloon = true
|
||||
mutation_cooldown.start(0.1)
|
||||
|
||||
|
||||
func _on_balloon_gui_input(event: InputEvent) -> void:
|
||||
# See if we need to skip typing of the dialogue
|
||||
if dialogue_label.is_typing:
|
||||
var mouse_was_clicked: bool = event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.is_pressed()
|
||||
var skip_button_was_pressed: bool = event.is_action_pressed(skip_action)
|
||||
if mouse_was_clicked or skip_button_was_pressed:
|
||||
get_viewport().set_input_as_handled()
|
||||
dialogue_label.skip_typing()
|
||||
return
|
||||
|
||||
if not is_waiting_for_input: return
|
||||
if dialogue_line.responses.size() > 0: return
|
||||
|
||||
# When there are no response options the balloon itself is the clickable thing
|
||||
get_viewport().set_input_as_handled()
|
||||
|
||||
if event is InputEventMouseButton and event.is_pressed() and event.button_index == MOUSE_BUTTON_LEFT:
|
||||
next(dialogue_line.next_id)
|
||||
elif event.is_action_pressed(next_action) and get_viewport().gui_get_focus_owner() == balloon:
|
||||
next(dialogue_line.next_id)
|
||||
|
||||
|
||||
func _on_responses_menu_response_selected(response: DialogueResponse) -> void:
|
||||
next(response.next_id)
|
||||
|
||||
|
||||
#endregion
|
||||
1
scripts/menus/util/dialog.gd.uid
Normal file
1
scripts/menus/util/dialog.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cky2m61jgkbsi
|
||||
@@ -60,6 +60,7 @@ func interact() -> void:
|
||||
if interactable == null:
|
||||
fight_animation.rotation_degrees = 0
|
||||
fight_animation.play()
|
||||
$Hit.play()
|
||||
if !fight_animation.is_playing():
|
||||
fight_animation.play()
|
||||
await animated_sprite.animation_finished
|
||||
@@ -69,6 +70,7 @@ func interact() -> void:
|
||||
if interactable == null:
|
||||
fight_animation.rotation_degrees = 180
|
||||
fight_animation.play()
|
||||
$Hit.play()
|
||||
if !fight_animation.is_playing():
|
||||
fight_animation.play()
|
||||
await animated_sprite.animation_finished
|
||||
@@ -76,6 +78,7 @@ func interact() -> void:
|
||||
"side":
|
||||
animated_sprite.play("hand_side")
|
||||
if interactable == null:
|
||||
$Hit.play()
|
||||
if animated_sprite.flip_h:
|
||||
fight_animation.rotation_degrees = 90
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user