Compare commits

...

23 Commits

Author SHA1 Message Date
66be7838bb buffered inputs revamped and added mantle jumps and dashed
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 21s
Create tag and build when new code gets to main / Export (push) Successful in 10m30s
2026-01-11 18:14:53 +01:00
1eb65d1520 some shader work and improved mantle feel 2026-01-11 17:09:58 +01:00
f2a39316ba shader changes that don't do anything
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 19s
Create tag and build when new code gets to main / Export (push) Successful in 9m48s
2026-01-07 17:11:49 +01:00
fffd8c947b implementing jump input buffering on grounded
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 18s
Create tag and build when new code gets to main / Export (push) Successful in 9m47s
2026-01-07 09:58:18 +01:00
a1d57d6a1a some tuto fixing
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 19s
Create tag and build when new code gets to main / Export (push) Successful in 9m49s
2026-01-06 16:35:17 +01:00
941205af2b small gravity and jump balancing, removed wall jumping coyote times
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 19s
Create tag and build when new code gets to main / Export (push) Successful in 9m34s
2026-01-06 16:08:39 +01:00
6c2ad89687 fixing the manlting into geo
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 19s
Create tag and build when new code gets to main / Export (push) Successful in 9m42s
2026-01-06 12:36:38 +01:00
59494f9e98 updating CI to build for linux as well
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 19s
Create tag and build when new code gets to main / Export (push) Successful in 9m34s
2025-12-25 09:37:51 +01:00
510246c341 fix a scene load issue
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 21s
Create tag and build when new code gets to main / Export (push) Successful in 8m22s
2025-12-22 14:25:17 +01:00
b184bcdea5 added a small dash when leaving a wall run organically
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 18s
Create tag and build when new code gets to main / Export (push) Successful in 8m36s
2025-12-21 17:23:38 +01:00
cf52af4237 mantling after aimed dash with new mantle system 2025-12-21 16:44:35 +01:00
e0fc301414 fixed user stuff
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 17s
Create tag and build when new code gets to main / Export (push) Successful in 8m10s
2025-12-19 19:11:53 +01:00
b792e8721c mantle system fix amazing
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 22s
Create tag and build when new code gets to main / Export (push) Successful in 8m19s
2025-12-19 18:59:34 +01:00
2e2df4ff50 new broken mantle system and fixed lots of gamefeel regarding wall hugs and jumps and coyote time
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 20s
Create tag and build when new code gets to main / Export (push) Successful in 8m51s
2025-12-17 16:39:10 +01:00
a84e0ecfb3 Merge branch 'main' of https://git.game-dev.space/minimata/MovementTests
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 20s
Create tag and build when new code gets to main / Export (push) Successful in 8m25s
2025-12-15 11:20:39 +01:00
f828c1d786 added a coyote time for wall jumps 2025-12-15 11:20:17 +01:00
a98785abec Update .gitea/workflows/main.yaml
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 18s
Create tag and build when new code gets to main / Export (push) Successful in 8m49s
2025-12-10 21:26:25 +00:00
7c4e541446 fixed input mapping context issue
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 20s
Create tag and build when new code gets to main / Export (push) Successful in 6m5s
2025-12-10 17:10:41 +01:00
7d31d17034 tuto fixes
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 19s
Create tag and build when new code gets to main / Export (push) Successful in 6m7s
2025-12-10 10:04:05 +01:00
2ff8cc74cc camera incline on wall run and normal run
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 21s
Create tag and build when new code gets to main / Export (push) Successful in 6m17s
2025-12-08 12:23:36 +01:00
fabafbb35b small improvements on the wall run
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 18s
Create tag and build when new code gets to main / Export (push) Successful in 5m54s
2025-11-14 16:39:17 +01:00
0b0163a0ac finally managed to pin down the in game UI and control issues for keyboard
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 18s
Create tag and build when new code gets to main / Export (push) Successful in 5m43s
2025-11-14 12:32:03 +01:00
5b3d6c9f19 can quit menus using B button
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 18s
Create tag and build when new code gets to main / Export (push) Successful in 6m5s
2025-11-14 11:41:11 +01:00
38 changed files with 1908 additions and 1217 deletions

View File

@@ -54,27 +54,12 @@ jobs:
- name: Import resources and build solution - name: Import resources and build solution
run: | run: |
godot --headless --editor --build-solutions --quit --import --path $PWD godot --headless --editor --build-solutions --quit --import --path $PWD
- name: Build Windows - name: Build Windows
run: | run: |
mkdir -v -p build/windows mkdir -v -p build/windows
godot --headless --verbose --build-solutions --export-release "Windows Desktop" build/windows/${{ env.GAME_NAME }}.exe godot --headless --verbose --build-solutions --export-release "Windows Desktop" build/windows/${{ env.GAME_NAME }}.exe
zip -r Windows.zip build/windows zip -r Windows.zip build/windows
- name: Build Windows ARM
run: |
mkdir -v -p build/windowsArm
godot --headless --verbose --build-solutions --export-release "Windows ARM" build/windowsArm/${{ env.GAME_NAME }}.exe
zip -r WindowsArm.zip build/windowsArm
# - name: Linux Build
# run: |
# mkdir -v -p build/linux
# godot --headless --verbose --export-release "Linux/X11" build/linux/${{ env.GAME_NAME }}.x86_64
# zip -r Linux.zip build/linux
# - name: Mac Build
# run: |
# mkdir -v -p build/mac
# godot --headless --verbose --export-release "macOS" build/mac/${{ env.GAME_NAME }}.zip
# zip -r Mac.zip build/mac
- name: Upload to Itch - name: Upload to Itch
uses: KikimoraGames/itch-publish@v0.0.3 uses: KikimoraGames/itch-publish@v0.0.3
with: with:
@@ -84,6 +69,12 @@ jobs:
buildNumber: ${{ needs.BumpTag.outputs.tag_name }} buildNumber: ${{ needs.BumpTag.outputs.tag_name }}
gameData: Windows.zip gameData: Windows.zip
buildChannel: windows buildChannel: windows
- name: Build Windows ARM
run: |
mkdir -v -p build/windowsArm
godot --headless --verbose --build-solutions --export-release "Windows ARM" build/windowsArm/${{ env.GAME_NAME }}.exe
zip -r WindowsArm.zip build/windowsArm
- name: Upload to Itch - name: Upload to Itch
uses: KikimoraGames/itch-publish@v0.0.3 uses: KikimoraGames/itch-publish@v0.0.3
with: with:
@@ -93,21 +84,33 @@ jobs:
buildNumber: ${{ needs.BumpTag.outputs.tag_name }} buildNumber: ${{ needs.BumpTag.outputs.tag_name }}
gameData: WindowsArm.zip gameData: WindowsArm.zip
buildChannel: windows-arm buildChannel: windows-arm
# - name: Upload to Itch
# uses: KikimoraGames/itch-publish@v0.0.3 - name: Linux Build
# with: run: |
# butlerApiKey: ${{ secrets.BUTLER_TOKEN }} mkdir -v -p build/linux
# itchUsername: ${{ env.ITCHIO_USERNAME }} godot --headless --verbose --export-release "Linux/X11" build/linux/${{ env.GAME_NAME }}.x86_64
# itchGameId: ${{ env.ITCHIO_GAMEID }} zip -r Linux.zip build/linux
# buildNumber: ${{ needs.BumpTag.outputs.tag_name }} - name: Upload to Itch
# gameData: Linux.zip uses: KikimoraGames/itch-publish@v0.0.3
# buildChannel: linux with:
# - name: Upload to Itch butlerApiKey: ${{ secrets.BUTLER_TOKEN }}
# uses: KikimoraGames/itch-publish@v0.0.3 itchUsername: ${{ env.ITCHIO_USERNAME }}
# with: itchGameId: ${{ env.ITCHIO_GAMEID }}
# butlerApiKey: ${{ secrets.BUTLER_TOKEN }} buildNumber: ${{ needs.BumpTag.outputs.tag_name }}
# itchUsername: ${{ env.ITCHIO_USERNAME }} gameData: Linux.zip
# itchGameId: ${{ env.ITCHIO_GAMEID }} buildChannel: linux
# buildNumber: ${{ needs.BumpTag.outputs.tag_name }}
# gameData: Mac.zip - name: Mac Build
# buildChannel: mac run: |
mkdir -v -p build/mac
godot --headless --verbose --export-release "macOS" build/mac/${{ env.GAME_NAME }}.zip
zip -r Mac.zip build/mac
- name: Upload to Itch
uses: KikimoraGames/itch-publish@v0.0.3
with:
butlerApiKey: ${{ secrets.BUTLER_TOKEN }}
itchUsername: ${{ env.ITCHIO_USERNAME }}
itchGameId: ${{ env.ITCHIO_GAMEID }}
buildNumber: ${{ needs.BumpTag.outputs.tag_name }}
gameData: Mac.zip
buildChannel: mac

1
.gitignore vendored
View File

@@ -10,6 +10,7 @@
.import/ .import/
/builds /builds
/communication
# Imported translations (automatically generated from CSV files) # Imported translations (automatically generated from CSV files)
*.translation *.translation

View File

@@ -6,11 +6,15 @@ extends Control
@export var options_packed_scene : PackedScene @export var options_packed_scene : PackedScene
@export var credits_packed_scene : PackedScene @export var credits_packed_scene : PackedScene
@export var menu_context : GUIDEMappingContext
@export var back_action : GUIDEAction
var options_scene var options_scene
var credits_scene var credits_scene
var sub_menu var sub_menu
func load_game_scene() -> void: func load_game_scene() -> void:
GUIDE.disable_mapping_context(menu_context)
SceneLoader.load_scene(game_scene_path) SceneLoader.load_scene(game_scene_path)
func new_game() -> void: func new_game() -> void:
@@ -73,7 +77,12 @@ func _ready() -> void:
_add_or_hide_options() _add_or_hide_options()
_add_or_hide_credits() _add_or_hide_credits()
_hide_new_game_if_unset() _hide_new_game_if_unset()
_setup_inputs()
func _setup_inputs() -> void:
GUIDE.enable_mapping_context(menu_context)
back_action.triggered.connect(_on_back_button_pressed)
func _on_new_game_button_pressed() -> void: func _on_new_game_button_pressed() -> void:
new_game() new_game()

View File

@@ -9,16 +9,19 @@ extends OverlaidMenu
var popup_open : Node var popup_open : Node
var previous_mapping_contexts : Array var previous_mapping_contexts : Array
func on_enter_tree() -> void: var is_listening_to_inputs = true
pass
#previous_mapping_contexts = GUIDE.get_enabled_mapping_contexts() func _enter_tree() -> void:
#GUIDE.enable_mapping_context(menu_context) super._enter_tree()
previous_mapping_contexts = GUIDE.get_enabled_mapping_contexts()
for previous_context in previous_mapping_contexts:
GUIDE.disable_mapping_context(previous_context)
GUIDE.enable_mapping_context(menu_context)
func on_exit_tree() -> void: func _exit_tree() -> void:
pass GUIDE.disable_mapping_context(menu_context)
#GUIDE.disable_mapping_context(menu_context) for previous_context in previous_mapping_contexts:
#for previous_context in previous_mapping_contexts: GUIDE.enable_mapping_context(previous_context)
#GUIDE.enable_mapping_context(previous_context)
func close_popup() -> void: func close_popup() -> void:
if popup_open != null: if popup_open != null:
@@ -43,10 +46,15 @@ func open_options_menu() -> void:
var options_scene := options_packed_scene.instantiate() var options_scene := options_packed_scene.instantiate()
add_child(options_scene) add_child(options_scene)
_disable_focus.call_deferred() _disable_focus.call_deferred()
is_listening_to_inputs = false
await options_scene.tree_exiting await options_scene.tree_exiting
is_listening_to_inputs = true
_enable_focus.call_deferred() _enable_focus.call_deferred()
func _handle_cancel_input() -> void: func _handle_cancel_input() -> void:
if not is_listening_to_inputs:
return
if popup_open != null: if popup_open != null:
close_popup() close_popup()
else: else:
@@ -68,6 +76,8 @@ func _ready() -> void:
_hide_exit_for_web() _hide_exit_for_web()
_hide_options_if_unset() _hide_options_if_unset()
_hide_main_menu_if_unset() _hide_main_menu_if_unset()
back_action.triggered.connect(_handle_cancel_input)
func _on_restart_button_pressed() -> void: func _on_restart_button_pressed() -> void:
%ConfirmRestart.popup_centered() %ConfirmRestart.popup_centered()
@@ -93,3 +103,5 @@ func _on_confirm_main_menu_confirmed() -> void:
func _on_confirm_exit_confirmed() -> void: func _on_confirm_exit_confirmed() -> void:
get_tree().quit() get_tree().quit()

View File

@@ -11,6 +11,8 @@ extends Control
process_mode = PROCESS_MODE_INHERIT process_mode = PROCESS_MODE_INHERIT
@export var makes_mouse_visible : bool = true @export var makes_mouse_visible : bool = true
@export var back_action : GUIDEAction
signal menu_closing signal menu_closing
var _initial_pause_state : bool = false var _initial_pause_state : bool = false
@@ -32,13 +34,14 @@ func _handle_cancel_input() -> void:
close() close()
func _unhandled_input(event : InputEvent) -> void: func _unhandled_input(event : InputEvent) -> void:
return
if event.is_action_pressed("ui_cancel"): if event.is_action_pressed("ui_cancel"):
_handle_cancel_input() _handle_cancel_input()
get_viewport().set_input_as_handled() get_viewport().set_input_as_handled()
func _on_close_button_pressed() -> void: func _on_close_button_pressed() -> void:
close() close()
func _enter_tree() -> void: func _enter_tree() -> void:
_scene_tree = get_tree() _scene_tree = get_tree()
_initial_pause_state = _scene_tree.paused _initial_pause_state = _scene_tree.paused

View File

@@ -12,3 +12,11 @@ extends OverlaidMenu
if menu_scene: if menu_scene:
var _instance = menu_scene.instantiate() var _instance = menu_scene.instantiate()
%MenuContainer.add_child(_instance) %MenuContainer.add_child(_instance)
func blocking_close() -> void:
get_viewport().set_input_as_handled()
super.close()
func _ready() -> void:
back_action.triggered.connect(blocking_close)

View File

@@ -7,15 +7,18 @@ extends Node
@export var player : CharacterBody3D @export var player : CharacterBody3D
@export_group("Inputs") @export_group("Inputs")
@export var base_mode:GUIDEMappingContext
@export var pause:GUIDEAction @export var pause:GUIDEAction
var menu_already_open = false
func _ready() -> void: func _ready() -> void:
# GUIDE.enable_mapping_context(base_mode)
pause.triggered.connect(on_input_pause) pause.triggered.connect(on_input_pause)
func on_input_pause(): func on_input_pause():
if menu_already_open:
return
menu_already_open = true
if not focused_viewport: if not focused_viewport:
focused_viewport = get_viewport() focused_viewport = get_viewport()
var _initial_focus_control = focused_viewport.gui_get_focus_owner() var _initial_focus_control = focused_viewport.gui_get_focus_owner()
@@ -25,9 +28,6 @@ func on_input_pause():
get_tree().current_scene.call_deferred("add_child", current_menu) get_tree().current_scene.call_deferred("add_child", current_menu)
await current_menu.tree_exited await current_menu.tree_exited
menu_already_open = false
if is_inside_tree() and _initial_focus_control: if is_inside_tree() and _initial_focus_control:
_initial_focus_control.grab_focus() _initial_focus_control.grab_focus()
func _unhandled_input(event : InputEvent) -> void:
if event.is_action_pressed("ui_cancel"):
pass

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -27,7 +27,7 @@ shader_parameter/floorRoughnessMap = ExtResource("4_rir86")
shader_parameter/floorNormalMap = ExtResource("3_f1b6h") shader_parameter/floorNormalMap = ExtResource("3_f1b6h")
shader_parameter/floorHeightMap = ExtResource("2_0e3id") shader_parameter/floorHeightMap = ExtResource("2_0e3id")
shader_parameter/floorUvScale = 0.5 shader_parameter/floorUvScale = 0.5
shader_parameter/enablePom = true shader_parameter/enablePom = false
shader_parameter/heightMinLayers = 8 shader_parameter/heightMinLayers = 8
shader_parameter/heightMaxLayers = 64 shader_parameter/heightMaxLayers = 64
shader_parameter/heightScale = 0.08 shader_parameter/heightScale = 0.08

View File

@@ -28,6 +28,7 @@ uniform float heightScale = 1.0;
varying vec3 worldPos; varying vec3 worldPos;
varying vec3 worldNormal; varying vec3 worldNormal;
varying vec3 diffuse;
void vertex() { void vertex() {
@@ -177,12 +178,14 @@ void fragment() {
// sample and output // sample and output
SPECULAR = specular; SPECULAR = specular;
ALBEDO = triplanarSample(texCoordX, texCoordY, texCoordZ, blend, yDot).rgb; ALBEDO = triplanarSample(texCoordX, texCoordY, texCoordZ, blend, yDot).rgb;
diffuse = ALBEDO;
ROUGHNESS = triplanarRoughness(texCoordX, texCoordY, texCoordZ, blend, yDot).r; ROUGHNESS = triplanarRoughness(texCoordX, texCoordY, texCoordZ, blend, yDot).r;
NORMAL = mix(worldNormal, triplanarNormal(yDot, texCoordX, texCoordY, texCoordZ, blend), normalMapStrength); NORMAL = mix(worldNormal, triplanarNormal(yDot, texCoordX, texCoordY, texCoordZ, blend), normalMapStrength);
NORMAL = normalize((VIEW_MATRIX * vec4(NORMAL, 0.0)).xyz); NORMAL = normalize((VIEW_MATRIX * vec4(NORMAL, 0.0)).xyz);
} }
//void light() { void light() {
// // Called for every pixel for every light affecting the material. float lambert = clamp(dot(NORMAL, LIGHT), 0.0, 1.0);
// // Uncomment to replace the default light processing function with this one. float halfLambert = pow(lambert*0.5 + 0.5, 5);
//} DIFFUSE_LIGHT += halfLambert * ATTENUATION * LIGHT_COLOR / PI;
}

View File

@@ -31,7 +31,7 @@ shader_parameter/floorRoughnessMap = ExtResource("4_4vhk1")
shader_parameter/floorNormalMap = ExtResource("3_ytvoj") shader_parameter/floorNormalMap = ExtResource("3_ytvoj")
shader_parameter/floorHeightMap = ExtResource("2_4vhk1") shader_parameter/floorHeightMap = ExtResource("2_4vhk1")
shader_parameter/floorUvScale = 0.5 shader_parameter/floorUvScale = 0.5
shader_parameter/enablePom = true shader_parameter/enablePom = false
shader_parameter/heightMinLayers = 8 shader_parameter/heightMinLayers = 8
shader_parameter/heightMaxLayers = 64 shader_parameter/heightMaxLayers = 64
shader_parameter/heightScale = 0.2 shader_parameter/heightScale = 0.2

View File

@@ -27,7 +27,7 @@ shader_parameter/floorRoughnessMap = ExtResource("4_ob11h")
shader_parameter/floorNormalMap = ExtResource("3_ff2cr") shader_parameter/floorNormalMap = ExtResource("3_ff2cr")
shader_parameter/floorHeightMap = ExtResource("2_roy1o") shader_parameter/floorHeightMap = ExtResource("2_roy1o")
shader_parameter/floorUvScale = 0.5 shader_parameter/floorUvScale = 0.5
shader_parameter/enablePom = true shader_parameter/enablePom = false
shader_parameter/heightMinLayers = 8 shader_parameter/heightMinLayers = 8
shader_parameter/heightMaxLayers = 64 shader_parameter/heightMaxLayers = 64
shader_parameter/heightScale = 1.0 shader_parameter/heightScale = 1.0

Binary file not shown.

Binary file not shown.

View File

@@ -30,6 +30,7 @@ glow_enabled = true
[node name="Player" parent="." instance=ExtResource("1_1s2y7")] [node name="Player" parent="." instance=ExtResource("1_1s2y7")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1.5) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1.5)
TutorialDone = true
[node name="WorldEnvironment" type="WorldEnvironment" parent="."] [node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_1bvp3") environment = SubResource("Environment_1bvp3")
@@ -49,7 +50,7 @@ collision_layer = 3
collision_mask = 5 collision_mask = 5
[node name="CSGBox3D" type="CSGBox3D" parent="Greybox"] [node name="CSGBox3D" type="CSGBox3D" parent="Greybox"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.09619, -0.472656, -46.3293) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.096, -0.5, -46.329)
use_collision = true use_collision = true
size = Vector3(100, 1, 190.741) size = Vector3(100, 1, 190.741)
material = ExtResource("3_vvhq3") material = ExtResource("3_vvhq3")
@@ -399,3 +400,211 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 12, 4.5, -11.5)
use_collision = true use_collision = true
size = Vector3(1, 0.5, 5) size = Vector3(1, 0.5, 5)
material = ExtResource("3_vvhq3") material = ExtResource("3_vvhq3")
[node name="Mantles" type="CSGCombiner3D" parent="Greybox"]
[node name="Label3D22" type="Label3D" parent="Greybox/Mantles"]
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, -5.5, 0.1, 11)
text = "0.5m"
[node name="Label3D35" type="Label3D" parent="Greybox/Mantles"]
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, -8.5, 0.1, 11)
text = "0.25m"
[node name="Label3D23" type="Label3D" parent="Greybox/Mantles"]
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, -2, 0.1, 11)
text = "1m"
[node name="Label3D27" type="Label3D" parent="Greybox/Mantles"]
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, -11, 0.1, 12.5)
text = "1m"
[node name="Label3D28" type="Label3D" parent="Greybox/Mantles"]
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, 13, 0.1, 12.5)
text = "1m"
[node name="Label3D29" type="Label3D" parent="Greybox/Mantles"]
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, 13, 0.1, 21)
text = "2m"
[node name="Label3D30" type="Label3D" parent="Greybox/Mantles"]
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, 13, 0.1, 28.5)
text = "3m"
[node name="Label3D31" type="Label3D" parent="Greybox/Mantles"]
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, -11, 0.1, 21)
text = "2m"
[node name="Label3D32" type="Label3D" parent="Greybox/Mantles"]
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, -11, 0.1, 28.5)
text = "3m"
[node name="Label3D24" type="Label3D" parent="Greybox/Mantles"]
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, 2, 0.1, 11)
text = "1.5m"
[node name="Label3D25" type="Label3D" parent="Greybox/Mantles"]
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, 6, 0.1, 11)
text = "2m"
[node name="Label3D26" type="Label3D" parent="Greybox/Mantles"]
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, 10, 0.1, 11)
text = "4m"
[node name="CSGBox3D33" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 0.5, 12.5)
use_collision = true
size = Vector3(4, 1, 1)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D34" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5, 0.5, 12.25)
use_collision = true
size = Vector3(3, 1, 0.5)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D35" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0.5, 12.75)
use_collision = true
size = Vector3(4, 1, 1.5)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D36" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0.5, 13)
use_collision = true
size = Vector3(4, 1, 2)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D37" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 0.5, 14)
use_collision = true
size = Vector3(4, 1, 4)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D38" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 1, 20.5)
use_collision = true
size = Vector3(4, 2, 1)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D39" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5, 1, 20.25)
use_collision = true
size = Vector3(3, 2, 0.5)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D40" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 1, 20.75)
use_collision = true
size = Vector3(4, 2, 1.5)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D41" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 1, 21)
use_collision = true
size = Vector3(4, 2, 2)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D42" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 1, 22)
use_collision = true
size = Vector3(4, 2, 4)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D43" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 1.5, 28.5)
use_collision = true
size = Vector3(4, 3, 1)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D44" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5, 1.5, 28.25)
use_collision = true
size = Vector3(3, 3, 0.5)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D45" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 1.5, 28.75)
use_collision = true
size = Vector3(4, 3, 1.5)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D46" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 1.5, 29)
use_collision = true
size = Vector3(4, 3, 2)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D47" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 1.5, 30)
use_collision = true
size = Vector3(4, 3, 4)
material = ExtResource("3_vvhq3")
[node name="Label3D33" type="Label3D" parent="Greybox/Mantles"]
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, 13, 0.1, 36.5)
text = "4m"
[node name="Label3D34" type="Label3D" parent="Greybox/Mantles"]
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, -11, 0.1, 36.5)
text = "4m"
[node name="CSGBox3D48" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 2, 36.5)
use_collision = true
size = Vector3(4, 4, 1)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D49" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5, 2, 36.25)
use_collision = true
size = Vector3(3, 4, 0.5)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D53" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.5, 0.5, 12.125)
use_collision = true
size = Vector3(3, 1, 0.25)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D57" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, -13, 3.5, -21.629175)
use_collision = true
size = Vector3(5, 1, 0.25)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D54" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.5, 1, 20.125)
use_collision = true
size = Vector3(3, 2, 0.25)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D55" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.5, 1.5, 28.125)
use_collision = true
size = Vector3(3, 3, 0.25)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D56" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.5, 2, 36.125)
use_collision = true
size = Vector3(3, 4, 0.25)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D50" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 2, 36.75)
use_collision = true
size = Vector3(4, 4, 1.5)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D51" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 2, 37)
use_collision = true
size = Vector3(4, 4, 2)
material = ExtResource("3_vvhq3")
[node name="CSGBox3D52" type="CSGBox3D" parent="Greybox/Mantles"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 2, 38)
use_collision = true
size = Vector3(4, 4, 4)
material = ExtResource("3_vvhq3")

View File

@@ -1,13 +1,11 @@
[gd_scene load_steps=42 format=3 uid="uid://dmkw8cmalm5k"] [gd_scene load_steps=40 format=3 uid="uid://dmkw8cmalm5k"]
[ext_resource type="PackedScene" uid="uid://bei4nhkf8lwdo" path="res://player_controller/PlayerController.tscn" id="1_2vsi6"] [ext_resource type="PackedScene" uid="uid://bei4nhkf8lwdo" path="res://player_controller/PlayerController.tscn" id="1_2vsi6"]
[ext_resource type="Script" uid="uid://blenis2y55fmg" path="res://tools/city_helpers.gd" id="1_qwuk2"] [ext_resource type="Script" uid="uid://blenis2y55fmg" path="res://tools/city_helpers.gd" id="1_qwuk2"]
[ext_resource type="Texture2D" uid="uid://ca4kkq3w8cd4n" path="res://assets/sky/sky_15_2k.png" id="2_ruo5i"] [ext_resource type="Texture2D" uid="uid://ca4kkq3w8cd4n" path="res://assets/sky/sky_15_2k.png" id="2_ruo5i"]
[ext_resource type="PackedScene" uid="uid://dkr80d2pi0d41" path="res://addons/guide/debugger/guide_debugger.tscn" id="2_uet8a"] [ext_resource type="PackedScene" uid="uid://dkr80d2pi0d41" path="res://addons/guide/debugger/guide_debugger.tscn" id="2_uet8a"]
[ext_resource type="Texture2D" uid="uid://7kcmi16gedd0" path="res://assets/LD-0001.png" id="3_ruo5i"]
[ext_resource type="Script" uid="uid://cyh0d64pfygbl" path="res://addons/maaacks_game_template/base/scripts/pause_menu_controller.gd" id="7_ukfuy"] [ext_resource type="Script" uid="uid://cyh0d64pfygbl" path="res://addons/maaacks_game_template/base/scripts/pause_menu_controller.gd" id="7_ukfuy"]
[ext_resource type="PackedScene" uid="uid://ccqajqchiw4xu" path="res://menus/scenes/overlaid_menus/pause_menu.tscn" id="8_wctvs"] [ext_resource type="PackedScene" uid="uid://ccqajqchiw4xu" path="res://menus/scenes/overlaid_menus/pause_menu.tscn" id="8_wctvs"]
[ext_resource type="Resource" uid="uid://bl5crtu1gkrtr" path="res://systems/inputs/base_mode/base_mode.tres" id="9_eca4n"]
[ext_resource type="PackedScene" uid="uid://bkcsjsk2ciff" path="res://addons/maaacks_game_template/base/scenes/music_players/background_music_player.tscn" id="9_i2xii"] [ext_resource type="PackedScene" uid="uid://bkcsjsk2ciff" path="res://addons/maaacks_game_template/base/scenes/music_players/background_music_player.tscn" id="9_i2xii"]
[ext_resource type="Resource" uid="uid://dgluj0ql5vth7" path="res://systems/inputs/base_mode/pause.tres" id="10_0ari0"] [ext_resource type="Resource" uid="uid://dgluj0ql5vth7" path="res://systems/inputs/base_mode/pause.tres" id="10_0ari0"]
[ext_resource type="AudioStream" uid="uid://f8cvr5s041ej" path="res://assets/audio/ambiance/637083__nox_sound__ambiance_nature_night_cricket_calm_loop_stereo.wav" id="10_eca4n"] [ext_resource type="AudioStream" uid="uid://f8cvr5s041ej" path="res://assets/audio/ambiance/637083__nox_sound__ambiance_nature_night_cricket_calm_loop_stereo.wav" id="10_eca4n"]
@@ -26,6 +24,42 @@
[ext_resource type="Texture2D" uid="uid://nrhxjdpuje3f" path="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_lt_outline.svg" id="20_crf87"] [ext_resource type="Texture2D" uid="uid://nrhxjdpuje3f" path="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_lt_outline.svg" id="20_crf87"]
[ext_resource type="Texture2D" uid="uid://dyjvbsvbriii4" path="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_rb_outline.svg" id="23_p287n"] [ext_resource type="Texture2D" uid="uid://dyjvbsvbriii4" path="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_rb_outline.svg" id="23_p287n"]
[sub_resource type="LabelSettings" id="LabelSettings_2k3fr"]
font_size = 30
[sub_resource type="BoxShape3D" id="BoxShape3D_t0d86"]
size = Vector3(14, 15.5, 26)
[sub_resource type="BoxShape3D" id="BoxShape3D_p287n"]
size = Vector3(8.5, 16.5, 11.5)
[sub_resource type="BoxShape3D" id="BoxShape3D_5hbxb"]
size = Vector3(8, 13.5, 10)
[sub_resource type="BoxShape3D" id="BoxShape3D_6gj1x"]
size = Vector3(8, 13.5, 11.5)
[sub_resource type="BoxShape3D" id="BoxShape3D_x7fl1"]
size = Vector3(8.5, 38.5, 46.5)
[sub_resource type="BoxShape3D" id="BoxShape3D_3wccx"]
size = Vector3(12, 11.5, 5)
[sub_resource type="BoxShape3D" id="BoxShape3D_hmdts"]
size = Vector3(12, 13, 7)
[sub_resource type="BoxShape3D" id="BoxShape3D_lnjrw"]
size = Vector3(14, 10, 13.5)
[sub_resource type="BoxShape3D" id="BoxShape3D_3w3wd"]
size = Vector3(13, 16.5, 11.5)
[sub_resource type="BoxShape3D" id="BoxShape3D_lu3yt"]
size = Vector3(11.5, 9, 4.5)
[sub_resource type="BoxShape3D" id="BoxShape3D_pxspk"]
size = Vector3(11.5, 9, 4.5)
[sub_resource type="PanoramaSkyMaterial" id="PanoramaSkyMaterial_feb1n"] [sub_resource type="PanoramaSkyMaterial" id="PanoramaSkyMaterial_feb1n"]
panorama = ExtResource("2_ruo5i") panorama = ExtResource("2_ruo5i")
@@ -53,215 +87,20 @@ volumetric_fog_emission = Color(1, 1, 1, 1)
volumetric_fog_anisotropy = 0.6 volumetric_fog_anisotropy = 0.6
adjustment_enabled = true adjustment_enabled = true
[sub_resource type="BoxShape3D" id="BoxShape3D_t0d86"]
size = Vector3(14, 15.5, 26)
[sub_resource type="BoxShape3D" id="BoxShape3D_p287n"]
size = Vector3(8.5, 16.5, 11.5)
[sub_resource type="BoxShape3D" id="BoxShape3D_5hbxb"]
size = Vector3(8, 13.5, 10)
[sub_resource type="BoxShape3D" id="BoxShape3D_6gj1x"]
size = Vector3(8, 13.5, 11.5)
[sub_resource type="BoxShape3D" id="BoxShape3D_x7fl1"]
size = Vector3(8.5, 38.5, 46.5)
[sub_resource type="BoxShape3D" id="BoxShape3D_3wccx"]
size = Vector3(12, 11.5, 5)
[sub_resource type="BoxShape3D" id="BoxShape3D_hmdts"]
size = Vector3(12, 13, 7)
[sub_resource type="BoxShape3D" id="BoxShape3D_lnjrw"]
size = Vector3(14, 15.5, 13.5)
[sub_resource type="BoxShape3D" id="BoxShape3D_3w3wd"]
size = Vector3(13, 16.5, 11.5)
[sub_resource type="BoxShape3D" id="BoxShape3D_lu3yt"]
size = Vector3(11.5, 9, 4.5)
[sub_resource type="BoxShape3D" id="BoxShape3D_pxspk"]
size = Vector3(11.5, 9, 4.5)
[sub_resource type="LabelSettings" id="LabelSettings_2k3fr"]
font_size = 30
[sub_resource type="BoxMesh" id="BoxMesh_p287n"] [sub_resource type="BoxMesh" id="BoxMesh_p287n"]
[node name="Main" type="Node3D"] [node name="Main" type="Node3D"]
script = ExtResource("1_qwuk2") script = ExtResource("1_qwuk2")
[node name="Player" parent="." node_paths=PackedStringArray("TutorialWeaponTarget") instance=ExtResource("1_2vsi6")] [node name="BackgroundMusicPlayer" parent="." instance=ExtResource("9_i2xii")]
transform = Transform3D(0.054514527, 0, -0.9985129, 0, 1, 0, 0.9985129, 0, 0.054514527, -6, 75.5, -13.5) stream = ExtResource("10_eca4n")
collision_layer = 17
TutorialWeaponTarget = NodePath("../PlacedTutorialWeapon/WeaponLocationTarget")
TutorialDone = true
AccelerationAir = 1.5
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_1bvp3")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.78043425, 0.15240018, 0.60637933, 0.17673612, -0.8765135, 0.44775894, 0.5997381, 0.4566158, 0.6571267, 0, 0, 0)
light_color = Color(0.99999934, 0.76777613, 0.6549227, 1)
light_energy = 2.0
light_volumetric_fog_energy = 2.0
shadow_enabled = true
shadow_opacity = 0.95
shadow_blur = 2.435
[node name="DebugLayer" type="CanvasLayer" parent="."]
[node name="GuideDebugger" parent="DebugLayer" instance=ExtResource("2_uet8a")]
visible = false
[node name="Map" type="Sprite3D" parent="."]
transform = Transform3D(-3.278354e-07, -7.5, -3.278354e-08, 0, -3.278354e-07, 0.75, -7.5, 3.278354e-07, 1.4330142e-15, 7.1878185, 8.602432, -175.5159)
visible = false
texture = ExtResource("3_ruo5i")
[node name="Guard tower" parent="." instance=ExtResource("11_wctvs")]
transform = Transform3D(0.09033705, 0, 0.99591124, 0, 1, 0, -0.99591124, 0, 0.09033705, -4.6100636, 1.5, 0.5658741)
[node name="Water" parent="." instance=ExtResource("12_i2xii")]
transform = Transform3D(10000, 0, 0, 0, 1, 0, 0, 0, 10000, 0, 4.03932, -186.25941)
[node name="PauseMenuController" type="Node" parent="." node_paths=PackedStringArray("player")] [node name="PauseMenuController" type="Node" parent="." node_paths=PackedStringArray("player")]
script = ExtResource("7_ukfuy") script = ExtResource("7_ukfuy")
pause_menu_packed = ExtResource("8_wctvs") pause_menu_packed = ExtResource("8_wctvs")
player = NodePath("../Player") player = NodePath("../Player")
base_mode = ExtResource("9_eca4n")
pause = ExtResource("10_0ari0") pause = ExtResource("10_0ari0")
[node name="BackgroundMusicPlayer" parent="." instance=ExtResource("9_i2xii")]
stream = ExtResource("10_eca4n")
[node name="Lift" parent="." instance=ExtResource("13_eca4n")]
transform = Transform3D(0.9961947, 0, -0.08715573, 0, 1, 0, 0.08715573, 0, 0.9961947, -4.593, 1.618, 0.583)
end_location = Vector3(-4.593, 116.11, 0.583)
lift_time = 8.0
[node name="PlacedTutorialWeapon" type="MeshInstance3D" parent="."]
transform = Transform3D(-2, 3.019916e-07, 0, -3.019916e-07, -2, 0, 0, 0, 2, -17.904, -79.265, 145.317)
mesh = ExtResource("14_0ari0")
script = ExtResource("15_165wb")
[node name="SpotLight3D" type="SpotLight3D" parent="PlacedTutorialWeapon"]
transform = Transform3D(1, -1.509958e-07, 6.600236e-15, 0, -4.371139e-08, -1, 1.509958e-07, 1, -4.371139e-08, 0, -2.3931274, 0)
spot_range = 9.85
spot_attenuation = 0.46
spot_angle = 15.0
[node name="WeaponLocationTarget" type="Marker3D" parent="PlacedTutorialWeapon"]
[node name="TutoTriggers" type="Node3D" parent="."]
transform = Transform3D(0.054514527, 0, -0.9985129, 0, 1, 0, 0.9985129, 0, 0.054514527, -0.78573227, -132.74933, 116.65933)
[node name="TriggerTutoMove" type="Area3D" parent="TutoTriggers"]
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TriggerTutoMove"]
transform = Transform3D(0.9961947, 0, -0.087155946, 0, 1, 0, 0.087155946, 0, 0.9961947, 1.1144943, 6.5, 1.6032357)
shape = SubResource("BoxShape3D_t0d86")
[node name="TriggerTutoMantle" type="Area3D" parent="TutoTriggers"]
transform = Transform3D(0.9961947, 0, -0.087155744, 0, 1, 0, 0.087155744, 0, 0.9961947, -10.4557495, 0, -28.61254)
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TriggerTutoMantle"]
transform = Transform3D(0.9961947, 0, -0.08715595, 0, 1, 0, 0.08715595, 0, 0.9961947, 0.19611359, 7, -2.241436)
shape = SubResource("BoxShape3D_p287n")
[node name="TutoJump" parent="TutoTriggers" instance=ExtResource("16_qwuk2")]
transform = Transform3D(0.14133328, 0, 0.98996216, 0, 1, 0, -0.98996216, 0, 0.14133328, -0.32653046, 1.2493286, -50.374645)
first_input_texture = ExtResource("16_2k3fr")
second_input_texture = ExtResource("16_2k3fr")
tuto_text = "Double jump"
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TutoJump"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.49998856, 6.25, 3.499977)
shape = SubResource("BoxShape3D_5hbxb")
[node name="TutoDash" parent="TutoTriggers" instance=ExtResource("16_qwuk2")]
transform = Transform3D(0.14133328, 0, 0.98996216, 0, 1, 0, -0.98996216, 0, 0.14133328, 19.967693, 1.2493286, -47.47731)
first_input_texture = ExtResource("16_crf87")
second_input_texture = ExtResource("19_efsse")
tuto_text = "Dash"
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TutoDash"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.49999237, 6.25, 4.2500153)
shape = SubResource("BoxShape3D_6gj1x")
[node name="TriggerTutoWallJump" type="Area3D" parent="TutoTriggers"]
transform = Transform3D(0.9961947, 0, -0.087155744, 0, 1, 0, 0.087155744, 0, 0.9961947, 38.60766, 0, -28.437609)
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TriggerTutoWallJump"]
transform = Transform3D(0.9961947, 0, -0.08715595, 0, 1, 0, 0.08715595, 0, 0.9961947, -1.9546509, 20.75, 10.8709755)
shape = SubResource("BoxShape3D_x7fl1")
[node name="TriggerTutoWallJump2" type="Area3D" parent="TutoTriggers"]
transform = Transform3D(0.9961947, 0, -0.087155744, 0, 1, 0, 0.087155744, 0, 0.9961947, 15.983452, 0, 37.426994)
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TriggerTutoWallJump2"]
transform = Transform3D(0.9961947, 0, -0.08715595, 0, 1, 0, 0.08715595, 0, 0.9961947, 2.3256226, 21.75, 4.9715767)
shape = SubResource("BoxShape3D_3wccx")
[node name="TutoDash2" parent="TutoTriggers" instance=ExtResource("16_qwuk2")]
transform = Transform3D(0.14133325, 0, 0.98996216, 0, 1, 0, -0.98996216, 0, 0.14133325, 28.885735, 27.749329, 25.360323)
first_input_texture = ExtResource("16_crf87")
second_input_texture = ExtResource("19_efsse")
complex_input_text = "in air"
tuto_text = "Dash"
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TutoDash2"]
transform = Transform3D(1.0000031, 0, -4.917383e-07, 0, 1, 0, 4.917383e-07, 0, 1.0000031, 5.500023, 5, 0)
shape = SubResource("BoxShape3D_hmdts")
[node name="TriggerTutoWeaponThrow" type="Area3D" parent="TutoTriggers"]
transform = Transform3D(0.9961947, 0, -0.087155744, 0, 1, 0, 0.087155744, 0, 0.9961947, 4.428787, 58, 19.770819)
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TriggerTutoWeaponThrow"]
transform = Transform3D(0.9961947, 0, -0.08715595, 0, 1, 0, 0.08715595, 0, 0.9961947, 4.4208603, 7, -4.632329)
shape = SubResource("BoxShape3D_lnjrw")
[node name="TriggerTutoEnjoy" type="Area3D" parent="TutoTriggers"]
transform = Transform3D(0.9961947, 0, -0.087155744, 0, 1, 0, 0.087155744, 0, 0.9961947, -120.81145, 214.5, 2.417603)
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TriggerTutoEnjoy"]
transform = Transform3D(0.9961947, 0, -0.08715595, 0, 1, 0, 0.08715595, 0, 0.9961947, 3.9663503, 5.5, -5.174009)
shape = SubResource("BoxShape3D_3w3wd")
[node name="TutorialDoneArea" type="Area3D" parent="TutoTriggers"]
transform = Transform3D(0.14133324, 0, 0.98996216, 0, 1, 0, -0.98996216, 0, 0.14133324, 7.9436035, 53.74933, 16.672102)
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TutorialDoneArea"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.7500105, 4, 0.7499695)
shape = SubResource("BoxShape3D_lu3yt")
[node name="WeaponRetrieved" type="Area3D" parent="TutoTriggers"]
transform = Transform3D(0.14133324, 0, 0.98996216, 0, 1, 0, -0.98996216, 0, 0.14133324, 27.3601, 53.74933, 18.733648)
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/WeaponRetrieved"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.7500105, 4, 0.7499695)
shape = SubResource("BoxShape3D_pxspk")
[node name="TutorialController" type="Control" parent="."] [node name="TutorialController" type="Control" parent="."]
visible = false visible = false
layout_mode = 3 layout_mode = 3
@@ -270,6 +109,7 @@ anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
mouse_filter = 1
script = ExtResource("16_efsse") script = ExtResource("16_efsse")
tuto_got_sword_packed = ExtResource("17_t0d86") tuto_got_sword_packed = ExtResource("17_t0d86")
@@ -418,6 +258,158 @@ layout_mode = 2
text = "Enjoy this little playground!" text = "Enjoy this little playground!"
label_settings = SubResource("LabelSettings_2k3fr") label_settings = SubResource("LabelSettings_2k3fr")
[node name="TutoTriggers" type="Node3D" parent="."]
transform = Transform3D(0.054514527, 0, -0.9985129, 0, 1, 0, 0.9985129, 0, 0.054514527, -0.78573227, -132.74933, 116.65933)
[node name="TriggerTutoMove" type="Area3D" parent="TutoTriggers"]
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TriggerTutoMove"]
transform = Transform3D(0.9961947, 0, -0.087155946, 0, 1, 0, 0.087155946, 0, 0.9961947, 1.1144943, 6.5, 1.6032357)
shape = SubResource("BoxShape3D_t0d86")
[node name="TriggerTutoMantle" type="Area3D" parent="TutoTriggers"]
transform = Transform3D(0.9961947, 0, -0.087155744, 0, 1, 0, 0.087155744, 0, 0.9961947, -10.4557495, 0, -28.61254)
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TriggerTutoMantle"]
transform = Transform3D(0.9961947, 0, -0.08715595, 0, 1, 0, 0.08715595, 0, 0.9961947, 0.19611359, 7, -2.241436)
shape = SubResource("BoxShape3D_p287n")
[node name="TutoJump" parent="TutoTriggers" instance=ExtResource("16_qwuk2")]
transform = Transform3D(0.14133328, 0, 0.98996216, 0, 1, 0, -0.98996216, 0, 0.14133328, -0.32653046, 1.2493286, -50.374645)
first_input_texture = ExtResource("16_2k3fr")
second_input_texture = ExtResource("16_2k3fr")
tuto_text = "Double jump"
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TutoJump"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.49998856, 6.25, 3.499977)
shape = SubResource("BoxShape3D_5hbxb")
[node name="TutoDash" parent="TutoTriggers" instance=ExtResource("16_qwuk2")]
transform = Transform3D(0.14133328, 0, 0.98996216, 0, 1, 0, -0.98996216, 0, 0.14133328, 19.967693, 1.2493286, -47.47731)
first_input_texture = ExtResource("16_crf87")
second_input_texture = ExtResource("19_efsse")
tuto_text = "Dash"
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TutoDash"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.49999237, 6.25, 4.2500153)
shape = SubResource("BoxShape3D_6gj1x")
[node name="TriggerTutoWallJump" type="Area3D" parent="TutoTriggers"]
transform = Transform3D(0.9961947, 0, -0.087155744, 0, 1, 0, 0.087155744, 0, 0.9961947, 38.60766, 0, -28.437609)
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TriggerTutoWallJump"]
transform = Transform3D(0.9961947, 0, -0.08715595, 0, 1, 0, 0.08715595, 0, 0.9961947, -1.9546509, 20.75, 10.8709755)
shape = SubResource("BoxShape3D_x7fl1")
[node name="TriggerTutoWallJump2" type="Area3D" parent="TutoTriggers"]
transform = Transform3D(0.9961947, 0, -0.087155744, 0, 1, 0, 0.087155744, 0, 0.9961947, 15.983452, 0, 37.426994)
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TriggerTutoWallJump2"]
transform = Transform3D(0.9961947, 0, -0.08715595, 0, 1, 0, 0.08715595, 0, 0.9961947, 2.3256226, 21.75, 4.9715767)
shape = SubResource("BoxShape3D_3wccx")
[node name="TutoDash2" parent="TutoTriggers" instance=ExtResource("16_qwuk2")]
transform = Transform3D(0.14133325, 0, 0.98996216, 0, 1, 0, -0.98996216, 0, 0.14133325, 28.885735, 27.749329, 25.360323)
first_input_texture = ExtResource("19_efsse")
complex_input_text = "against wall"
tuto_text = "Wall run"
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TutoDash2"]
transform = Transform3D(1.0000031, 0, -4.917383e-07, 0, 1, 0, 4.917383e-07, 0, 1.0000031, 5.500023, 5, 0)
shape = SubResource("BoxShape3D_hmdts")
[node name="TriggerTutoWeaponThrow" type="Area3D" parent="TutoTriggers"]
transform = Transform3D(0.9961947, 0, -0.087155744, 0, 1, 0, 0.087155744, 0, 0.9961947, 4.428787, 58, 19.770819)
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TriggerTutoWeaponThrow"]
transform = Transform3D(0.9961947, 0, -0.08715595, 0, 1, 0, 0.08715595, 0, 0.9961947, 4.4208603, 9.75, -4.632329)
shape = SubResource("BoxShape3D_lnjrw")
[node name="TriggerTutoEnjoy" type="Area3D" parent="TutoTriggers"]
transform = Transform3D(0.9961947, 0, -0.087155744, 0, 1, 0, 0.087155744, 0, 0.9961947, -120.81145, 214.5, 2.417603)
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TriggerTutoEnjoy"]
transform = Transform3D(0.9961947, 0, -0.08715595, 0, 1, 0, 0.08715595, 0, 0.9961947, 3.9663503, 5.5, -5.174009)
shape = SubResource("BoxShape3D_3w3wd")
[node name="TutorialDoneArea" type="Area3D" parent="TutoTriggers"]
transform = Transform3D(0.14133324, 0, 0.98996216, 0, 1, 0, -0.98996216, 0, 0.14133324, 7.9436035, 53.74933, 16.672102)
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TutorialDoneArea"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.7500105, 4, 0.7499695)
shape = SubResource("BoxShape3D_lu3yt")
[node name="WeaponRetrieved" type="Area3D" parent="TutoTriggers"]
transform = Transform3D(0.14133324, 0, 0.98996216, 0, 1, 0, -0.98996216, 0, 0.14133324, 27.3601, 53.74933, 18.733648)
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/WeaponRetrieved"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.7500105, 4, 0.7499695)
shape = SubResource("BoxShape3D_pxspk")
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_1bvp3")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.7804346, 0.15240021, 0.60637945, 0.1767362, -0.87651366, 0.4477591, 0.5997384, 0.4566159, 0.6571269, 0, 0, 0)
light_color = Color(0.99999934, 0.76777613, 0.6549227, 1)
light_energy = 2.0
light_volumetric_fog_energy = 2.0
shadow_enabled = true
shadow_opacity = 0.95
shadow_blur = 2.435
[node name="Player" parent="." node_paths=PackedStringArray("TutorialWeaponTarget") instance=ExtResource("1_2vsi6")]
transform = Transform3D(0.054514527, 0, -0.9985129, 0, 1, 0, 0.9985129, 0, 0.054514527, -6, 75.5, -13.5)
collision_layer = 17
TutorialWeaponTarget = NodePath("../PlacedTutorialWeapon/WeaponLocationTarget")
TutorialDone = true
AccelerationAir = 1.5
[node name="DebugLayer" type="CanvasLayer" parent="."]
[node name="GuideDebugger" parent="DebugLayer" instance=ExtResource("2_uet8a")]
visible = false
[node name="Guard tower" parent="." instance=ExtResource("11_wctvs")]
transform = Transform3D(0.09033705, 0, 0.99591124, 0, 1, 0, -0.99591124, 0, 0.09033705, -4.6100636, 1.5, 0.5658741)
[node name="Water" parent="." instance=ExtResource("12_i2xii")]
transform = Transform3D(10000, 0, 0, 0, 1, 0, 0, 0, 10000, 0, 4.03932, -186.25941)
[node name="Lift" parent="." instance=ExtResource("13_eca4n")]
transform = Transform3D(0.9961947, 0, -0.08715573, 0, 1, 0, 0.08715573, 0, 0.9961947, -4.593, 1.618, 0.583)
end_location = Vector3(-4.593, 116.11, 0.583)
lift_time = 8.0
[node name="PlacedTutorialWeapon" type="MeshInstance3D" parent="."]
transform = Transform3D(-2, 3.019916e-07, 0, -3.019916e-07, -2, 0, 0, 0, 2, -17.904, -79.265, 145.317)
mesh = ExtResource("14_0ari0")
script = ExtResource("15_165wb")
[node name="SpotLight3D" type="SpotLight3D" parent="PlacedTutorialWeapon"]
transform = Transform3D(1, -1.509958e-07, 6.600236e-15, 0, -4.371139e-08, -1, 1.509958e-07, 1, -4.371139e-08, 0, -2.3931274, 0)
spot_range = 9.85
spot_attenuation = 0.46
spot_angle = 15.0
[node name="WeaponLocationTarget" type="Marker3D" parent="PlacedTutorialWeapon"]
[node name="LightLeakBlockers" type="Node3D" parent="."] [node name="LightLeakBlockers" type="Node3D" parent="."]
[node name="MeshInstance3D" type="MeshInstance3D" parent="LightLeakBlockers"] [node name="MeshInstance3D" type="MeshInstance3D" parent="LightLeakBlockers"]
@@ -444,6 +436,7 @@ spot_range = 47.233
spot_angle = 18.85 spot_angle = 18.85
spot_angle_attenuation = 10.556052 spot_angle_attenuation = 10.556052
[connection signal="timeout" from="TutorialController/WaitToShowBlockingTuto" to="TutorialController" method="_show_weapon_tutorial"]
[connection signal="body_exited" from="TutoTriggers/TriggerTutoMove" to="TutorialController" method="hide_tutorials"] [connection signal="body_exited" from="TutoTriggers/TriggerTutoMove" to="TutorialController" method="hide_tutorials"]
[connection signal="body_entered" from="TutoTriggers/TriggerTutoMantle" to="TutorialController" method="_on_tuto_mantle_body_entered"] [connection signal="body_entered" from="TutoTriggers/TriggerTutoMantle" to="TutorialController" method="_on_tuto_mantle_body_entered"]
[connection signal="body_exited" from="TutoTriggers/TriggerTutoMantle" to="TutorialController" method="hide_tutorials"] [connection signal="body_exited" from="TutoTriggers/TriggerTutoMantle" to="TutorialController" method="hide_tutorials"]
@@ -455,9 +448,8 @@ spot_angle_attenuation = 10.556052
[connection signal="body_exited" from="TutoTriggers/TriggerTutoWeaponThrow" to="TutorialController" method="hide_tutorials"] [connection signal="body_exited" from="TutoTriggers/TriggerTutoWeaponThrow" to="TutorialController" method="hide_tutorials"]
[connection signal="body_entered" from="TutoTriggers/TriggerTutoEnjoy" to="TutorialController" method="_on_tuto_enjoy_body_entered"] [connection signal="body_entered" from="TutoTriggers/TriggerTutoEnjoy" to="TutorialController" method="_on_tuto_enjoy_body_entered"]
[connection signal="body_exited" from="TutoTriggers/TriggerTutoEnjoy" to="TutorialController" method="hide_tutorials"] [connection signal="body_exited" from="TutoTriggers/TriggerTutoEnjoy" to="TutorialController" method="hide_tutorials"]
[connection signal="body_entered" from="TutoTriggers/TutorialDoneArea" to="Player" method="OnTutorialDone"]
[connection signal="body_entered" from="TutoTriggers/TutorialDoneArea" to="TutorialController" method="_on_tuto_done_area_body_entered"] [connection signal="body_entered" from="TutoTriggers/TutorialDoneArea" to="TutorialController" method="_on_tuto_done_area_body_entered"]
[connection signal="body_entered" from="TutoTriggers/TutorialDoneArea" to="Player" method="OnTutorialDone"]
[connection signal="body_exited" from="TutoTriggers/TutorialDoneArea" to="TutorialController" method="hide_tutorials"] [connection signal="body_exited" from="TutoTriggers/TutorialDoneArea" to="TutorialController" method="hide_tutorials"]
[connection signal="body_entered" from="TutoTriggers/WeaponRetrieved" to="PlacedTutorialWeapon" method="_on_weapon_retrieved_body_entered"]
[connection signal="body_entered" from="TutoTriggers/WeaponRetrieved" to="TutorialController" method="_on_weapon_retrieved_body_entered"] [connection signal="body_entered" from="TutoTriggers/WeaponRetrieved" to="TutorialController" method="_on_weapon_retrieved_body_entered"]
[connection signal="timeout" from="TutorialController/WaitToShowBlockingTuto" to="TutorialController" method="_show_weapon_tutorial"] [connection signal="body_entered" from="TutoTriggers/WeaponRetrieved" to="PlacedTutorialWeapon" method="_on_weapon_retrieved_body_entered"]

View File

@@ -1,8 +1,10 @@
[gd_scene load_steps=17 format=3 uid="uid://vm22i5sv3p3s"] [gd_scene load_steps=19 format=3 uid="uid://vm22i5sv3p3s"]
[ext_resource type="PackedScene" uid="uid://c6k5nnpbypshi" path="res://addons/maaacks_game_template/base/scenes/menus/main_menu/main_menu.tscn" id="1_my8ii"] [ext_resource type="PackedScene" uid="uid://c6k5nnpbypshi" path="res://addons/maaacks_game_template/base/scenes/menus/main_menu/main_menu.tscn" id="1_my8ii"]
[ext_resource type="Script" uid="uid://c0ntfmiuw4ttg" path="res://menus/scenes/menus/main_menu/main_menu_with_animations.gd" id="2_nyjay"] [ext_resource type="Script" uid="uid://c0ntfmiuw4ttg" path="res://menus/scenes/menus/main_menu/main_menu_with_animations.gd" id="2_nyjay"]
[ext_resource type="AudioStream" uid="uid://f8cvr5s041ej" path="res://assets/audio/ambiance/637083__nox_sound__ambiance_nature_night_cricket_calm_loop_stereo.wav" id="3_tvvjd"] [ext_resource type="AudioStream" uid="uid://f8cvr5s041ej" path="res://assets/audio/ambiance/637083__nox_sound__ambiance_nature_night_cricket_calm_loop_stereo.wav" id="3_tvvjd"]
[ext_resource type="Resource" uid="uid://c2hpxkcujyc13" path="res://systems/inputs/menu_mode/menu_mode.tres" id="3_ytpwg"]
[ext_resource type="Resource" uid="uid://ck43v3q5ype3f" path="res://systems/inputs/menu_mode/back.tres" id="4_8i6b8"]
[sub_resource type="Animation" id="1"] [sub_resource type="Animation" id="1"]
resource_name = "Intro" resource_name = "Intro"
@@ -352,6 +354,8 @@ graph_offset = Vector2(-180.277, 49)
script = ExtResource("2_nyjay") script = ExtResource("2_nyjay")
level_select_packed_scene = null level_select_packed_scene = null
game_scene_path = "uid://dmkw8cmalm5k" game_scene_path = "uid://dmkw8cmalm5k"
menu_context = ExtResource("3_ytpwg")
back_action = ExtResource("4_8i6b8")
[node name="MenuAnimationPlayer" type="AnimationPlayer" parent="." index="1"] [node name="MenuAnimationPlayer" type="AnimationPlayer" parent="." index="1"]
libraries = { libraries = {

View File

@@ -1,7 +1,9 @@
[gd_scene load_steps=3 format=3 uid="uid://dim045la3mijk"] [gd_scene load_steps=4 format=3 uid="uid://dim045la3mijk"]
[ext_resource type="PackedScene" uid="uid://cikf3o5omnunl" path="res://addons/maaacks_game_template/base/scenes/overlaid_menu/menus/mini_options_overlaid_menu.tscn" id="1_5piya"] [ext_resource type="PackedScene" uid="uid://cikf3o5omnunl" path="res://addons/maaacks_game_template/base/scenes/overlaid_menu/menus/mini_options_overlaid_menu.tscn" id="1_5piya"]
[ext_resource type="PackedScene" uid="uid://foajscu2dqkk" path="res://menus/scenes/menus/options_menu/mini_options_menu_with_reset.tscn" id="2_3u5po"] [ext_resource type="PackedScene" uid="uid://foajscu2dqkk" path="res://menus/scenes/menus/options_menu/mini_options_menu_with_reset.tscn" id="2_3u5po"]
[ext_resource type="Resource" uid="uid://ck43v3q5ype3f" path="res://systems/inputs/menu_mode/back.tres" id="3_i7tty"]
[node name="MiniOptionsOverlaidMenu" instance=ExtResource("1_5piya")] [node name="MiniOptionsOverlaidMenu" instance=ExtResource("1_5piya")]
menu_scene = ExtResource("2_3u5po") menu_scene = ExtResource("2_3u5po")
back_action = ExtResource("3_i7tty")

View File

@@ -1,15 +1,18 @@
[gd_scene load_steps=5 format=3 uid="uid://ccqajqchiw4xu"] [gd_scene load_steps=6 format=3 uid="uid://ccqajqchiw4xu"]
[ext_resource type="PackedScene" uid="uid://b5cd6sa8qq4vc" path="res://addons/maaacks_game_template/base/scenes/overlaid_menu/menus/pause_menu.tscn" id="1_0paax"] [ext_resource type="PackedScene" uid="uid://b5cd6sa8qq4vc" path="res://addons/maaacks_game_template/base/scenes/overlaid_menu/menus/pause_menu.tscn" id="1_0paax"]
[ext_resource type="Script" uid="uid://bwvomv4eww4fg" path="res://menus/scenes/overlaid_menus/pause_menu.gd" id="2_ek1hy"] [ext_resource type="Script" uid="uid://bwvomv4eww4fg" path="res://menus/scenes/overlaid_menus/pause_menu.gd" id="2_ek1hy"]
[ext_resource type="PackedScene" uid="uid://dim045la3mijk" path="res://menus/scenes/overlaid_menus/mini_options_overlaid_menu.tscn" id="3_e0t2r"] [ext_resource type="PackedScene" uid="uid://dim045la3mijk" path="res://menus/scenes/overlaid_menus/mini_options_overlaid_menu.tscn" id="3_e0t2r"]
[ext_resource type="Resource" uid="uid://c2hpxkcujyc13" path="res://systems/inputs/menu_mode/menu_mode.tres" id="4_nfx08"] [ext_resource type="Resource" uid="uid://c2hpxkcujyc13" path="res://systems/inputs/menu_mode/menu_mode.tres" id="4_nfx08"]
[ext_resource type="Resource" uid="uid://ck43v3q5ype3f" path="res://systems/inputs/menu_mode/back.tres" id="5_su1bt"]
[node name="PauseMenu" instance=ExtResource("1_0paax")] [node name="PauseMenu" instance=ExtResource("1_0paax")]
top_level = true
script = ExtResource("2_ek1hy") script = ExtResource("2_ek1hy")
options_packed_scene = ExtResource("3_e0t2r") options_packed_scene = ExtResource("3_e0t2r")
main_menu_scene = "res://menus/scenes/menus/main_menu/main_menu_with_animations.tscn" main_menu_scene = "res://menus/scenes/menus/main_menu/main_menu_with_animations.tscn"
menu_context = ExtResource("4_nfx08") menu_context = ExtResource("4_nfx08")
back_action = ExtResource("5_su1bt")
[connection signal="tree_entered" from="." to="." method="on_enter_tree"] [connection signal="tree_entered" from="." to="." method="on_enter_tree"]
[connection signal="tree_exited" from="." to="." method="on_exit_tree"] [connection signal="tree_exited" from="." to="." method="on_exit_tree"]

View File

@@ -20,7 +20,6 @@ static func get_level_state(level_state_key : String) -> LevelState:
return new_level_state return new_level_state
static func has_game_state() -> bool: static func has_game_state() -> bool:
return false
return GlobalState.has_state(STATE_NAME) return GlobalState.has_state(STATE_NAME)
static func get_game_state() -> GameState: static func get_game_state() -> GameState:

View File

@@ -1,12 +1,11 @@
[gd_scene load_steps=49 format=3 uid="uid://bei4nhkf8lwdo"] [gd_scene load_steps=48 format=3 uid="uid://bei4nhkf8lwdo"]
[ext_resource type="Script" uid="uid://bbbrf5ckydfna" path="res://player_controller/Scripts/PlayerController.cs" id="1_poq2x"] [ext_resource type="Script" uid="uid://bbbrf5ckydfna" path="res://player_controller/Scripts/PlayerController.cs" id="1_poq2x"]
[ext_resource type="PackedScene" uid="uid://cf3rrgr1imvv4" path="res://scenes/path/path.tscn" id="2_6lejt"]
[ext_resource type="Resource" uid="uid://bl5crtu1gkrtr" path="res://systems/inputs/base_mode/base_mode.tres" id="3_cresl"] [ext_resource type="Resource" uid="uid://bl5crtu1gkrtr" path="res://systems/inputs/base_mode/base_mode.tres" id="3_cresl"]
[ext_resource type="Resource" uid="uid://cpdaw41ah5gic" path="res://systems/inputs/base_mode/rotate_y.tres" id="4_rxwoh"] [ext_resource type="Resource" uid="uid://cpdaw41ah5gic" path="res://systems/inputs/base_mode/rotate_y.tres" id="4_rxwoh"]
[ext_resource type="Resource" uid="uid://ccrb5xsnphc8" path="res://systems/inputs/base_mode/rotate_floorplane.tres" id="5_4u7i3"] [ext_resource type="Resource" uid="uid://ccrb5xsnphc8" path="res://systems/inputs/base_mode/rotate_floorplane.tres" id="5_4u7i3"]
[ext_resource type="Resource" uid="uid://f3vs6l4m623s" path="res://systems/inputs/base_mode/move_left.tres" id="5_q14ux"] [ext_resource type="Resource" uid="uid://f3vs6l4m623s" path="res://systems/inputs/base_mode/move_left.tres" id="5_q14ux"]
[ext_resource type="Script" uid="uid://dv7v1ywmbvvcd" path="res://player_controller/Scripts/HealthSystem.cs" id="5_umw0l"]
[ext_resource type="Script" uid="uid://vuq8rjq3vegn" path="res://player_controller/Scripts/Stamina.cs" id="6_lxtc4"]
[ext_resource type="Resource" uid="uid://t612lts1wi1s" path="res://systems/inputs/base_mode/move_right.tres" id="6_q7bng"] [ext_resource type="Resource" uid="uid://t612lts1wi1s" path="res://systems/inputs/base_mode/move_right.tres" id="6_q7bng"]
[ext_resource type="Script" uid="uid://cwbvxlfvmocc1" path="res://player_controller/Scripts/StairsSystem.cs" id="7_bmt5a"] [ext_resource type="Script" uid="uid://cwbvxlfvmocc1" path="res://player_controller/Scripts/StairsSystem.cs" id="7_bmt5a"]
[ext_resource type="Resource" uid="uid://brswsknpgwal2" path="res://systems/inputs/base_mode/move_front.tres" id="7_m8gvy"] [ext_resource type="Resource" uid="uid://brswsknpgwal2" path="res://systems/inputs/base_mode/move_front.tres" id="7_m8gvy"]
@@ -64,20 +63,23 @@ blend_mode = 1
[node name="Player" type="CharacterBody3D"] [node name="Player" type="CharacterBody3D"]
script = ExtResource("1_poq2x") script = ExtResource("1_poq2x")
WalkSpeed = 7.5 WalkSpeed = 7.5
AccelerationAir = 2.0 AccelerationAir = 0.8
DecelerationAir = 0.1 DecelerationAir = 0.02
Weight = 5.0 Weight = 4.0
MantleTime = 0.3 MantlePath = ExtResource("2_6lejt")
SimpleJumpStartVelocity = 8.0 MantleDashStrength = 20.0
MantleJumpStartVelocity = 13.0
CoyoteTime = 0.3
InputBufferFrames = 5
SimpleJumpStartVelocity = 6.0
SimpleJumpHangTimeInFrames = 1 SimpleJumpHangTimeInFrames = 1
SimpleJumpGravityLesseningFactor = 2.5 SimpleJumpGravityLesseningFactor = 2.0
DoubleJumpStartVelocity = 15.0
DoubleJumpHangTimeInFrames = 3 DoubleJumpHangTimeInFrames = 3
DoubleJumpGravityLesseningFactor = 1.5 DoubleJumpGravityLesseningFactor = 1.5
MegaJumpStartVelocity = 30.0 MegaJumpStartVelocity = 30.0
MegaJumpHangTimeInFrames = 12 MegaJumpHangTimeInFrames = 12
MegaJumpGravityLesseningFactor = 1.2 MegaJumpGravityLesseningFactor = 1.2
WallJumpStartVelocity = 12.0 WallJumpStartVelocity = 8.0
MaxNumberOfEmpoweredActions = 3 MaxNumberOfEmpoweredActions = 3
SimpleDashStrength = 15.0 SimpleDashStrength = 15.0
PoweredDashStrength = 30.0 PoweredDashStrength = 30.0
@@ -86,6 +88,14 @@ PostDashSpeed = 30.0
WallHugGravityLesseningFactor = 15.0 WallHugGravityLesseningFactor = 15.0
WallHugDownwardMaxSpeed = 8.0 WallHugDownwardMaxSpeed = 8.0
WallHugHorizontalDeceleration = 0.5 WallHugHorizontalDeceleration = 0.5
WallRunAltitudeLossSpeed = 12.0
WallRunSpeedThreshold = 10.0
[node name="WallRunSnapper" type="RayCast3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(0.99999994, 0, 0, 0, 1, 0, 0, 0, 0.99999994, 0, 0, 0)
target_position = Vector3(0, 0, -5)
collision_mask = 2
[node name="InputController" type="Node3D" parent="."] [node name="InputController" type="Node3D" parent="."]
script = ExtResource("16_v31n3") script = ExtResource("16_v31n3")
@@ -123,12 +133,13 @@ CapsuleDefaultHeight = 1.7
[node name="HeadSystem" parent="." instance=ExtResource("11_rxwoh")] [node name="HeadSystem" parent="." instance=ExtResource("11_rxwoh")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6, 0)
CameraInclineAcceleration = 20.0
GroundedCameraIncline = 3.0
[node name="HealthSystem" type="Node3D" parent="."] [node name="MantleSystem" parent="HeadSystem" instance=ExtResource("8_qu4wy")]
script = ExtResource("5_umw0l") transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.6, 0)
MantleEndLocationDistanceFromWall = 0.3
[node name="Stamina" type="Node3D" parent="."] MantleHeightCastStart = 2.5
script = ExtResource("6_lxtc4")
[node name="StairsSystem" type="Node3D" parent="."] [node name="StairsSystem" type="Node3D" parent="."]
script = ExtResource("7_bmt5a") script = ExtResource("7_bmt5a")
@@ -140,10 +151,6 @@ target_position = Vector3(0, -0.55, 0)
[node name="StairsBelowRayCast3D" type="RayCast3D" parent="."] [node name="StairsBelowRayCast3D" type="RayCast3D" parent="."]
target_position = Vector3(0, -0.75, 0) target_position = Vector3(0, -0.75, 0)
[node name="MantleSystem" parent="." instance=ExtResource("8_qu4wy")]
MantleEndLocationDistanceFromWall = 0.3
MantleHeightCastStart = 2.0
[node name="Bobbing" type="Node3D" parent="."] [node name="Bobbing" type="Node3D" parent="."]
script = ExtResource("10_7wk1w") script = ExtResource("10_7wk1w")
@@ -151,6 +158,7 @@ script = ExtResource("10_7wk1w")
script = ExtResource("12_m2mxi") script = ExtResource("12_m2mxi")
[node name="HeadCollisionDetectors" type="Node3D" parent="."] [node name="HeadCollisionDetectors" type="Node3D" parent="."]
visible = false
[node name="HeadCollisionDetector0" type="RayCast3D" parent="HeadCollisionDetectors"] [node name="HeadCollisionDetector0" type="RayCast3D" parent="HeadCollisionDetectors"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.4, -0.210707) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.4, -0.210707)
@@ -171,7 +179,7 @@ target_position = Vector3(0, 1, 0)
[node name="TweenQueueSystem" parent="." instance=ExtResource("22_rpwev")] [node name="TweenQueueSystem" parent="." instance=ExtResource("22_rpwev")]
[node name="WallHugSystem" type="Node3D" parent="."] [node name="WallHugSystem" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) visible = false
script = ExtResource("27_n7qhm") script = ExtResource("27_n7qhm")
[node name="back" type="RayCast3D" parent="WallHugSystem"] [node name="back" type="RayCast3D" parent="WallHugSystem"]
@@ -229,6 +237,11 @@ transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 0, 0
mesh = SubResource("CylinderMesh_nodcl") mesh = SubResource("CylinderMesh_nodcl")
[node name="DashCooldown" type="Timer" parent="."] [node name="DashCooldown" type="Timer" parent="."]
wait_time = 0.8
one_shot = true
[node name="AirborneDashCooldown" type="Timer" parent="."]
wait_time = 0.5
one_shot = true one_shot = true
[node name="PowerCooldown" type="Timer" parent="."] [node name="PowerCooldown" type="Timer" parent="."]
@@ -241,23 +254,31 @@ one_shot = true
ignore_time_scale = true ignore_time_scale = true
[node name="StateChartDebugger" parent="." instance=ExtResource("24_q5h8a")] [node name="StateChartDebugger" parent="." instance=ExtResource("24_q5h8a")]
visible = false
offset_left = 1524.0 offset_left = 1524.0
offset_top = 1.0 offset_top = 1.0
offset_right = -8.0 offset_right = -8.0
offset_bottom = 1.0 offset_bottom = 1.0
enabled = false
initial_node_to_watch = NodePath("../StateChart") initial_node_to_watch = NodePath("../StateChart")
[node name="UI" type="CanvasLayer" parent="."] [node name="UI" type="Control" parent="."]
script = ExtResource("30_2ghaa") visible = false
layout_mode = 3
[node name="MarginContainer" type="MarginContainer" parent="UI"]
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
mouse_filter = 1
script = ExtResource("30_2ghaa")
[node name="MarginContainer" type="MarginContainer" parent="UI"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme_override_constants/margin_left = 50 theme_override_constants/margin_left = 50
theme_override_constants/margin_top = 50 theme_override_constants/margin_top = 50
theme_override_constants/margin_right = 50 theme_override_constants/margin_right = 50
@@ -296,12 +317,14 @@ expand_mode = 2
[node name="CenterContainer" type="CenterContainer" parent="UI"] [node name="CenterContainer" type="CenterContainer" parent="UI"]
custom_minimum_size = Vector2(1920, 1080) custom_minimum_size = Vector2(1920, 1080)
layout_mode = 1
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
offset_right = -1.0 offset_right = -1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
mouse_filter = 2
[node name="CenterIcon" type="TextureRect" parent="UI/CenterContainer"] [node name="CenterIcon" type="TextureRect" parent="UI/CenterContainer"]
material = SubResource("CanvasItemMaterial_2q0ik") material = SubResource("CanvasItemMaterial_2q0ik")
@@ -311,11 +334,13 @@ texture = ExtResource("32_lgpc8")
expand_mode = 1 expand_mode = 1
[node name="CenterContainer2" type="CenterContainer" parent="UI"] [node name="CenterContainer2" type="CenterContainer" parent="UI"]
layout_mode = 1
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
mouse_filter = 2
[node name="MarginContainer" type="MarginContainer" parent="UI/CenterContainer2"] [node name="MarginContainer" type="MarginContainer" parent="UI/CenterContainer2"]
layout_mode = 2 layout_mode = 2
@@ -482,49 +507,55 @@ to = NodePath("../../Grounded")
event = &"grounded" event = &"grounded"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="OnMantleOtherSide" type="Node" parent="StateChart/Root/Movement/Mantling"]
script = ExtResource("28_n7qhm")
to = NodePath("../../OnWall/Hugging")
event = &"on_wall"
delay_in_seconds = "0.0"
[node name="Jump" type="Node" parent="StateChart/Root/Movement"] [node name="Jump" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("26_infe6") script = ExtResource("26_infe6")
initial_state = NodePath("SimpleJump") initial_state = NodePath("SimpleJump")
[node name="OnMantle" type="Node" parent="StateChart/Root/Movement/Jump"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Mantling")
event = &"mantle"
delay_in_seconds = "0.0"
[node name="SimpleJump" type="Node" parent="StateChart/Root/Movement/Jump"] [node name="SimpleJump" type="Node" parent="StateChart/Root/Movement/Jump"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/Jump/SimpleJump"]
script = ExtResource("28_n7qhm")
to = NodePath("../../MegaJump")
event = &"megajump"
delay_in_seconds = "0.0"
[node name="OnJumpEnded" type="Node" parent="StateChart/Root/Movement/Jump/SimpleJump"] [node name="OnJumpEnded" type="Node" parent="StateChart/Root/Movement/Jump/SimpleJump"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../../Airborne/DoubleJumpEnabled") to = NodePath("../../../Airborne/DoubleJumpEnabled")
event = &"jump_ended" event = &"jump_ended"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="DoubleJump" type="Node" parent="StateChart/Root/Movement/Jump"] [node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/Jump/SimpleJump"]
script = ExtResource("27_34snm")
[node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/Jump/DoubleJump"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../MegaJump") to = NodePath("../../MegaJump")
event = &"megajump" event = &"megajump"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="DoubleJump" type="Node" parent="StateChart/Root/Movement/Jump"]
script = ExtResource("27_34snm")
[node name="OnJumpEnded" type="Node" parent="StateChart/Root/Movement/Jump/DoubleJump"] [node name="OnJumpEnded" type="Node" parent="StateChart/Root/Movement/Jump/DoubleJump"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../../Airborne/Falling") to = NodePath("../../../Airborne/Falling")
event = &"jump_ended" event = &"jump_ended"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/Jump/DoubleJump"]
script = ExtResource("28_n7qhm")
to = NodePath("../../MegaJump")
event = &"megajump"
delay_in_seconds = "0.0"
[node name="MegaJump" type="Node" parent="StateChart/Root/Movement/Jump"] [node name="MegaJump" type="Node" parent="StateChart/Root/Movement/Jump"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="OnJumpEnded" type="Node" parent="StateChart/Root/Movement/Jump/MegaJump"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../Airborne/Falling")
event = &"jump_ended"
delay_in_seconds = "0.0"
[node name="Dashing" type="Node" parent="StateChart/Root/Movement"] [node name="Dashing" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("26_infe6") script = ExtResource("26_infe6")
initial_state = NodePath("Dash") initial_state = NodePath("Dash")
@@ -588,12 +619,6 @@ initial_state = NodePath("CoyoteEnabled")
script = ExtResource("41_ruloh") script = ExtResource("41_ruloh")
default_state = NodePath("../CoyoteEnabled") default_state = NodePath("../CoyoteEnabled")
[node name="OnWallHug" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("28_n7qhm")
to = NodePath("../../OnWall/Hugging")
event = &"wall_hug"
delay_in_seconds = "0.0"
[node name="OnWallRun" type="Node" parent="StateChart/Root/Movement/Airborne"] [node name="OnWallRun" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../OnWall/Running") to = NodePath("../../OnWall/Running")
@@ -636,6 +661,12 @@ delay_in_seconds = "0.0"
[node name="DoubleJumpEnabled" type="Node" parent="StateChart/Root/Movement/Airborne"] [node name="DoubleJumpEnabled" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="OnWallHug" type="Node" parent="StateChart/Root/Movement/Airborne/DoubleJumpEnabled"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../OnWall/HuggingCoyoteEnabled")
event = &"wall_hug"
delay_in_seconds = "0.0"
[node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/Airborne/DoubleJumpEnabled"] [node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/Airborne/DoubleJumpEnabled"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../../Jump/MegaJump") to = NodePath("../../../Jump/MegaJump")
@@ -651,6 +682,12 @@ delay_in_seconds = "0.0"
[node name="Falling" type="Node" parent="StateChart/Root/Movement/Airborne"] [node name="Falling" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="OnWallHug" type="Node" parent="StateChart/Root/Movement/Airborne/Falling"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../OnWall/Hugging")
event = &"wall_hug"
delay_in_seconds = "0.0"
[node name="ToDoubleJump" type="Node" parent="StateChart/Root/Movement/Airborne/Falling"] [node name="ToDoubleJump" type="Node" parent="StateChart/Root/Movement/Airborne/Falling"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../DoubleJumpEnabled") to = NodePath("../../DoubleJumpEnabled")
@@ -673,12 +710,6 @@ to = NodePath("../../Grounded")
event = &"grounded" event = &"grounded"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/OnWall"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Jump/SimpleJump")
event = &"jump"
delay_in_seconds = "0.0"
[node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/OnWall"] [node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/OnWall"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../Jump/MegaJump") to = NodePath("../../Jump/MegaJump")
@@ -691,15 +722,81 @@ to = NodePath("../../Airborne/Reset")
event = &"start_falling" event = &"start_falling"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="OnMantle" type="Node" parent="StateChart/Root/Movement/OnWall"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Mantling")
event = &"mantle"
delay_in_seconds = "0.0"
[node name="HuggingCoyoteEnabled" type="Node" parent="StateChart/Root/Movement/OnWall"]
script = ExtResource("27_34snm")
[node name="OnExpiration" type="Node" parent="StateChart/Root/Movement/OnWall/HuggingCoyoteEnabled"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Hugging")
event = &"coyote_expired"
delay_in_seconds = "0.0"
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/OnWall/HuggingCoyoteEnabled"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../Jump/DoubleJump")
event = &"jump"
delay_in_seconds = "0.0"
[node name="Hugging" type="Node" parent="StateChart/Root/Movement/OnWall"] [node name="Hugging" type="Node" parent="StateChart/Root/Movement/OnWall"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/OnWall/Hugging"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../Jump/DoubleJump")
event = &"jump"
delay_in_seconds = "0.0"
[node name="Hanging" type="Node" parent="StateChart/Root/Movement/OnWall"] [node name="Hanging" type="Node" parent="StateChart/Root/Movement/OnWall"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/OnWall/Hanging"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../Jump/DoubleJump")
event = &"jump"
delay_in_seconds = "0.0"
[node name="RunningCoyoteEnabled" type="Node" parent="StateChart/Root/Movement/OnWall"]
script = ExtResource("27_34snm")
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/OnWall/RunningCoyoteEnabled"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../Jump/DoubleJump")
event = &"jump"
delay_in_seconds = "0.0"
[node name="OnExpiration" type="Node" parent="StateChart/Root/Movement/OnWall/RunningCoyoteEnabled"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Running")
event = &"coyote_expired"
delay_in_seconds = "0.0"
[node name="OnLeaveWall" type="Node" parent="StateChart/Root/Movement/OnWall/RunningCoyoteEnabled"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../Airborne/CoyoteEnabled")
event = &"start_falling"
delay_in_seconds = "0.0"
[node name="Running" type="Node" parent="StateChart/Root/Movement/OnWall"] [node name="Running" type="Node" parent="StateChart/Root/Movement/OnWall"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/OnWall/Running"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../Jump/SimpleJump")
event = &"jump"
delay_in_seconds = "0.0"
[node name="OnLeaveWall" type="Node" parent="StateChart/Root/Movement/OnWall/Running"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../Airborne/CoyoteEnabled")
event = &"start_falling"
delay_in_seconds = "0.0"
[connection signal="input_aim_canceled" from="InputController" to="." method="OnInputAimCanceled"] [connection signal="input_aim_canceled" from="InputController" to="." method="OnInputAimCanceled"]
[connection signal="input_aim_down" from="InputController" to="." method="OnInputAimDown"] [connection signal="input_aim_down" from="InputController" to="." method="OnInputAimDown"]
[connection signal="input_aim_pressed" from="InputController" to="." method="OnInputAimPressed"] [connection signal="input_aim_pressed" from="InputController" to="." method="OnInputAimPressed"]

View File

@@ -1,7 +1,7 @@
using Godot; using Godot;
using System; using System;
public partial class PlayerUi : CanvasLayer public partial class PlayerUi : Control
{ {
private TextureRect[] _dashIcons = new TextureRect[3]; private TextureRect[] _dashIcons = new TextureRect[3];

View File

@@ -146,9 +146,6 @@ public partial class HealthSystem : Node3D
public CharacterBody3D Parent; public CharacterBody3D Parent;
public Camera3D Camera; public Camera3D Camera;
public Node3D Head; public Node3D Head;
public ColorRect VignetteRect;
public ColorRect DistortionRect;
public ColorRect BlurRect;
} }
public void Init(HealthSystemInitParams initParams) public void Init(HealthSystemInitParams initParams)
@@ -162,10 +159,6 @@ public partial class HealthSystem : Node3D
_camera = initParams.Camera; _camera = initParams.Camera;
_head = initParams.Head; _head = initParams.Head;
_vignetteMaterial = initParams.VignetteRect.Material as ShaderMaterial;
_distortionMaterial = initParams.DistortionRect.Material as ShaderMaterial;
_blurMaterial = initParams.BlurRect.Material as ShaderMaterial;
// Resetting shaders' parameters // Resetting shaders' parameters

View File

@@ -1,5 +1,4 @@
using System; using System;
using System.Collections.Generic;
using Godot; using Godot;
using GodotStateCharts; using GodotStateCharts;
using Movementtests.addons.godot_state_charts.csharp; using Movementtests.addons.godot_state_charts.csharp;
@@ -15,19 +14,26 @@ public partial class PlayerController : CharacterBody3D
MoveCamera, MoveCamera,
None, None,
} }
private bool _isUsingGamepad = false; private bool _isUsingGamepad;
public enum BufferedActions
{
None,
Jump,
MantleJump,
Dash,
MantleDash
}
private BufferedActions _bufferedAction = BufferedActions.None;
// User API to important child nodes. // User API to important child nodes.
public HeadSystem HeadSystem; public HeadSystem HeadSystem;
public Bobbing Bobbing; public Bobbing Bobbing;
public FieldOfView FieldOfView; public FieldOfView FieldOfView;
public Stamina Stamina;
public StairsSystem StairsSystem; public StairsSystem StairsSystem;
public MantleSystem MantleSystem; public MantleSystem MantleSystem;
public DashSystem DashSystem; public DashSystem DashSystem;
public CapsuleCollider CapsuleCollider; public CapsuleCollider CapsuleCollider;
public HealthSystem HealthSystem;
public TweenQueueSystem TweenQueueSystem;
public Node3D WeaponRoot; public Node3D WeaponRoot;
public WeaponSystem WeaponSystem; public WeaponSystem WeaponSystem;
public WallHugSystem WallHugSystem; public WallHugSystem WallHugSystem;
@@ -37,12 +43,15 @@ public partial class PlayerController : CharacterBody3D
public Node3D DashIndicatorNode; public Node3D DashIndicatorNode;
public MeshInstance3D DashIndicatorMesh; public MeshInstance3D DashIndicatorMesh;
public CylinderMesh DashIndicatorMeshCylinder; public CylinderMesh DashIndicatorMeshCylinder;
public RayCast3D WallRunSnapper;
private bool _movementEnabled = true; private bool _movementEnabled = true;
private Vector3 _dashDirection = Vector3.Zero;
private bool _shouldMantle; private bool _shouldMantle;
private Vector3 _mantleLocation = Vector3.Zero; private Vector3 _mantleLocation = Vector3.Zero;
private Vector3 _dashDirection = Vector3.Zero; private Vector3 _preMantleVelocity = Vector3.Zero;
private float _lastFrameWasOnFloor = -Mathf.Inf; private float _lastFrameWasOnFloor = -Mathf.Inf;
@@ -59,6 +68,7 @@ public partial class PlayerController : CharacterBody3D
// Timers // Timers
private Timer _timeScaleAimInAirTimer; private Timer _timeScaleAimInAirTimer;
private Timer _simpleDashCooldownTimer; private Timer _simpleDashCooldownTimer;
private Timer _airborneDashCooldownTimer;
private Timer _powerCooldownTimer; private Timer _powerCooldownTimer;
[Export] public Marker3D TutorialWeaponTarget; [Export] public Marker3D TutorialWeaponTarget;
@@ -79,14 +89,25 @@ public partial class PlayerController : CharacterBody3D
public float DecelerationAir = 1.0f; public float DecelerationAir = 1.0f;
[Export(PropertyHint.Range, "0,10,0.01,or_greater")] [Export(PropertyHint.Range, "0,10,0.01,or_greater")]
public float Weight { get; set; } = 3.0f; public float Weight { get; set; } = 3.0f;
// Mantle
[ExportGroup("Mantle")] [ExportGroup("Mantle")]
[Export(PropertyHint.Range, "0,1,0.01,or_greater")] [Export(PropertyHint.Range, "0,1,0.01,or_greater")]
public float MantleTime { get; set; } = 0.1f; public float MantleTime { get; set; } = 0.1f;
[Export]
public PackedScene MantlePath { get; set; }
[Export(PropertyHint.Range, "0,50,0.1")]
public float MantleDashStrength { get; set; } = 15f;
[Export(PropertyHint.Range, "0,100,1,or_greater")]
public float MantleJumpStartVelocity { get; set; } = 20.0f;
// Jump // Jump
[ExportGroup("Jump")] [ExportGroup("Jump")]
[Export(PropertyHint.Range, "0,1,0.01")] [Export(PropertyHint.Range, "0,1,0.01")]
public float CoyoteTime { get; set; } = 0.2f; public float CoyoteTime { get; set; } = 0.2f;
[Export(PropertyHint.Range, "0,10,1,or_greater")]
public int InputBufferFrames { get; set; } = 3;
// Simple jump // Simple jump
[ExportSubgroup("Simple jump")] [ExportSubgroup("Simple jump")]
@@ -156,6 +177,16 @@ public partial class PlayerController : CharacterBody3D
[Export(PropertyHint.Range, "0.1,10,0.1,or_greater")] [Export(PropertyHint.Range, "0.1,10,0.1,or_greater")]
public float WallHugHorizontalDeceleration { get; set; } = 5f; public float WallHugHorizontalDeceleration { get; set; } = 5f;
// Wall run
[ExportGroup("Wall run")]
[Export(PropertyHint.Range, "1,20,0.1,or_greater")]
public float WallRunUpwardVelocity { get; set; } = 10f;
[Export(PropertyHint.Range, "1,20,0.1,or_greater")]
public float WallRunAltitudeLossSpeed { get; set; } = 10f;
[Export(PropertyHint.Range, "1,20,0.1,or_greater")]
public float WallRunSpeedThreshold { get; set; } = 8f;
private float _targetSpeed; private float _targetSpeed;
private float _gravity; private float _gravity;
@@ -177,6 +208,11 @@ public partial class PlayerController : CharacterBody3D
private bool _canDash = true; private bool _canDash = true;
private bool _shouldMantleOnDashEnded; private bool _shouldMantleOnDashEnded;
private Vector3 _wallHugStartLocation = Vector3.Zero;
private Vector3 _wallHugStartNormal = Vector3.Zero;
private Vector3 _wallHugStartProjectedVelocity = Vector3.Zero;
private Vector3 _currentWallContactPoint = Vector3.Zero;
private StateChart _playerState; private StateChart _playerState;
private StateChartState _aiming; private StateChartState _aiming;
@@ -191,19 +227,31 @@ public partial class PlayerController : CharacterBody3D
private StateChartState _simpleJump; private StateChartState _simpleJump;
private StateChartState _doubleJump; private StateChartState _doubleJump;
private StateChartState _megaJump; private StateChartState _megaJump;
private StateChartState _mantling;
private StateChartState _simpleDash; private StateChartState _simpleDash;
private StateChartState _poweredDash; private StateChartState _poweredDash;
private StateChartState _aimedDash; private StateChartState _aimedDash;
private StateChartState _onWall; private StateChartState _onWall;
private StateChartState _onWallHugging; private StateChartState _onWallHugging;
private StateChartState _onWallHuggingCoyoteEnabled;
private StateChartState _onWallHanging; private StateChartState _onWallHanging;
private StateChartState _onWallRunning; private StateChartState _onWallRunning;
private StateChartState _onWallRunningCoyoteEnabled;
private Transition _onJumpFromWall;
private Transition _onJumpFromWallCoyote;
private Transition _onJumpFromWallRunCoyote;
private Transition _onJumpFromWall1;
private Transition _onJumpFromWall2;
private Transition _onJumpFromWall3;
private Transition _onMegajumpFromWall; private Transition _onMegajumpFromWall;
private Transition _onLeaveWallFromRunCoyote;
private Transition _onLeaveWallFromRun;
private int _currentInputBufferFrames;
private float _playerHeight; private float _playerHeight;
private float _playerRadius; private float _playerRadius;
private bool _isJumpInputPressed;
private float _lookSensitivityMultiplier = 1.0f; private float _lookSensitivityMultiplier = 1.0f;
private float _mouseSensitivityMultiplier = 1.0f; private float _mouseSensitivityMultiplier = 1.0f;
@@ -219,7 +267,6 @@ public partial class PlayerController : CharacterBody3D
/////////////////////////// ///////////////////////////
// General use stuff // General use stuff
TweenQueueSystem = GetNode<TweenQueueSystem>("TweenQueueSystem");
PlayerUi = GetNode<PlayerUi>("UI"); PlayerUi = GetNode<PlayerUi>("UI");
// DashIndicator = GetNode<TextureRect>("%DashIndicator"); // DashIndicator = GetNode<TextureRect>("%DashIndicator");
PowerCooldownIndicator = GetNode<ColorRect>("%DashCooldownIndicator"); PowerCooldownIndicator = GetNode<ColorRect>("%DashCooldownIndicator");
@@ -239,20 +286,16 @@ public partial class PlayerController : CharacterBody3D
FieldOfView = GetNode<FieldOfView>("FieldOfView"); FieldOfView = GetNode<FieldOfView>("FieldOfView");
Camera3D camera = GetNode<Camera3D>("HeadSystem/CameraSmooth/Camera3D"); Camera3D camera = GetNode<Camera3D>("HeadSystem/CameraSmooth/Camera3D");
Node3D cameraSmooth = GetNode<Node3D>("HeadSystem/CameraSmooth"); Node3D cameraSmooth = GetNode<Node3D>("HeadSystem/CameraSmooth");
ColorRect vignetteRect = GetNode<ColorRect>(
"HeadSystem/CameraSmooth/Camera3D/CLVignette(Layer_1)/HealthVignetteRect");
ColorRect distortionRect = GetNode<ColorRect>(
"HeadSystem/CameraSmooth/Camera3D/CLDistortion(Layer_2)/HealthDistortionRect");
ColorRect blurRect = GetNode<ColorRect>("HeadSystem/CameraSmooth/Camera3D/CLBlur(Layer_2)/BlurRect");
// Movement stuff // Movement stuff
WeaponRoot = GetNode<Node3D>("WeaponRoot"); WeaponRoot = GetNode<Node3D>("WeaponRoot");
WeaponSystem = GetNode<WeaponSystem>("WeaponRoot/WeaponSystem"); WeaponSystem = GetNode<WeaponSystem>("WeaponRoot/WeaponSystem");
MantleSystem = GetNode<MantleSystem>("MantleSystem"); MantleSystem = GetNode<MantleSystem>("HeadSystem/MantleSystem");
CapsuleCollider = GetNode<CapsuleCollider>("CapsuleCollider"); CapsuleCollider = GetNode<CapsuleCollider>("CapsuleCollider");
DashSystem = GetNode<DashSystem>("DashSystem"); DashSystem = GetNode<DashSystem>("DashSystem");
StairsSystem = GetNode<StairsSystem>("StairsSystem"); StairsSystem = GetNode<StairsSystem>("StairsSystem");
WallHugSystem = GetNode<WallHugSystem>("WallHugSystem"); WallHugSystem = GetNode<WallHugSystem>("WallHugSystem");
WallRunSnapper = GetNode<RayCast3D>("%WallRunSnapper");
RayCast3D stairsBelowRayCast3D = GetNode<RayCast3D>("StairsBelowRayCast3D"); RayCast3D stairsBelowRayCast3D = GetNode<RayCast3D>("StairsBelowRayCast3D");
RayCast3D stairsAheadRayCast3D = GetNode<RayCast3D>("StairsAheadRayCast3D"); RayCast3D stairsAheadRayCast3D = GetNode<RayCast3D>("StairsAheadRayCast3D");
_headCollisionDetectors = new RayCast3D[NUM_OF_HEAD_COLLISION_DETECTORS]; _headCollisionDetectors = new RayCast3D[NUM_OF_HEAD_COLLISION_DETECTORS];
@@ -266,11 +309,7 @@ public partial class PlayerController : CharacterBody3D
_playerHeight = playerShape!.Height; _playerHeight = playerShape!.Height;
_playerRadius = playerShape.Radius; _playerRadius = playerShape.Radius;
// RPG Stuff // State managementb
Stamina = GetNode<Stamina>("Stamina");
HealthSystem = GetNode<HealthSystem>("HealthSystem");
// State management
_playerState = StateChart.Of(GetNode("StateChart")); _playerState = StateChart.Of(GetNode("StateChart"));
_aiming = StateChartState.Of(GetNode("StateChart/Root/Aim/On")); _aiming = StateChartState.Of(GetNode("StateChart/Root/Aim/On"));
@@ -281,31 +320,39 @@ public partial class PlayerController : CharacterBody3D
_empowerOn = StateChartState.Of(GetNode("StateChart/Root/Empower/On")); _empowerOn = StateChartState.Of(GetNode("StateChart/Root/Empower/On"));
_powerExpired = StateChartState.Of(GetNode("StateChart/Root/PowerReserve/Expired")); _powerExpired = StateChartState.Of(GetNode("StateChart/Root/PowerReserve/Expired"));
_powerRecharging = StateChartState.Of(GetNode("StateChart/Root/PowerReserve/AtLeastOneCharge")); _powerRecharging = StateChartState.Of(GetNode("StateChart/Root/PowerReserve/AtLeastOneCharge"));
_powerFull = StateChartState.Of(GetNode("StateChart/Root/PowerReserve/Full")); _powerFull = StateChartState.Of(GetNode("StateChart/Root/PowerReserve/Full"));
_grounded = StateChartState.Of(GetNode("StateChart/Root/Movement/Grounded")); _grounded = StateChartState.Of(GetNode("StateChart/Root/Movement/Grounded"));
_airborne = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne")); _airborne = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne"));
_coyoteEnabled = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne/CoyoteEnabled")); _coyoteEnabled = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne/CoyoteEnabled"));
// _doubleJumpEnabled = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne/DoubleJumpEnabled"));
_simpleJump = StateChartState.Of(GetNode("StateChart/Root/Movement/Jump/SimpleJump")); _simpleJump = StateChartState.Of(GetNode("StateChart/Root/Movement/Jump/SimpleJump"));
_doubleJump = StateChartState.Of(GetNode("StateChart/Root/Movement/Jump/DoubleJump")); _doubleJump = StateChartState.Of(GetNode("StateChart/Root/Movement/Jump/DoubleJump"));
_megaJump = StateChartState.Of(GetNode("StateChart/Root/Movement/Jump/MegaJump")); _megaJump = StateChartState.Of(GetNode("StateChart/Root/Movement/Jump/MegaJump"));
_onJumpFromWall = Transition.Of(GetNode("StateChart/Root/Movement/OnWall/OnJump")); _mantling = StateChartState.Of(GetNode("StateChart/Root/Movement/Mantling"));
_onJumpFromWallCoyote = Transition.Of(GetNode("StateChart/Root/Movement/OnWall/HuggingCoyoteEnabled/OnJump"));
_onJumpFromWallRunCoyote = Transition.Of(GetNode("StateChart/Root/Movement/OnWall/RunningCoyoteEnabled/OnJump"));
_onJumpFromWall1 = Transition.Of(GetNode("StateChart/Root/Movement/OnWall/Hugging/OnJump"));
_onJumpFromWall2 = Transition.Of(GetNode("StateChart/Root/Movement/OnWall/Hanging/OnJump"));
_onJumpFromWall3 = Transition.Of(GetNode("StateChart/Root/Movement/OnWall/Running/OnJump"));
_onMegajumpFromWall = Transition.Of(GetNode("StateChart/Root/Movement/OnWall/OnMegajump")); _onMegajumpFromWall = Transition.Of(GetNode("StateChart/Root/Movement/OnWall/OnMegajump"));
_onWall = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall")); _onWall = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall"));
_onWallHuggingCoyoteEnabled = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/HuggingCoyoteEnabled"));
_onWallHugging = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/Hugging")); _onWallHugging = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/Hugging"));
_onWallHanging = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/Hanging")); _onWallHanging = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/Hanging"));
_onWallRunning = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/Running")); _onWallRunning = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/Running"));
_onWallRunningCoyoteEnabled = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/RunningCoyoteEnabled"));
_onLeaveWallFromRun = Transition.Of(GetNode("StateChart/Root/Movement/OnWall/Running/OnLeaveWall"));
_onLeaveWallFromRunCoyote = Transition.Of(GetNode("StateChart/Root/Movement/OnWall/RunningCoyoteEnabled/OnLeaveWall"));
// State timers // State timers
_powerCooldownTimer = GetNode<Timer>("PowerCooldown"); _powerCooldownTimer = GetNode<Timer>("PowerCooldown");
_timeScaleAimInAirTimer = GetNode<Timer>("TimeScaleAimInAir"); _timeScaleAimInAirTimer = GetNode<Timer>("TimeScaleAimInAir");
_simpleDashCooldownTimer = GetNode<Timer>("DashCooldown"); _simpleDashCooldownTimer = GetNode<Timer>("DashCooldown");
_airborneDashCooldownTimer = GetNode<Timer>("AirborneDashCooldown");
/////////////////////////// ///////////////////////////
// Initialize components // // Initialize components //
/////////////////////////// ///////////////////////////
// General use stuff
TweenQueueSystem.Init(this);
// Camera stuff // Camera stuff
HeadSystem.Init(); HeadSystem.Init();
@@ -317,23 +364,11 @@ public partial class PlayerController : CharacterBody3D
_gravity = (float)ProjectSettings.GetSetting("physics/3d/default_gravity"); _gravity = (float)ProjectSettings.GetSetting("physics/3d/default_gravity");
MantleSystem.Init(); MantleSystem.Init();
StairsSystem.Init(stairsBelowRayCast3D, stairsAheadRayCast3D, cameraSmooth); StairsSystem.Init(stairsBelowRayCast3D, stairsAheadRayCast3D, cameraSmooth);
DashSystem.Init(HeadSystem, camera, TweenQueueSystem); DashSystem.Init(HeadSystem, camera);
WeaponSystem.Init(HeadSystem, camera); WeaponSystem.Init(HeadSystem, camera);
WallHugSystem.Init(); WallHugSystem.Init();
// RPG Stuff // RPG Stuff
HealthSystem.HealthSystemInitParams healthSystemParams = new HealthSystem.HealthSystemInitParams()
{
Parent = this,
Camera = camera,
Head = HeadSystem,
VignetteRect = vignetteRect,
DistortionRect = distortionRect,
BlurRect = blurRect,
};
HealthSystem.Init(healthSystemParams);
Stamina.SetSpeeds(WalkSpeed, WalkSpeed);
EmpoweredActionsLeft = MaxNumberOfEmpoweredActions; EmpoweredActionsLeft = MaxNumberOfEmpoweredActions;
if (!TutorialDone) if (!TutorialDone)
@@ -350,6 +385,7 @@ public partial class PlayerController : CharacterBody3D
_grounded.StateEntered += OnGrounded; _grounded.StateEntered += OnGrounded;
_grounded.StatePhysicsProcessing += HandleGrounded; _grounded.StatePhysicsProcessing += HandleGrounded;
_airborne.StatePhysicsProcessing += HandleAirborne; _airborne.StatePhysicsProcessing += HandleAirborne;
_onWall.StatePhysicsProcessing += HandleOnWall;
_coyoteEnabled.StateEntered += StartCoyoteTime; _coyoteEnabled.StateEntered += StartCoyoteTime;
_timeScaleAimInAirTimer.Timeout += ResetTimeScale; _timeScaleAimInAirTimer.Timeout += ResetTimeScale;
@@ -370,6 +406,9 @@ public partial class PlayerController : CharacterBody3D
_megaJump.StateEntered += OnMegaJumpStarted; _megaJump.StateEntered += OnMegaJumpStarted;
_megaJump.StatePhysicsProcessing += HandleMegaJump; _megaJump.StatePhysicsProcessing += HandleMegaJump;
_mantling.StateEntered += OnMantleStarted;
_mantling.StatePhysicsProcessing += HandleMantling;
_simpleDash.StateEntered += OnSimpleDashStarted; _simpleDash.StateEntered += OnSimpleDashStarted;
_simpleDash.StatePhysicsProcessing += HandleSimpleDash; _simpleDash.StatePhysicsProcessing += HandleSimpleDash;
@@ -381,15 +420,26 @@ public partial class PlayerController : CharacterBody3D
_aimedDash.StateExited += OnAimedDashFinished; _aimedDash.StateExited += OnAimedDashFinished;
_simpleDashCooldownTimer.Timeout += DashCooldownTimeout; _simpleDashCooldownTimer.Timeout += DashCooldownTimeout;
_airborneDashCooldownTimer.Timeout += AirborneDashCooldownTimeout;
_onWall.StateEntered += OnWallStarted; _onWall.StateEntered += OnWallStarted;
_onWall.StateExited += OnWallStopped; _onWall.StateExited += OnWallStopped;
_onWallHuggingCoyoteEnabled.StateEntered += OnWallHuggingStarted;
_onWallHuggingCoyoteEnabled.StatePhysicsProcessing += HandleWallHugging;
_onWallHugging.StatePhysicsProcessing += HandleWallHugging; _onWallHugging.StatePhysicsProcessing += HandleWallHugging;
_onWallHanging.StatePhysicsProcessing += HandleWallHanging; _onWallHanging.StatePhysicsProcessing += HandleWallHanging;
_onWallRunningCoyoteEnabled.StateEntered += OnWallRunningStarted;
_onWallRunningCoyoteEnabled.StatePhysicsProcessing += HandleWallRunning;
_onWallRunning.StatePhysicsProcessing += HandleWallRunning; _onWallRunning.StatePhysicsProcessing += HandleWallRunning;
_onJumpFromWall.Taken += OnJumpFromWall; _onJumpFromWallCoyote.Taken += OnJumpFromWallCoyote;
_onJumpFromWallRunCoyote.Taken += OnJumpFromWallCoyote;
_onJumpFromWall1.Taken += OnJumpFromWall;
_onJumpFromWall2.Taken += OnJumpFromWall;
_onJumpFromWall3.Taken += OnJumpFromWall;
_onMegajumpFromWall.Taken += OnMegajumpFromWall; _onMegajumpFromWall.Taken += OnMegajumpFromWall;
_onLeaveWallFromRun.Taken += OnLeaveWallFromRun;
_onLeaveWallFromRunCoyote.Taken += OnLeaveWallFromRun;
} }
public void SetAllowedInputsAll() public void SetAllowedInputsAll()
@@ -436,30 +486,71 @@ public partial class PlayerController : CharacterBody3D
if (_simpleDashCooldownTimer.IsStopped()) if (_simpleDashCooldownTimer.IsStopped())
_simpleDashCooldownTimer.Start(); _simpleDashCooldownTimer.Start();
if (_bufferedAction == BufferedActions.Jump && _currentInputBufferFrames > 0)
{
_currentInputBufferFrames = 0;
PerformJump();
}
if (_bufferedAction == BufferedActions.Dash && _currentInputBufferFrames > 0)
{
_currentInputBufferFrames = 0;
SimpleDash();
}
if (_bufferedAction == BufferedActions.MantleJump)
{
SimpleDash();
OnJumpStarted(MantleJumpStartVelocity);
}
if (_bufferedAction == BufferedActions.MantleDash)
{
SimpleDash(MantleDashStrength);
}
_bufferedAction = BufferedActions.None;
} }
public void DashCooldownTimeout() public void DashCooldownTimeout()
{ {
_canDash = true; _canDash = true;
} }
public void AirborneDashCooldownTimeout()
{
_canDashAirborne = true;
}
public bool IsPlayerInputtingForward()
{
return GetMoveInput().Z < -0.5f;
}
public bool IsTryingToMantle()
{
return MantleSystem.IsMantlePossible && IsPlayerInputtingForward() && _isJumpInputPressed;
}
public void HandleGrounded(float delta) public void HandleGrounded(float delta)
{ {
MoveOnGround(delta); MoveOnGround(delta);
// if (IsTryingToMantle()) _playerState.SendEvent("mantle");
if (!isOnFloorCustom()) if (!isOnFloorCustom())
_playerState.SendEvent("start_falling"); _playerState.SendEvent("start_falling");
} }
private float _wallRunSpeedThreshold = 8f;
public void HandleAirborne(float delta) public void HandleAirborne(float delta)
{ {
MoveInAir(delta); MoveInAir(delta);
if (isOnFloorCustom()) if (isOnFloorCustom())
_playerState.SendEvent("grounded"); _playerState.SendEvent("grounded");
if (IsTryingToMantle()) _playerState.SendEvent("mantle");
if (!WallHugSystem.IsWallHugging()) if (!WallHugSystem.IsWallHugging())
{
_isWallJumpAvailable = true; // reset wall jump if we left the wall
return; return;
}
// Going upwards, we stay simply airborne // Going upwards, we stay simply airborne
if (Velocity.AngleTo(Vector3.Up) < Math.PI / 4) if (Velocity.AngleTo(Vector3.Up) < Math.PI / 4)
@@ -467,26 +558,40 @@ public partial class PlayerController : CharacterBody3D
// Should we start a wall run // Should we start a wall run
var wallNormal = WallHugSystem.WallHugNormal.UnwrapOr(Vector3.Zero); var wallNormal = WallHugSystem.WallHugNormal.UnwrapOr(Vector3.Zero);
var isIndeedWall = wallNormal.Y < 0.1;
var hvel = new Vector3(Velocity.X, 0, Velocity.Z); var hvel = new Vector3(Velocity.X, 0, Velocity.Z);
var hvelProjected = hvel.Slide(_wallHugStartNormal); var hvelProjected = hvel.Slide(_wallHugStartNormal);
var haveEnoughSpeed = hvelProjected.Length() > _wallRunSpeedThreshold; var haveEnoughSpeed = hvelProjected.Length() > WallRunSpeedThreshold;
var isHeadPlanting = Velocity.AngleTo(wallNormal) < Math.PI / 4; var isCoplanarEnough = Velocity.AngleTo(wallNormal) > Math.PI/4 && Velocity.AngleTo(wallNormal) < 3*Math.PI/4;
var isGoingDownwards = Velocity.AngleTo(Vector3.Down) < Math.PI / 4; var isGoingDownwards = Velocity.AngleTo(Vector3.Down) < Math.PI/4;
if (haveEnoughSpeed && !isHeadPlanting && !isGoingDownwards) if (haveEnoughSpeed && isCoplanarEnough && !isGoingDownwards && isIndeedWall && !_coyoteEnabled.Active)
{ {
SetVerticalVelocity(WallRunUpwardVelocity);
_playerState.SendEvent("wall_run"); _playerState.SendEvent("wall_run");
return; return;
} }
// If all else fail and we go down, we hug // If all else fail and we go down, we hug
if (Velocity.Y < 0) if (Velocity.Y < 0 && !_coyoteEnabled.Active)
{
_playerState.SendEvent("wall_hug"); _playerState.SendEvent("wall_hug");
}
}
public void HandleOnWall(float delta)
{
if (IsTryingToMantle()) _playerState.SendEvent("mantle");
} }
private Vector3 _wallHugStartLocation = Vector3.Zero; public void OnWallHuggingStarted()
private Vector3 _wallHugStartNormal = Vector3.Zero; {
private Vector3 _wallHugStartProjectedVelocity = Vector3.Zero; GetTree().CreateTimer(CoyoteTime).Timeout += CoyoteExpired;
}
public void OnWallRunningStarted()
{
GetTree().CreateTimer(CoyoteTime).Timeout += CoyoteExpired;
}
public void OnWallDetected() public void OnWallDetected()
{ {
@@ -496,22 +601,29 @@ public partial class PlayerController : CharacterBody3D
return; return;
var newWallNormal = WallHugSystem.WallHugNormal.UnwrapOr(Vector3.Up); var newWallNormal = WallHugSystem.WallHugNormal.UnwrapOr(Vector3.Up);
if (newWallNormal.AngleTo(_wallHugStartNormal) > Mathf.Pi/4) return;
_wallHugStartNormal = newWallNormal; _wallHugStartNormal = newWallNormal;
} }
private float _timeSinceWallStarted;
public void OnWallStarted() public void OnWallStarted()
{ {
if (!WallHugSystem.IsWallHugging())
return;
_wallHugStartNormal = WallHugSystem.WallHugNormal.UnwrapOr(Vector3.Up); _wallHugStartNormal = WallHugSystem.WallHugNormal.UnwrapOr(Vector3.Up);
_wallHugStartLocation = WallHugSystem.WallHugLocation.UnwrapOr(Vector3.Zero) + _wallHugStartNormal * _playerRadius; _currentWallContactPoint = WallHugSystem.WallHugLocation.UnwrapOr(Vector3.Zero);
_wallHugStartLocation = _currentWallContactPoint + _wallHugStartNormal * _playerRadius;
_wallHugStartProjectedVelocity = Velocity.Slide(_wallHugStartNormal); _wallHugStartProjectedVelocity = Velocity.Slide(_wallHugStartNormal);
_timeSinceWallStarted = 0;
} }
public void OnWallStopped() public void OnWallStopped()
{ {
} }
public void OnLeaveWallFromRun()
{
SimpleDashInDirection(Velocity.Normalized());
}
public void HandleWallHugging(float delta) public void HandleWallHugging(float delta)
{ {
@@ -528,23 +640,25 @@ public partial class PlayerController : CharacterBody3D
WallHang(delta); WallHang(delta);
} }
private float _wallRunUpwardVelocity = 10f;
public void HandleWallRunning(float delta) public void HandleWallRunning(float delta)
{ {
_timeSinceWallStarted += delta; // Find horizontal velocity projected on the current wall
var hvel = new Vector3(Velocity.X, 0, Velocity.Z); var hvel = new Vector3(Velocity.X, 0, Velocity.Z);
var hvelProjected = hvel.Slide(_wallHugStartNormal); var hvelProjected = hvel.Slide(_wallHugStartNormal);
Velocity = hvelProjected + hvelProjected.Length()*Vector3.Up*0.3f/(1+_timeSinceWallStarted);
Velocity *= 0.99f;
// if (CanMantle())
// {
// MantleToLocation(_plannedMantleLocation.Unwrap());
// }
if (!WallHugSystem.IsWallHugging() || Velocity.Length() < _wallRunSpeedThreshold) // Reorient horizontal velocity so we keep it coplanar with the wall without losing speed
var finalHVel = hvelProjected.Normalized() * hvel.Length();
// Adapt vertical speed
var verticalSpeed = Velocity.Y - WallRunAltitudeLossSpeed * delta;
Velocity = finalHVel + Vector3.Up*verticalSpeed;
Velocity *= 0.995f;
_currentWallContactPoint = WallHugSystem.WallHugLocation.UnwrapOr(Vector3.Zero);
if (isOnFloorCustom())
_playerState.SendEvent("grounded");
if (!WallHugSystem.IsWallHugging() || Velocity.Length() < WallRunSpeedThreshold)
{ {
_playerState.SendEvent("start_falling"); _playerState.SendEvent("start_falling");
} }
@@ -564,15 +678,22 @@ public partial class PlayerController : CharacterBody3D
Velocity = Vector3.Zero; Velocity = Vector3.Zero;
GlobalPosition = _wallHugStartLocation; GlobalPosition = _wallHugStartLocation;
} }
private Option<Vector3> _plannedMantleLocation = Option<Vector3>.None;
// Jump // Jump
public void OnInputJumpStarted() public void OnInputJumpStarted()
{ {
if (CanMantle()) _currentInputBufferFrames = InputBufferFrames;
_bufferedAction = _mantling.Active ? BufferedActions.MantleJump : BufferedActions.Jump;
_isJumpInputPressed = true;
PerformJump();
}
public void PerformJump()
{
if (MantleSystem.IsMantlePossible)
{ {
MantleToLocation(_plannedMantleLocation.Unwrap()); _playerState.SendEvent("mantle");
return; return;
} }
@@ -581,15 +702,23 @@ public partial class PlayerController : CharacterBody3D
_playerState.SendEvent("megajump"); _playerState.SendEvent("megajump");
return; return;
} }
if (_onWall.Active && !_isWallJumpAvailable && IsFacingWall()) return;
_playerState.SendEvent("jump"); _playerState.SendEvent("jump");
} }
public bool IsFacingWall()
{
return _wallHugStartNormal.Dot(GetGlobalForwardFacingVector()) < -0.5f;
}
public void OnInputJumpOngoing() public void OnInputJumpOngoing()
{ {
} }
public void OnInputJumpEnded() public void OnInputJumpEnded()
{ {
_isJumpInputPressed = false;
_playerState.SendEvent("jump_ended"); _playerState.SendEvent("jump_ended");
} }
@@ -605,6 +734,7 @@ public partial class PlayerController : CharacterBody3D
public void OnDoubleJumpStarted() public void OnDoubleJumpStarted()
{ {
_canDash = true; _canDash = true;
// _canDashAirborne = true;
OnJumpStarted(DoubleJumpStartVelocity); OnJumpStarted(DoubleJumpStartVelocity);
} }
public void OnMegaJumpStarted() public void OnMegaJumpStarted()
@@ -626,11 +756,24 @@ public partial class PlayerController : CharacterBody3D
var currentHorizontalVelocity = new Vector2(Velocity.X, Velocity.Z); var currentHorizontalVelocity = new Vector2(Velocity.X, Velocity.Z);
var wallJumpHorizontalVelocity = new Vector2(jumpVector.X, jumpVector.Z); var wallJumpHorizontalVelocity = new Vector2(jumpVector.X, jumpVector.Z);
SetHorizontalVelocity(currentHorizontalVelocity + wallJumpHorizontalVelocity);; SetHorizontalVelocity(currentHorizontalVelocity + wallJumpHorizontalVelocity);
} }
public void OnJumpFromWallCoyote()
{
_isWallJumpAvailable = false;
}
public void OnJumpFromWall() public void OnJumpFromWall()
{ {
ComputeJumpFromWallHSpeed(WallJumpStartVelocity); if (!IsFacingWall())
{
ComputeJumpFromWallHSpeed(WallJumpStartVelocity);
}
// Remove the ability to dash straight away so you cannot scale up the wall
_canDashAirborne = false;
_airborneDashCooldownTimer.Start();
_isWallJumpAvailable = false;
} }
public void OnMegajumpFromWall() public void OnMegajumpFromWall()
{ {
@@ -649,9 +792,14 @@ public partial class PlayerController : CharacterBody3D
return _inputMoveKeyboard; return _inputMoveKeyboard;
} }
public Vector3 GetGlobalMoveInput()
{
return Transform.Basis * HeadSystem.Transform.Basis * GetMoveInput();
}
public Vector3 ComputeHVelocity(float delta, float accelerationFactor, float decelerationFactor, Vector3? direction = null) public Vector3 ComputeHVelocity(float delta, float accelerationFactor, float decelerationFactor, Vector3? direction = null)
{ {
var dir = direction ?? Transform.Basis * HeadSystem.Transform.Basis * GetMoveInput(); var dir = direction ?? GetGlobalMoveInput();
var acceleration = dir.Length() > 0 ? accelerationFactor : decelerationFactor; var acceleration = dir.Length() > 0 ? accelerationFactor : decelerationFactor;
@@ -683,8 +831,85 @@ public partial class PlayerController : CharacterBody3D
z: velocity.Y); z: velocity.Y);
} }
private Path _mantlePath;
private bool _customMantle;
private Transform3D _customMantleStartTransform;
private Curve3D _customMantleCurve;
private Vector3 _mantleStartPosition;
private Vector3 _velocityOnMantleStarted = Vector3.Zero;
private bool _mantleEndedOnOtherSideOfWall;
private bool _mantleFoundGround;
public void OnMantleStarted()
{
HeadSystem.OnMantle();
_mantlePath = MantlePath.Instantiate() as Path;
if (_mantlePath == null)
{
GD.PrintErr("Failed to instantiate MantlePath");
return;
}
_velocityOnMantleStarted = Velocity;
var transform = _customMantle ? _customMantleStartTransform : MantleSystem.GlobalTransform;
var curve = _customMantle ? _customMantleCurve : MantleSystem.MantleCurve;
_mantleEndedOnOtherSideOfWall = _customMantle ? _mantleEndedOnOtherSideOfWall : MantleSystem.EndedOnOtherSideOfWall;
_mantleFoundGround = _customMantle ? _mantleFoundGround : MantleSystem.FoundGround;
GetTree().GetRoot().AddChild(_mantlePath);
_mantlePath.Setup(transform, curve);
_mantleStartPosition = GlobalPosition;
var curveLength = curve.GetBakedLength();
var tween = GetTree().CreateTween();
tween.SetTrans(Tween.TransitionType.Linear);
tween.SetEase(Tween.EaseType.In);
tween.TweenProperty(_mantlePath.PathFollow, "progress_ratio", 1, MantleTime*curveLength);
tween.Finished += MantleFinished;
}
public void HandleMantling(float delta)
{
GlobalPosition = _mantlePath.Target.GlobalPosition;
}
public void SimpleDashInDirection(Vector3 direction, float strength = -1)
{
if (strength < 0) strength = SimpleDashStrength;
SetVelocity(direction * strength);
}
public void SimpleDash(float strength = -1)
{
SimpleDashInDirection(GetInputGlobalHDirection(), strength);
}
public void MantleFinished()
{
_mantlePath.Teardown();
// SetVelocity(_finalCurveDirection.Normalized() * _speedOverCurve);
var isThereMovementInput = GetMoveInput().Length() > 0;
if (isThereMovementInput)
{
// If there's a movement input on Mantle, we dash in the direction the mantle ended with
var positionDifference = GlobalPosition - _mantleStartPosition;
var directionHorizontal = new Vector3(positionDifference.X, 0, positionDifference.Z);
// SimpleDashInDirection(directionHorizontal.Normalized());
SetVelocity(directionHorizontal.Normalized() * WalkSpeed);
}
_customMantle = false;
_playerState.SendEvent("grounded");
}
public void HandleJump(float delta, float gravityFactor, int hangFrames) public void HandleJump(float delta, float gravityFactor, int hangFrames)
{ {
if (IsTryingToMantle()) _playerState.SendEvent("mantle");
// Update horizontal velocity // Update horizontal velocity
var horizontalVelocity = ComputeHVelocityAir(delta); var horizontalVelocity = ComputeHVelocityAir(delta);
Velocity = new Vector3(horizontalVelocity.X, Velocity.Y, horizontalVelocity.Z); Velocity = new Vector3(horizontalVelocity.X, Velocity.Y, horizontalVelocity.Z);
@@ -711,8 +936,8 @@ public partial class PlayerController : CharacterBody3D
SetVerticalVelocity(Velocity.Y - 2.0f); SetVerticalVelocity(Velocity.Y - 2.0f);
} }
// Move back to Airborne state management when starting to go down again // Move back to Airborne state when starting to go down again or if input isn't held anymore (buffered jump)
if (_framesSinceJumpAtApex > hangFrames) if (_framesSinceJumpAtApex > hangFrames || !_isJumpInputPressed)
_playerState.SendEvent("jump_ended"); _playerState.SendEvent("jump_ended");
} }
public void HandleSimpleJump(float delta) public void HandleSimpleJump(float delta)
@@ -825,7 +1050,9 @@ public partial class PlayerController : CharacterBody3D
return; return;
_canDashAirborne = false; _canDashAirborne = false;
} }
_currentInputBufferFrames = InputBufferFrames;
_bufferedAction = _mantling.Active ? BufferedActions.MantleDash : BufferedActions.Dash;
_playerState.SendEvent("dash"); _playerState.SendEvent("dash");
} }
public void OnAimingEntered() public void OnAimingEntered()
@@ -903,15 +1130,18 @@ public partial class PlayerController : CharacterBody3D
if (WeaponSystem.IsPlantedUnderPlatform()) if (WeaponSystem.IsPlantedUnderPlatform())
dashLocation += Vector3.Down * _playerHeight; dashLocation += Vector3.Down * _playerHeight;
_wallHugStartNormal = WeaponSystem.PlantNormal;
_currentWallContactPoint = WeaponSystem.PlantLocation;
_wallHugStartLocation = dashLocation;
_wallHugStartProjectedVelocity = Velocity.Slide(_wallHugStartNormal);
var dashTween = CreatePositionTween(dashLocation, AimedDashTime); var dashTween = CreatePositionTween(dashLocation, AimedDashTime);
dashTween.Finished += DashToPlantedWeaponTweenEnded; dashTween.Finished += DashToPlantedWeaponTweenEnded;
} }
public void RecoverWeapon() public void RecoverWeapon()
{ {
GetTree().GetRoot().RemoveChild(WeaponRoot); RecoverChildNode(WeaponRoot);
AddChild(WeaponRoot);
WeaponRoot.SetGlobalPosition(GlobalPosition);
WeaponSystem.ResetWeapon(); WeaponSystem.ResetWeapon();
} }
@@ -924,12 +1154,11 @@ public partial class PlayerController : CharacterBody3D
RecoverWeapon(); RecoverWeapon();
var resultingEvent = shouldDashToHanging ? "to_planted" : "dash_finished"; var resultingEvent = shouldDashToHanging ? "dash_to_planted" : "dash_finished";
_playerState.SendEvent(resultingEvent); _playerState.SendEvent(resultingEvent);
} }
private Vector3 _preDashVelocity = Vector3.Zero; private Vector3 _preDashVelocity = Vector3.Zero;
public void OnAimedDashStarted() public void OnAimedDashStarted()
{ {
// Adjusting for player height, where the middle of the capsule should get to the dash location instead of the // Adjusting for player height, where the middle of the capsule should get to the dash location instead of the
@@ -943,9 +1172,12 @@ public partial class PlayerController : CharacterBody3D
var dashTween = CreatePositionTween(correctedLocation, AimedDashTime); var dashTween = CreatePositionTween(correctedLocation, AimedDashTime);
// dashTween.TweenMethod(Callable.From<float>(AimedDashTweenOngoing), 0.0f, 1.0f, AimedDashTime); // dashTween.TweenMethod(Callable.From<float>(AimedDashTweenOngoing), 0.0f, 1.0f, AimedDashTime);
dashTween.Finished += AimedDashTweenEnded; dashTween.Finished += AimedDashTweenEnded;
_shouldMantleOnDashEnded = DashSystem.ShouldMantle; _customMantle = DashSystem.ShouldMantle;
_mantleLocation = DashSystem.PlannedMantleLocation; _customMantleCurve = DashSystem.MantleSystem.MantleCurve;
_customMantleStartTransform = DashSystem.MantleSystem.GlobalTransform;
_mantleEndedOnOtherSideOfWall = DashSystem.MantleSystem.EndedOnOtherSideOfWall;
_mantleFoundGround = DashSystem.MantleSystem.FoundGround;
} }
Tween CreatePositionTween(Vector3 targetLocation, float tweenTime) Tween CreatePositionTween(Vector3 targetLocation, float tweenTime)
@@ -964,21 +1196,42 @@ public partial class PlayerController : CharacterBody3D
_playerState.SendEvent("dash_finished"); _playerState.SendEvent("dash_finished");
} }
public void OnAimedDashFinished()
{
var postDashVelocity = _preDashVelocity.Length() > PostDashSpeed ? PostDashSpeed : _preDashVelocity.Length();
Velocity = _dashDirection * postDashVelocity;
if (_customMantle) _playerState.SendEvent("mantle");
}
public void PlaceWeaponForTutorial() public void PlaceWeaponForTutorial()
{ {
if (TutorialDone)
return;
RemoveChild(WeaponRoot); RemoveChild(WeaponRoot);
GetTree().GetRoot().CallDeferred(Node.MethodName.AddChild, WeaponRoot); GetTree().GetRoot().CallDeferred(Node.MethodName.AddChild, WeaponRoot);
WeaponRoot.CallDeferred(Node3D.MethodName.SetGlobalPosition, TutorialWeaponTarget.GlobalPosition); WeaponRoot.CallDeferred(Node3D.MethodName.SetGlobalPosition, TutorialWeaponTarget.GlobalPosition);
WeaponSystem.CallDeferred(WeaponSystem.MethodName.PlaceWeaponForTutorial, TutorialWeaponTarget.GlobalPosition); WeaponSystem.CallDeferred(WeaponSystem.MethodName.PlaceWeaponForTutorial, TutorialWeaponTarget.GlobalPosition);
} }
public void RemoveChildNode(Node3D node)
{
RemoveChild(node);
GetTree().GetRoot().AddChild(node);
node.SetGlobalPosition(GlobalPosition);
}
public void RecoverChildNode(Node3D node)
{
GetTree().GetRoot().RemoveChild(node);
AddChild(node);
node.SetGlobalPosition(GlobalPosition);
}
public void ThrowWeapon() public void ThrowWeapon()
{ {
_playerState.SendEvent("cancel_aim"); _playerState.SendEvent("cancel_aim");
RemoveChildNode(WeaponRoot);
RemoveChild(WeaponRoot);
GetTree().GetRoot().AddChild(WeaponRoot);
WeaponRoot.SetGlobalPosition(GlobalPosition);
var weaponTargetLocation = DashSystem.HasHit ? DashSystem.CollisionPoint : DashSystem.PlannedLocation; var weaponTargetLocation = DashSystem.HasHit ? DashSystem.CollisionPoint : DashSystem.PlannedLocation;
WeaponSystem.ThrowWeapon( WeaponSystem.ThrowWeapon(
@@ -988,25 +1241,12 @@ public partial class PlayerController : CharacterBody3D
DashSystem.CollisionNormal); DashSystem.CollisionNormal);
} }
public void OnAimedDashFinished()
{
var postDashVelocity = _preDashVelocity.Length() > PostDashSpeed ? PostDashSpeed : _preDashVelocity.Length();
Velocity = _dashDirection * postDashVelocity;
if (_shouldMantleOnDashEnded)
MantleToLocation(_mantleLocation);
}
public void OnSimpleDashStarted() public void OnSimpleDashStarted()
{ {
if (!_canDash) if (!_canDash)
return; return;
_canDash = false; _canDash = false;
SimpleDash();
var dashStrength = SimpleDashStrength;
var direction = GetInputGlobalHDirection();
SetVelocity(direction * dashStrength);
} }
public void HandleSimpleDash(float delta) public void HandleSimpleDash(float delta)
@@ -1034,9 +1274,6 @@ public partial class PlayerController : CharacterBody3D
public void OnPoweredDashFinished() public void OnPoweredDashFinished()
{ {
// Try mantling but don't know if this is useful
// if (CanMantle())
// MantleToLocation(MantleSystem.FindMantleForHeadRotation(HeadSystem.Rotation.Y).Unwrap());
} }
public void FinishPoweredDash() public void FinishPoweredDash()
@@ -1074,36 +1311,17 @@ public partial class PlayerController : CharacterBody3D
_playerState.SendEvent("coyote_expired"); _playerState.SendEvent("coyote_expired");
} }
// Mantling
public bool CanMantle()
{
var mantleLocationResult = MantleSystem.FindMantleForHeadRotation(HeadSystem.Rotation.Y);
return mantleLocationResult.IsSome(out _);
}
private Vector3 _preMantleVelocity = Vector3.Zero;
public void MantleToLocation(Vector3 location)
{
HeadSystem.OnMantle();
_preMantleVelocity = Velocity;
var mantleTween = CreatePositionTween(location, MantleTime);
mantleTween.Finished += MantleFinished;
}
public void MantleFinished()
{
Velocity = _preMantleVelocity;
_playerState.SendEvent("grounded");
}
/////////////////////////// ///////////////////////////
// Stateless logic //////// // Stateless logic ////////
/////////////////////////// ///////////////////////////
private void LookAround() private void LookAround(double delta)
{ {
Vector2 inputLookDir = new Vector2(_inputRotateY, _inputRotateFloorplane); Vector2 inputLookDir = new Vector2(_inputRotateY, _inputRotateFloorplane);
var lookSensitivity = _isUsingGamepad ? _lookSensitivityMultiplier : _mouseSensitivityMultiplier; var lookSensitivity = _isUsingGamepad ? _lookSensitivityMultiplier : _mouseSensitivityMultiplier;
HeadSystem.LookAround(inputLookDir, lookSensitivity);
var wallHugContactPoint = _onWallRunning.Active || _onWallRunningCoyoteEnabled.Active ? _currentWallContactPoint : Vector3.Zero;
var playerVelocity = GetGlobalMoveInput();
HeadSystem.LookAround(delta, inputLookDir, playerVelocity, wallHugContactPoint, lookSensitivity);
} }
public void MoveOnGround(double delta) public void MoveOnGround(double delta)
@@ -1181,7 +1399,7 @@ public partial class PlayerController : CharacterBody3D
Bobbing.CameraBobbingParams cameraBobbingParams = new Bobbing.CameraBobbingParams Bobbing.CameraBobbingParams cameraBobbingParams = new Bobbing.CameraBobbingParams
{ {
Delta = delta, Delta = delta,
IsOnFloorCustom = isOnFloorCustom(), IsOnFloorCustom = isOnFloorCustom() || _onWallRunning.Active || _onWallRunningCoyoteEnabled.Active,
Velocity = Velocity, Velocity = Velocity,
SettingsMultiplier = _headBobbingMultiplier SettingsMultiplier = _headBobbingMultiplier
}; };
@@ -1236,16 +1454,23 @@ public partial class PlayerController : CharacterBody3D
{ {
WeaponRoot.SetRotation(HeadSystem.Rotation); WeaponRoot.SetRotation(HeadSystem.Rotation);
} }
public Vector3 GetGlobalForwardFacingVector()
{
return Transform.Basis * HeadSystem.Transform.Basis * Vector3.Forward;
}
/////////////////////////// ///////////////////////////
// Processes ////////////// // Processes //////////////
/////////////////////////// ///////////////////////////
public override void _PhysicsProcess(double delta) public override void _PhysicsProcess(double delta)
{ {
LookAround(); if (_currentInputBufferFrames > 0) _currentInputBufferFrames -= 1;
LookAround(delta);
CameraModifications((float) delta); CameraModifications((float) delta);
HandleStairs((float) delta); HandleStairs((float) delta);
_plannedMantleLocation = MantleSystem.FindMantleForHeadRotation(HeadSystem.Rotation.Y); MantleSystem.ProcessMantle(_grounded.Active);
if (WeaponSystem.InHandState.Active) if (WeaponSystem.InHandState.Active)
RotateWeaponWithPlayer(); RotateWeaponWithPlayer();

View File

@@ -161,5 +161,6 @@ common/physics_interpolation=true
[rendering] [rendering]
textures/vram_compression/import_etc2_astc=true textures/vram_compression/import_etc2_astc=true
lights_and_shadows/directional_shadow/soft_shadow_filter_quality=5
environment/volumetric_fog/volume_size=256 environment/volumetric_fog/volume_size=256
environment/volumetric_fog/volume_depth=256 environment/volumetric_fog/volume_depth=256

25
scenes/path/Path.cs Normal file
View File

@@ -0,0 +1,25 @@
using Godot;
public partial class Path : Path3D
{
public PathFollow3D PathFollow { get; private set; }
public Marker3D Target { get; private set; }
public override void _Ready()
{
PathFollow = GetNode<PathFollow3D>("PathFollow");
Target = GetNode<Marker3D>("PathFollow/Target");
}
public void Setup(Transform3D globalTransform, Curve3D curve)
{
SetGlobalTransform(globalTransform);
SetCurve(curve);
PathFollow.ProgressRatio = 0;
}
public void Teardown()
{
QueueFree();
}
}

1
scenes/path/Path.cs.uid Normal file
View File

@@ -0,0 +1 @@
uid://djdr5bvfc8f0x

13
scenes/path/path.tscn Normal file
View File

@@ -0,0 +1,13 @@
[gd_scene load_steps=3 format=3 uid="uid://cf3rrgr1imvv4"]
[ext_resource type="Script" uid="uid://djdr5bvfc8f0x" path="res://scenes/path/Path.cs" id="1_kmlhi"]
[sub_resource type="Curve3D" id="Curve3D_u4rfr"]
[node name="Path" type="Path3D"]
curve = SubResource("Curve3D_u4rfr")
script = ExtResource("1_kmlhi")
[node name="PathFollow" type="PathFollow3D" parent="."]
[node name="Target" type="Marker3D" parent="PathFollow"]

View File

@@ -20,19 +20,17 @@ public partial class DashSystem: Node3D
public bool ShouldMantle { get; set; } public bool ShouldMantle { get; set; }
public Vector3 PlannedMantleLocation { get; set; } public Vector3 PlannedMantleLocation { get; set; }
public MantleSystem MantleSystem { get; set; }
private Node3D _head; private Node3D _head;
private ShapeCast3D _dashCast3D; private ShapeCast3D _dashCast3D;
private ShapeCast3D _playerCast3D;
private Camera3D _camera; private Camera3D _camera;
private TweenQueueSystem _tweenQueueSystem;
private Vector3 _dashDirection = Vector3.Zero; private Vector3 _dashDirection = Vector3.Zero;
private ShapeCast3D _dashCastDrop; private ShapeCast3D _dashCastDrop;
private MeshInstance3D _dashDropIndicator; private MeshInstance3D _dashDropIndicator;
private MeshInstance3D _dashDropLocationIndicator; private MeshInstance3D _dashDropLocationIndicator;
private MantleSystem _mantleSystem;
private MeshInstance3D _dashTarget; private MeshInstance3D _dashTarget;
private CpuParticles3D _dashIndicator; private CpuParticles3D _dashIndicator;
private AnimationPlayer _dashIndicatorAnim; private AnimationPlayer _dashIndicatorAnim;
@@ -48,13 +46,10 @@ public partial class DashSystem: Node3D
public delegate void DashProgressEventHandler(float progress); public delegate void DashProgressEventHandler(float progress);
private Vector3 _globalDashPosition = Vector3.Zero; private Vector3 _globalDashPosition = Vector3.Zero;
private float _playerHeight;
private float _playerRadius;
public float DashCastRadius { get; set; } public float DashCastRadius { get; set; }
public void Init(Node3D head, Camera3D camera, TweenQueueSystem tweenQueueSystem) public void Init(Node3D head, Camera3D camera)
{ {
_dashCast3D = GetNode<ShapeCast3D>("DashCast3D"); _dashCast3D = GetNode<ShapeCast3D>("DashCast3D");
var dashShape = _dashCast3D.GetShape() as SphereShape3D; var dashShape = _dashCast3D.GetShape() as SphereShape3D;
@@ -66,17 +61,11 @@ public partial class DashSystem: Node3D
_dashDropLocationIndicator = GetNode<MeshInstance3D>("DashDropLocationIndicator"); _dashDropLocationIndicator = GetNode<MeshInstance3D>("DashDropLocationIndicator");
_dashDropLocationIndicator.Visible = false; _dashDropLocationIndicator.Visible = false;
_playerCast3D = GetNode<ShapeCast3D>("PlayerShapeCast3D");
var playerShape = _playerCast3D.GetShape() as CapsuleShape3D;
_playerHeight = playerShape!.Height;
_playerRadius = playerShape!.Radius;
_head = head; _head = head;
_camera = camera; _camera = camera;
_tweenQueueSystem = tweenQueueSystem;
_mantleSystem = GetNode<MantleSystem>("MantleSystem"); MantleSystem = GetNode<MantleSystem>("MantleSystem");
_mantleSystem.Init(); MantleSystem.Init();
_dashTarget = GetNode<MeshInstance3D>("DashTarget"); _dashTarget = GetNode<MeshInstance3D>("DashTarget");
_dashTarget.SetVisible(false); _dashTarget.SetVisible(false);
@@ -111,14 +100,15 @@ public partial class DashSystem: Node3D
(HasHit, PlannedLocation, CollisionPoint, CollisionNormal) = ComputeDashLocation(); (HasHit, PlannedLocation, CollisionPoint, CollisionNormal) = ComputeDashLocation();
ShouldMantle = false; // TODO: Position mantle system to planned location, aligned with ground planned and facing the same way as the dash
var mantleLocation = Vector3.Zero; // Then query it being careful when dashing underneath a platform and such
if (HasHit && Mathf.Abs(CollisionNormal.Y) < 0.5f) MantleSystem.SetGlobalPosition(PlannedLocation);
{ MantleSystem.SetRotation(new Vector3(
var mantleResult = _mantleSystem.FindMantleLocationAtPoint(PlannedLocation, CollisionNormal); MantleSystem.Rotation.X,
ShouldMantle = mantleResult.IsSome(out mantleLocation); _head.Rotation.Y,
} MantleSystem.Rotation.Z));
PlannedMantleLocation = mantleLocation; MantleSystem.ProcessMantle(false);
ShouldMantle = MantleSystem.IsMantlePossible;
// Setup dash target // Setup dash target
var targetColor = HasHit ? new Color(1f, 0.2f, 0.2f) : new Color(1f, 1f, 1f); var targetColor = HasHit ? new Color(1f, 0.2f, 0.2f) : new Color(1f, 1f, 1f);
@@ -126,7 +116,7 @@ public partial class DashSystem: Node3D
var targetMaterial = (StandardMaterial3D) _dashTarget.GetSurfaceOverrideMaterial(0); var targetMaterial = (StandardMaterial3D) _dashTarget.GetSurfaceOverrideMaterial(0);
targetMaterial.SetAlbedo(targetColor); targetMaterial.SetAlbedo(targetColor);
_dashTarget.SetVisible(true); _dashTarget.SetVisible(true);
var targetLocation = ShouldMantle ? PlannedMantleLocation : PlannedLocation; var targetLocation = ShouldMantle ? MantleSystem.FirstMantleProfilePoint : PlannedLocation;
_dashTarget.SetGlobalPosition(targetLocation); _dashTarget.SetGlobalPosition(targetLocation);
var shouldShowDropIndicator = !HasHit && !ShouldMantle; var shouldShowDropIndicator = !HasHit && !ShouldMantle;
@@ -162,6 +152,5 @@ public partial class DashSystem: Node3D
public void StartPreparingDash() public void StartPreparingDash()
{ {
_dashTarget.SetVisible(true); _dashTarget.SetVisible(true);
} }
} }

View File

@@ -1,7 +1,6 @@
[gd_scene load_steps=10 format=3 uid="uid://cqduhd4opgwvm"] [gd_scene load_steps=9 format=3 uid="uid://cqduhd4opgwvm"]
[ext_resource type="Script" uid="uid://dwoppk8j5fxeg" path="res://systems/dash/DashSystem.cs" id="1_hwig2"] [ext_resource type="Script" uid="uid://dwoppk8j5fxeg" path="res://systems/dash/DashSystem.cs" id="1_hwig2"]
[ext_resource type="Shape3D" uid="uid://keseacdcooot" path="res://player_controller/resources/PlayerShape.tres" id="2_jngg2"]
[ext_resource type="PackedScene" uid="uid://wq1okogkhc5l" path="res://systems/mantle/mantle_system.tscn" id="2_pff7b"] [ext_resource type="PackedScene" uid="uid://wq1okogkhc5l" path="res://systems/mantle/mantle_system.tscn" id="2_pff7b"]
[ext_resource type="PackedScene" uid="uid://hd0868f4pb63" path="res://systems/dash/dash_indicator.tscn" id="2_tqt6i"] [ext_resource type="PackedScene" uid="uid://hd0868f4pb63" path="res://systems/dash/dash_indicator.tscn" id="2_tqt6i"]
@@ -24,13 +23,6 @@ outer_radius = 0.5
script = ExtResource("1_hwig2") script = ExtResource("1_hwig2")
DashIndicatorScene = ExtResource("2_tqt6i") DashIndicatorScene = ExtResource("2_tqt6i")
[node name="PlayerShapeCast3D" type="ShapeCast3D" parent="."]
visible = false
shape = ExtResource("2_jngg2")
target_position = Vector3(0, 0, 0)
collision_mask = 2
debug_shape_custom_color = Color(0.863327, 0.636844, 0, 1)
[node name="DashCast3D" type="ShapeCast3D" parent="."] [node name="DashCast3D" type="ShapeCast3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6, 0)
shape = SubResource("SphereShape3D_jngg2") shape = SubResource("SphereShape3D_jngg2")

View File

@@ -1,5 +1,6 @@
using System; using System;
using Godot; using Godot;
using RustyOptions;
namespace Movementtests.systems; namespace Movementtests.systems;
@@ -11,6 +12,15 @@ public partial class HeadSystem : Node3D
[Export(PropertyHint.Range, "0,10,0.1,or_greater")] [Export(PropertyHint.Range, "0,10,0.1,or_greater")]
public float LookSensitivity { get; set; } = 1f; public float LookSensitivity { get; set; } = 1f;
[Export(PropertyHint.Range, "0.1,50,0.1,or_greater")]
public double CameraInclineAcceleration { get; set; } = 10f;
[Export(PropertyHint.Range, "0,10,0.1,or_greater")]
public float WallRunCameraIncline { get; set; } = 5f;
[Export(PropertyHint.Range, "0,10,0.1,or_greater")]
public float GroundedCameraIncline { get; set; } = 5f;
public void Init() public void Init()
{ {
@@ -25,7 +35,7 @@ public partial class HeadSystem : Node3D
_animationPlayer.Play("mantle"); _animationPlayer.Play("mantle");
} }
public void LookAround(Vector2 lookDir, float sensitivitMultiplier = 1f) public void LookAround(double delta, Vector2 lookDir, Vector3 playerVelocity, Vector3? wallContactPoint = null, float sensitivitMultiplier = 1f)
{ {
// Horizontal movement of head // Horizontal movement of head
float angleForHorizontalRotation = lookDir.X * LookSensitivity * sensitivitMultiplier; float angleForHorizontalRotation = lookDir.X * LookSensitivity * sensitivitMultiplier;
@@ -35,11 +45,33 @@ public partial class HeadSystem : Node3D
Vector3 currentCameraRotation = _cameraAnchor.Rotation; Vector3 currentCameraRotation = _cameraAnchor.Rotation;
currentCameraRotation.X += Convert.ToSingle(lookDir.Y * LookSensitivity * sensitivitMultiplier); currentCameraRotation.X += Convert.ToSingle(lookDir.Y * LookSensitivity * sensitivitMultiplier);
currentCameraRotation.X = Mathf.Clamp(currentCameraRotation.X, Mathf.DegToRad(-90f), Mathf.DegToRad(90f)); currentCameraRotation.X = Mathf.Clamp(currentCameraRotation.X, Mathf.DegToRad(-90f), Mathf.DegToRad(90f));
var isWallRunning = wallContactPoint.HasValue && wallContactPoint.Value.Length() > Mathf.Epsilon;
var cameraIncline = 0f;
if (isWallRunning)
{
var directionToWall = (wallContactPoint.Value - GlobalPosition).Normalized();
var cameraInclineFactor = ComputeCameraInclineFactor(directionToWall);
cameraIncline = Mathf.DegToRad(WallRunCameraIncline * cameraInclineFactor);
}
else
{
var cameraInclineFactor = ComputeCameraInclineFactor(playerVelocity);
cameraIncline = Mathf.DegToRad(GroundedCameraIncline * cameraInclineFactor * -1.0f);
}
currentCameraRotation.Z = (float) Mathf.Lerp(currentCameraRotation.Z, cameraIncline, delta * CameraInclineAcceleration);
_cameraAnchor.Rotation = currentCameraRotation; _cameraAnchor.Rotation = currentCameraRotation;
_camera.GlobalTransform = _cameraAnchor.GetGlobalTransformInterpolated(); _camera.GlobalTransform = _cameraAnchor.GetGlobalTransformInterpolated();
} }
public float ComputeCameraInclineFactor(Vector3 direction)
{
var forward = GetForwardHorizontalVector().Normalized();
var crossProduct = forward.Cross(direction);
return crossProduct.Length()*Mathf.Sign(crossProduct.Y);
}
public Vector3 GetForwardHorizontalVector() public Vector3 GetForwardHorizontalVector()
{ {
return GetGlobalTransform().Basis.Z; return GetGlobalTransform().Basis.Z;

View File

@@ -1,14 +1,31 @@
[gd_scene load_steps=9 format=3 uid="uid://0ysqmqphq6mq"] [gd_scene load_steps=5 format=3 uid="uid://0ysqmqphq6mq"]
[ext_resource type="Script" uid="uid://dtkdrnsmlwm67" path="res://systems/head/HeadSystem.cs" id="1_8abgy"] [ext_resource type="Script" uid="uid://dtkdrnsmlwm67" path="res://systems/head/HeadSystem.cs" id="1_8abgy"]
[ext_resource type="Material" uid="uid://dtq8i1ka1f2pn" path="res://player_controller/Assets/Materials/Health/CameraVignette.tres" id="2_urko7"]
[ext_resource type="Material" uid="uid://nyh5tn1yoxeu" path="res://player_controller/Assets/Materials/Health/CameraDistortion.tres" id="3_0hyrq"]
[ext_resource type="Shader" uid="uid://btw6vsb6sa7sn" path="res://player_controller/Shaders/Blur.gdshader" id="4_ubhf8"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_o1np4"] [sub_resource type="Animation" id="Animation_urko7"]
shader = ExtResource("4_ubhf8") length = 0.001
shader_parameter/limit = 0.0 tracks/0/type = "bezier"
shader_parameter/blur = 0.0 tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("..:rotation:x")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.15, 0, 0.15, 0),
"times": PackedFloat32Array(0)
}
tracks/1/type = "bezier"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("..:rotation:z")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.15, 0, 0.15, 0),
"times": PackedFloat32Array(0)
}
[sub_resource type="Animation" id="Animation_8abgy"] [sub_resource type="Animation" id="Animation_8abgy"]
resource_name = "mantle" resource_name = "mantle"
@@ -36,31 +53,6 @@ tracks/1/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3) "times": PackedFloat32Array(0, 0.1, 0.2, 0.3)
} }
[sub_resource type="Animation" id="Animation_urko7"]
length = 0.001
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("..:rotation:x")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.15, 0, 0.15, 0),
"times": PackedFloat32Array(0)
}
tracks/1/type = "bezier"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("..:rotation:z")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.15, 0, 0.15, 0),
"times": PackedFloat32Array(0)
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_0hyrq"] [sub_resource type="AnimationLibrary" id="AnimationLibrary_0hyrq"]
_data = { _data = {
&"RESET": SubResource("Animation_urko7"), &"RESET": SubResource("Animation_urko7"),
@@ -77,41 +69,6 @@ transform = Transform3D(1, 0, 0, 0, 0.99999994, 0, 0, 0, 0.99999994, 0, 0, 0)
current = true current = true
fov = 90.0 fov = 90.0
[node name="CLVignette(Layer_1)" type="CanvasLayer" parent="CameraSmooth/Camera3D"]
[node name="HealthVignetteRect" type="ColorRect" parent="CameraSmooth/Camera3D/CLVignette(Layer_1)"]
material = ExtResource("2_urko7")
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="CLDistortion(Layer_2)" type="CanvasLayer" parent="CameraSmooth/Camera3D"]
layer = 2
[node name="HealthDistortionRect" type="ColorRect" parent="CameraSmooth/Camera3D/CLDistortion(Layer_2)"]
material = ExtResource("3_0hyrq")
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="CLBlur(Layer_2)" type="CanvasLayer" parent="CameraSmooth/Camera3D"]
layer = 2
[node name="BlurRect" type="ColorRect" parent="CameraSmooth/Camera3D/CLBlur(Layer_2)"]
material = SubResource("ShaderMaterial_o1np4")
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="RayCast3D" type="RayCast3D" parent="CameraSmooth/Camera3D"] [node name="RayCast3D" type="RayCast3D" parent="CameraSmooth/Camera3D"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, -0.64723) transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, -0.64723)
visible = false visible = false

View File

@@ -1,4 +1,4 @@
[gd_resource type="Resource" script_class="GUIDEMappingContext" load_steps=78 format=3 uid="uid://c2hpxkcujyc13"] [gd_resource type="Resource" script_class="GUIDEMappingContext" load_steps=66 format=3 uid="uid://c2hpxkcujyc13"]
[ext_resource type="Script" uid="uid://cpplm41b5bt6m" path="res://addons/guide/guide_action_mapping.gd" id="1_xno0b"] [ext_resource type="Script" uid="uid://cpplm41b5bt6m" path="res://addons/guide/guide_action_mapping.gd" id="1_xno0b"]
[ext_resource type="Resource" uid="uid://ck43v3q5ype3f" path="res://systems/inputs/menu_mode/back.tres" id="2_6sfub"] [ext_resource type="Resource" uid="uid://ck43v3q5ype3f" path="res://systems/inputs/menu_mode/back.tres" id="2_6sfub"]
@@ -16,7 +16,6 @@
[ext_resource type="Resource" uid="uid://by80bubgg0dpx" path="res://systems/inputs/menu_mode/left.tres" id="13_sy651"] [ext_resource type="Resource" uid="uid://by80bubgg0dpx" path="res://systems/inputs/menu_mode/left.tres" id="13_sy651"]
[ext_resource type="Resource" uid="uid://bmef0jo6o41ic" path="res://systems/inputs/menu_mode/next.tres" id="14_2sr1w"] [ext_resource type="Resource" uid="uid://bmef0jo6o41ic" path="res://systems/inputs/menu_mode/next.tres" id="14_2sr1w"]
[ext_resource type="Resource" uid="uid://c3n6ww58cmbbk" path="res://systems/inputs/menu_mode/previous.tres" id="15_2j2sf"] [ext_resource type="Resource" uid="uid://c3n6ww58cmbbk" path="res://systems/inputs/menu_mode/previous.tres" id="15_2j2sf"]
[ext_resource type="Resource" uid="uid://dgluj0ql5vth7" path="res://systems/inputs/base_mode/pause.tres" id="16_scydb"]
[sub_resource type="Resource" id="Resource_tp5dr"] [sub_resource type="Resource" id="Resource_tp5dr"]
script = ExtResource("4_q6ncx") script = ExtResource("4_q6ncx")
@@ -30,16 +29,11 @@ script = ExtResource("3_scydb")
input = SubResource("Resource_tp5dr") input = SubResource("Resource_tp5dr")
triggers = Array[ExtResource("6_c647i")]([SubResource("Resource_lvbl0")]) triggers = Array[ExtResource("6_c647i")]([SubResource("Resource_lvbl0")])
[sub_resource type="Resource" id="Resource_h2f8g"]
script = ExtResource("8_yfqfy")
key = 4194305
[sub_resource type="Resource" id="Resource_17mt7"] [sub_resource type="Resource" id="Resource_17mt7"]
script = ExtResource("7_m88dc") script = ExtResource("7_m88dc")
[sub_resource type="Resource" id="Resource_23hmj"] [sub_resource type="Resource" id="Resource_23hmj"]
script = ExtResource("3_scydb") script = ExtResource("3_scydb")
input = SubResource("Resource_h2f8g")
triggers = Array[ExtResource("6_c647i")]([SubResource("Resource_17mt7")]) triggers = Array[ExtResource("6_c647i")]([SubResource("Resource_17mt7")])
[sub_resource type="Resource" id="Resource_len71"] [sub_resource type="Resource" id="Resource_len71"]
@@ -225,48 +219,7 @@ script = ExtResource("1_xno0b")
action = ExtResource("15_2j2sf") action = ExtResource("15_2j2sf")
input_mappings = Array[ExtResource("3_scydb")]([SubResource("Resource_3owmx")]) input_mappings = Array[ExtResource("3_scydb")]([SubResource("Resource_3owmx")])
[sub_resource type="Resource" id="Resource_q6ncx"]
script = ExtResource("4_q6ncx")
button = 4
[sub_resource type="Resource" id="Resource_vnf02"]
script = ExtResource("7_m88dc")
[sub_resource type="Resource" id="Resource_c647i"]
script = ExtResource("3_scydb")
input = SubResource("Resource_q6ncx")
triggers = Array[ExtResource("6_c647i")]([SubResource("Resource_vnf02")])
[sub_resource type="Resource" id="Resource_m88dc"]
script = ExtResource("4_q6ncx")
button = 6
[sub_resource type="Resource" id="Resource_yfqfy"]
script = ExtResource("7_m88dc")
[sub_resource type="Resource" id="Resource_dsdj3"]
script = ExtResource("3_scydb")
input = SubResource("Resource_m88dc")
triggers = Array[ExtResource("6_c647i")]([SubResource("Resource_yfqfy")])
[sub_resource type="Resource" id="Resource_q44ew"]
script = ExtResource("8_yfqfy")
key = 4194305
[sub_resource type="Resource" id="Resource_as826"]
script = ExtResource("7_m88dc")
[sub_resource type="Resource" id="Resource_erftc"]
script = ExtResource("3_scydb")
input = SubResource("Resource_q44ew")
triggers = Array[ExtResource("6_c647i")]([SubResource("Resource_as826")])
[sub_resource type="Resource" id="Resource_sy651"]
script = ExtResource("1_xno0b")
action = ExtResource("16_scydb")
input_mappings = Array[ExtResource("3_scydb")]([SubResource("Resource_c647i"), SubResource("Resource_dsdj3"), SubResource("Resource_erftc")])
[resource] [resource]
script = ExtResource("2_w5wm7") script = ExtResource("2_w5wm7")
mappings = Array[ExtResource("1_xno0b")]([SubResource("Resource_len71"), SubResource("Resource_ruq4f"), SubResource("Resource_5hp22"), SubResource("Resource_7i3b3"), SubResource("Resource_6ptcp"), SubResource("Resource_xked7"), SubResource("Resource_qjv8h"), SubResource("Resource_p0ahg"), SubResource("Resource_sy651")]) mappings = Array[ExtResource("1_xno0b")]([SubResource("Resource_len71"), SubResource("Resource_ruq4f"), SubResource("Resource_5hp22"), SubResource("Resource_7i3b3"), SubResource("Resource_6ptcp"), SubResource("Resource_xked7"), SubResource("Resource_qjv8h"), SubResource("Resource_p0ahg")])
metadata/_custom_type_script = "uid://dsa1dnifd6w32" metadata/_custom_type_script = "uid://dsa1dnifd6w32"

View File

@@ -14,42 +14,113 @@ public partial class MantleSystem: Node3D
private ShapeCast3D _wallInFrontCast3D; private ShapeCast3D _wallInFrontCast3D;
private ShapeCast3D _mantleCast3D; private ShapeCast3D _mantleCast3D;
private RayCast3D _mantleCheckCast3D;
private ShapeCast3D _inAirWallDetect;
private ShapeCast3D _groundedWallDetect;
public Curve3D MantleCurve { get; private set; }
public Vector3 FirstMantleProfilePoint { get; private set; } = Vector3.Zero;
public bool IsMantlePossible { get; private set; } = false;
public bool EndedOnOtherSideOfWall { get; private set; } = false;
public bool FoundGround { get; private set; } = false;
public const int WallProfileCastCount = 7;
private ShapeCast3D[] _wallProfileShapecasts = new ShapeCast3D[WallProfileCastCount];
public void Init() public void Init()
{ {
_wallInFrontCast3D = GetNode<ShapeCast3D>("WallInFrontCast3D"); _wallInFrontCast3D = GetNode<ShapeCast3D>("WallInFrontCast3D");
_mantleCast3D = GetNode<ShapeCast3D>("MantleCast3D"); _mantleCast3D = GetNode<ShapeCast3D>("MantleCast3D");
}
_inAirWallDetect = GetNode<ShapeCast3D>("InAirWallDetect");
public Option<Vector3> FindMantleForHeadRotation(float rotation) _groundedWallDetect = GetNode<ShapeCast3D>("GroundedWallDetect");
{ for (int i = 0; i < _wallProfileShapecasts.Length; i++)
_wallInFrontCast3D.SetRotation(new Vector3(
_wallInFrontCast3D.Rotation.X,
rotation,
_wallInFrontCast3D.Rotation.Z));
if (!_wallInFrontCast3D.IsColliding())
{ {
return Option<Vector3>.None; _wallProfileShapecasts[i] = GetNode<ShapeCast3D>($"WallProfileShapeCasts/ShapeCast{i + 1}");
} }
var collisionPoint = _wallInFrontCast3D.GetCollisionPoint(0);
var collisionNormal = _wallInFrontCast3D.GetCollisionNormal(0);
return FindMantleLocationAtPoint(collisionPoint, collisionNormal);
} }
public Option<Vector3> FindMantleLocationAtPoint(Vector3 point, Vector3 wallNormal) private void SetCastsEnabled(bool enabled)
{ {
var horizontalEndLocation = point - wallNormal * MantleEndLocationDistanceFromWall; foreach (var wallProfileShapecast in _wallProfileShapecasts)
var shapeCastStartLocation = horizontalEndLocation + Vector3.Up * MantleHeightCastStart; {
wallProfileShapecast.SetEnabled(enabled);
}
}
public void ProcessMantle(bool isGrounded)
{
_inAirWallDetect.SetEnabled(!isGrounded);
_groundedWallDetect.SetEnabled(isGrounded);
var isColliding = _inAirWallDetect.IsColliding() || _groundedWallDetect.IsColliding();
SetCastsEnabled(isColliding);
_mantleCast3D.SetGlobalPosition(shapeCastStartLocation); // Reset state
var targetLocation = Vector3.Down * MantleHeightCastStart + Vector3.Up * MaxStepHeight; IsMantlePossible = false;
_mantleCast3D.SetTargetPosition(targetLocation); EndedOnOtherSideOfWall = false;
FoundGround = false;
if (!isColliding) return;
if (_mantleCast3D.IsColliding() && _mantleCast3D.GetCollisionNormal(0).Y >= 0.1f) // Check if face something wall-like that should be climbable
return Option.Some(_mantleCast3D.GetCollisionPoint(0)); var collisionNormal = isGrounded ? _groundedWallDetect.GetCollisionNormal(0) : _inAirWallDetect.GetCollisionNormal(0);
return Option<Vector3>.None; if (collisionNormal.Y > 0.7f) return;
var spaceState = GetWorld3D().DirectSpaceState;
MantleCurve = new Curve3D();
MantleCurve.AddPoint(Vector3.Zero);
var hasFirstProfileHit = false;
var previousProfilePoint = GlobalPosition;
foreach (var wallProfileShapecast in _wallProfileShapecasts)
{
// Haven't met the wall yet
if (!wallProfileShapecast.IsColliding() && !hasFirstProfileHit) continue;
var globalTargetPosition = wallProfileShapecast.GlobalPosition + wallProfileShapecast.TargetPosition;
// Got to the other side of the wall, we stop there
if (!wallProfileShapecast.IsColliding())
{
/*EndedOnOtherSideOfWall = true;
var origin = globalTargetPosition;
var end = origin + Vector3.Down*0.51f; // We check for the ground a bit below our target
var groundQuery = PhysicsRayQueryParameters3D.Create(origin, end, wallProfileShapecast.CollisionMask);
var groundResult = spaceState.IntersectRay(groundQuery);
if (groundResult.Count > 0)
{
// We found the ground, this is our final location
FoundGround = true;
Vector3 position = (Vector3) groundResult["position"];
MantleCurve.AddPoint(ToLocal(position));
}*/
break;
}
var profilePoint = wallProfileShapecast.GetCollisionPoint(0);
var profileNormal = wallProfileShapecast.GetCollisionNormal(0);
var shape = wallProfileShapecast.Shape as SphereShape3D;
var shapeRadius = shape == null ? 0.125f : shape.Radius;
var centerOfShape = profilePoint + profileNormal * shapeRadius;
// Check if we collided parallel to a wall
var isCollisionSameAsTarget = globalTargetPosition.IsEqualApprox(centerOfShape);
var isCollidingWithWall = profileNormal.Y < 0.1f;
if (isCollisionSameAsTarget || isCollidingWithWall) continue;
// Check if the path from the previous point makes us go through a wall
var query = PhysicsRayQueryParameters3D.Create(previousProfilePoint, centerOfShape, wallProfileShapecast.CollisionMask);
var result = spaceState.IntersectRay(query);
if (result.Count > 0) break; // We are going through a wall, we stop there
// We have a valid collision
if (!hasFirstProfileHit) FirstMantleProfilePoint = centerOfShape;
hasFirstProfileHit = true;
previousProfilePoint = centerOfShape;
MantleCurve.AddPoint(ToLocal(centerOfShape));
}
if (MantleCurve.PointCount == 1) return;
IsMantlePossible = true;
} }
} }

View File

@@ -0,0 +1,4 @@
[gd_resource type="SphereShape3D" format=3 uid="uid://dp2p8v7demb5j"]
[resource]
radius = 0.25

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=4 format=3 uid="uid://wq1okogkhc5l"] [gd_scene load_steps=7 format=3 uid="uid://wq1okogkhc5l"]
[ext_resource type="Script" uid="uid://bja6tis1vaysu" path="res://systems/mantle/MantleSystem.cs" id="1_2oobp"] [ext_resource type="Script" uid="uid://bja6tis1vaysu" path="res://systems/mantle/MantleSystem.cs" id="1_2oobp"]
@@ -8,12 +8,23 @@ height = 1.7
[sub_resource type="SphereShape3D" id="SphereShape3D_2oobp"] [sub_resource type="SphereShape3D" id="SphereShape3D_2oobp"]
radius = 0.75 radius = 0.75
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_2oobp"]
radius = 0.25
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_i32qj"]
radius = 0.25
height = 1.5
[sub_resource type="SphereShape3D" id="SphereShape3D_i32qj"]
radius = 0.125
[node name="MantleSystem" type="Node3D"] [node name="MantleSystem" type="Node3D"]
script = ExtResource("1_2oobp") script = ExtResource("1_2oobp")
MantleEndLocationDistanceFromWall = 0.2 MantleEndLocationDistanceFromWall = 0.2
MantleHeightCastStart = 3.0 MantleHeightCastStart = 3.0
[node name="MantleCast3D" type="ShapeCast3D" parent="."] [node name="MantleCast3D" type="ShapeCast3D" parent="."]
visible = false
shape = SubResource("CapsuleShape3D_4coqe") shape = SubResource("CapsuleShape3D_4coqe")
target_position = Vector3(0, 0, 0) target_position = Vector3(0, 0, 0)
max_results = 1 max_results = 1
@@ -22,8 +33,72 @@ debug_shape_custom_color = Color(1, 0, 0, 1)
[node name="WallInFrontCast3D" type="ShapeCast3D" parent="."] [node name="WallInFrontCast3D" type="ShapeCast3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
visible = false
shape = SubResource("SphereShape3D_2oobp") shape = SubResource("SphereShape3D_2oobp")
target_position = Vector3(0, 0, -1.5) target_position = Vector3(0, 0, -1.5)
max_results = 1 max_results = 1
collision_mask = 2 collision_mask = 2
debug_shape_custom_color = Color(0.911631, 0.11884, 0.656218, 1) debug_shape_custom_color = Color(0.911631, 0.11884, 0.656218, 1)
[node name="InAirWallDetect" type="ShapeCast3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.01, 0)
shape = SubResource("CapsuleShape3D_2oobp")
target_position = Vector3(0, 0, -2)
collision_mask = 2
[node name="GroundedWallDetect" type="ShapeCast3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.26, 0)
shape = SubResource("CapsuleShape3D_i32qj")
target_position = Vector3(0, 0, -2)
collision_mask = 2
[node name="WallProfileShapeCasts" type="Node3D" parent="."]
[node name="ShapeCast1" type="ShapeCast3D" parent="WallProfileShapeCasts"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, -0.5)
enabled = false
shape = SubResource("SphereShape3D_i32qj")
target_position = Vector3(0, -2.125, 0)
collision_mask = 2
[node name="ShapeCast2" type="ShapeCast3D" parent="WallProfileShapeCasts"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, -0.75)
enabled = false
shape = SubResource("SphereShape3D_i32qj")
target_position = Vector3(0, -2.125, 0)
collision_mask = 2
[node name="ShapeCast3" type="ShapeCast3D" parent="WallProfileShapeCasts"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, -1)
enabled = false
shape = SubResource("SphereShape3D_i32qj")
target_position = Vector3(0, -2.125, 0)
collision_mask = 2
[node name="ShapeCast4" type="ShapeCast3D" parent="WallProfileShapeCasts"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, -1.25)
enabled = false
shape = SubResource("SphereShape3D_i32qj")
target_position = Vector3(0, -2.125, 0)
collision_mask = 2
[node name="ShapeCast5" type="ShapeCast3D" parent="WallProfileShapeCasts"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, -1.5)
enabled = false
shape = SubResource("SphereShape3D_i32qj")
target_position = Vector3(0, -2.125, 0)
collision_mask = 2
[node name="ShapeCast6" type="ShapeCast3D" parent="WallProfileShapeCasts"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, -1.75)
enabled = false
shape = SubResource("SphereShape3D_i32qj")
target_position = Vector3(0, -2.125, 0)
collision_mask = 2
[node name="ShapeCast7" type="ShapeCast3D" parent="WallProfileShapeCasts"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, -2)
enabled = false
shape = SubResource("SphereShape3D_i32qj")
target_position = Vector3(0, -2.125, 0)
collision_mask = 2

View File

@@ -5,8 +5,8 @@ extends Node3D
@export_tool_button("Tuto start", "Callable") var player_tuto_start = place_player_tuto_start @export_tool_button("Tuto start", "Callable") var player_tuto_start = place_player_tuto_start
@export_tool_button("Playground", "Callable") var player_playground = place_player_playground @export_tool_button("Playground", "Callable") var player_playground = place_player_playground
@onready var player: CharacterBody3D = $Player
@onready var player: CharacterBody3D = $Player
func place_player_tuto_start(): func place_player_tuto_start():
player.position = Vector3(0, -132.75, 118) player.position = Vector3(0, -132.75, 118)