From a63c8e03e9f536d78d321cdd234297fd6ce64773 Mon Sep 17 00:00:00 2001 From: Spencer Killen Date: Tue, 27 Dec 2022 13:24:35 -0700 Subject: [PATCH 1/3] various fixes --- godot/assets/meat_creek/side_tunnel_1.tscn | 10 ++++++- .../models/walkie_talkie/signal_generator.gd | 11 +++++++ .../walkie_talkie/signal_generator.tscn | 8 +++++ .../models/walkie_talkie/walkie_talkie.gd | 30 +++++++++---------- .../models/walkie_talkie/walkie_talkie.tscn | 1 + godot/global_event_bus.gd | 6 +++- godot/player/ObjectiveTracker.gd | 13 ++++++++ godot/player/player.gd | 6 +++- godot/player/player.tscn | 6 +++- godot/util.gd | 3 +- 10 files changed, 73 insertions(+), 21 deletions(-) create mode 100644 godot/assets/models/walkie_talkie/signal_generator.gd create mode 100644 godot/assets/models/walkie_talkie/signal_generator.tscn create mode 100644 godot/player/ObjectiveTracker.gd diff --git a/godot/assets/meat_creek/side_tunnel_1.tscn b/godot/assets/meat_creek/side_tunnel_1.tscn index 59093c9..130e7f4 100644 --- a/godot/assets/meat_creek/side_tunnel_1.tscn +++ b/godot/assets/meat_creek/side_tunnel_1.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=13 format=2] +[gd_scene load_steps=15 format=2] [ext_resource path="res://assets/meat_creek/side_tunnel_1.glb" type="PackedScene" id=1] [ext_resource path="res://player/player.tscn" type="PackedScene" id=2] @@ -10,6 +10,8 @@ [ext_resource path="res://assets/meat_creek/StaticBody.tscn" type="PackedScene" id=8] [ext_resource path="res://assets/meat_creek/creek_cage.tscn" type="PackedScene" id=9] [ext_resource path="res://assets/models/meat_creek_elevator.tscn" type="PackedScene" id=10] +[ext_resource path="res://assets/audio/walkie_talkie/buzz_static.ogg" type="AudioStream" id=11] +[ext_resource path="res://assets/models/walkie_talkie/signal_generator.tscn" type="PackedScene" id=12] [sub_resource type="PanoramaSky" id=2] panorama = ExtResource( 4 ) @@ -123,3 +125,9 @@ transform = Transform( 0.65383, 0, 0.756641, 0, 1, 0, -0.756641, 0, 0.65383, 18. [node name="elevator" parent="." index="8" instance=ExtResource( 10 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0735546, -35.4611, -41.1766 ) + +[node name="SignalGenerator" parent="." index="9" instance=ExtResource( 12 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.489914, -35.0689, -41.5684 ) +stream = ExtResource( 11 ) +max_db = 6.0 +max_distance = 200.0 diff --git a/godot/assets/models/walkie_talkie/signal_generator.gd b/godot/assets/models/walkie_talkie/signal_generator.gd new file mode 100644 index 0000000..49fd2a1 --- /dev/null +++ b/godot/assets/models/walkie_talkie/signal_generator.gd @@ -0,0 +1,11 @@ +extends AudioStreamPlayer3D + +func _ready(): + var _ignore = GlobalEventBus.connect("player_walkie_talkie_state_change", self, "state") + +func state(is_active: bool): + stream_paused = not is_active + +func _process(_delta): + var distance = (transform.origin - Util.player.camera_position()).length() + GlobalEventBus.emit_signal("player_objective_ping", self, distance) diff --git a/godot/assets/models/walkie_talkie/signal_generator.tscn b/godot/assets/models/walkie_talkie/signal_generator.tscn new file mode 100644 index 0000000..fcf3edf --- /dev/null +++ b/godot/assets/models/walkie_talkie/signal_generator.tscn @@ -0,0 +1,8 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://assets/models/walkie_talkie/signal_generator.gd" type="Script" id=1] + +[node name="SignalGenerator" type="AudioStreamPlayer3D"] +autoplay = true +stream_paused = true +script = ExtResource( 1 ) diff --git a/godot/assets/models/walkie_talkie/walkie_talkie.gd b/godot/assets/models/walkie_talkie/walkie_talkie.gd index 5e382ba..4884ee5 100644 --- a/godot/assets/models/walkie_talkie/walkie_talkie.gd +++ b/godot/assets/models/walkie_talkie/walkie_talkie.gd @@ -5,9 +5,10 @@ onready var fsm: AnimationNodeStateMachinePlayback = $Animations/AnimationTree.g export var default_screen_color = Color(0.886275, 1, 0, 1) export var screen_off_color = Color(0.0, 0.0, 0.0) var is_screen_on: bool +export var screen_flicker_fastest: float = 0.1 +export var screen_flicker_slowest: float = 1.0 onready var util = get_node("/root/Util") -onready var player = util.player func _ready(): is_screen_on = false @@ -35,18 +36,16 @@ func toggle_screen(): func make_active(): if active: return - if fsm.is_playing(): - fsm.travel("WalkieTalkieEnter") - else: - fsm.start("WalkieTalkieEnter") - $StaticBuzz.play() - $StaticFizz.play() - $Talk.play() - $Whale1.play() - $Whale2.play() + fsm.travel("WalkieTalkieEnter") + #$StaticBuzz.play() + #$StaticFizz.play() + #$Talk.play() + #$Whale1.play() + #$Whale2.play() turn_screen_on() $Click.play() active = true + GlobalEventBus.emit_signal("player_walkie_talkie_state_change", true) func make_inactive(): if not active: @@ -60,24 +59,20 @@ func make_inactive(): turn_screen_off() $Click.play() active = false + GlobalEventBus.emit_signal("player_walkie_talkie_state_change", false) func toggle_active(): if active: make_inactive() else: make_active() - -func put_away(): - fsm.travel("WalkieTalkieLeave") - if $DestroyTimer.is_stopped(): - $DestroyTimer.start(1) func _process(_delta): if Input.is_action_just_pressed("toggle_walkie_talkie"): toggle_active() if not active or not fsm.is_playing(): return - if player.is_ground_walking(): + if Util.player.is_ground_walking(): fsm.travel("WalkieTalkieWalking") else: fsm.travel("WalkieTalkieIdle") @@ -85,3 +80,6 @@ func _process(_delta): func _on_ScreenFlicker_timeout(): if active: toggle_screen() + var weight = Util.player.objective_distance() / 115.0 + var time = Util.clamped_lerp(screen_flicker_fastest, screen_flicker_slowest, weight, 0.0) + $Animations/walkie_talkie/Body/ScreenFlicker.start(time) diff --git a/godot/assets/models/walkie_talkie/walkie_talkie.tscn b/godot/assets/models/walkie_talkie/walkie_talkie.tscn index e524f25..76b4be0 100644 --- a/godot/assets/models/walkie_talkie/walkie_talkie.tscn +++ b/godot/assets/models/walkie_talkie/walkie_talkie.tscn @@ -273,6 +273,7 @@ omni_range = 0.449905 [node name="ScreenFlicker" type="Timer" parent="Animations/walkie_talkie/Body"] wait_time = 0.3 +one_shot = true autostart = true [node name="BigKnob" type="MeshInstance" parent="Animations/walkie_talkie"] diff --git a/godot/global_event_bus.gd b/godot/global_event_bus.gd index cec892a..9249f3a 100644 --- a/godot/global_event_bus.gd +++ b/godot/global_event_bus.gd @@ -3,9 +3,13 @@ extends Node # Player enters or leaves an area for a block where they should start slowly sinking into it signal player_entered_meat_sink signal player_exited_meat_sink +signal player_walkie_talkie_state_change(is_active) +signal player_objective_ping(who, distance) -# This is only here to remove warnings about these signals not getting called (they get called by other nodes +# This is only here to remove warnings about these signals not getting called (they get called by other nodes) func never_called(): emit_signal("player_entered_meat_sink") emit_signal("player_exited_meat_sink") + emit_signal("player_walkie_talkie_state_change", false) + emit_signal("player_objective_ping", null, 0.0) diff --git a/godot/player/ObjectiveTracker.gd b/godot/player/ObjectiveTracker.gd new file mode 100644 index 0000000..82a146e --- /dev/null +++ b/godot/player/ObjectiveTracker.gd @@ -0,0 +1,13 @@ +extends Node + +var objective_who: WeakRef = weakref(null) +var objective_distance: float = 0.0 + +func _ready(): + var _ignored = GlobalEventBus.connect("player_objective_ping", self, "update_objective_distance") + +func update_objective_distance(who: Node, distance: float): + var node = objective_who.get_ref() + if node == null or node == who or distance < objective_distance: + objective_who = weakref(who) + objective_distance = distance diff --git a/godot/player/player.gd b/godot/player/player.gd index 92d4efb..1c0c1f8 100644 --- a/godot/player/player.gd +++ b/godot/player/player.gd @@ -1,8 +1,10 @@ extends Spatial -onready var util = get_node("/root/Util") onready var active_physics_node: Spatial = $OnFootPhysics +func _ready(): + Util.player = self + func is_on_foot(): return active_physics_node == $OnFootPhysics @@ -26,3 +28,5 @@ func set_physics_node(node: Spatial): node.global_transform = active_physics_node.global_transform active_physics_node = node +func objective_distance() -> float: + return $ObjectiveTracker.objective_distance diff --git a/godot/player/player.tscn b/godot/player/player.tscn index 2fda23d..2e9eb5f 100644 --- a/godot/player/player.tscn +++ b/godot/player/player.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=29 format=2] +[gd_scene load_steps=30 format=2] [ext_resource path="res://player/CameraController.gd" type="Script" id=1] [ext_resource path="res://player/OnFootPhysics.gd" type="Script" id=2] @@ -20,6 +20,7 @@ [ext_resource path="res://assets/audio/404327__pfranzen__male-grunts-and-groans.ogg" type="AudioStream" id=18] [ext_resource path="res://effects/player/MovementSoundsAnimations.gd" type="Script" id=19] [ext_resource path="res://screens/PauseScreen.tscn" type="PackedScene" id=20] +[ext_resource path="res://player/ObjectiveTracker.gd" type="Script" id=21] [sub_resource type="Animation" id=8] length = 0.001 @@ -254,6 +255,9 @@ anims/opacity = SubResource( 7 ) [node name="PauseScreen" parent="Overlay" instance=ExtResource( 20 )] +[node name="ObjectiveTracker" type="Node" parent="."] +script = ExtResource( 21 ) + [connection signal="area_entered" from="ElevatorPhysics/Area" to="ElevatorPhysics" method="_on_Area_area_entered"] [connection signal="area_exited" from="ElevatorPhysics/Area" to="ElevatorPhysics" method="_on_Area_area_exited"] [connection signal="timeout" from="MovementInput/VerticalTimer" to="MovementInput" method="_on_VerticalTimer_timeout"] diff --git a/godot/util.gd b/godot/util.gd index c919bb5..7b66ad5 100644 --- a/godot/util.gd +++ b/godot/util.gd @@ -1,6 +1,7 @@ extends Node -onready var player = $"/root".find_node("Player", true, false) +# Updated by player +onready var player = null func vec3_componentwise_clamp(vec: Vector3, lower: float, upper: float) -> Vector3: return Vector3( From ba02781ce08c9301b63fccc377437e75000e38f8 Mon Sep 17 00:00:00 2001 From: Spencer Killen Date: Tue, 27 Dec 2022 20:06:15 -0700 Subject: [PATCH 2/3] sound design --- blends/levels/meat_creek_cage.png | 4 +- blends/levels/side_tunnel_1.blend | 4 +- ...e.glb-53be5e6586cbe0df562549341527c2c1.md5 | 4 +- ...e.glb-53be5e6586cbe0df562549341527c2c1.scn | Bin 14852 -> 14313 bytes ...e.ogg-48d354f55ee014cb0a5286b1f3370c6c.md5 | 2 +- ...gg-48d354f55ee014cb0a5286b1f3370c6c.oggstr | Bin 55199 -> 55187 bytes ...e.ogg-a0d08574bcb169191faa5efc68b2178c.md5 | 2 +- ...gg-a0d08574bcb169191faa5efc68b2178c.oggstr | Bin 68507 -> 68495 bytes ...f.glb-6bb48994d7a8085f855df9dd0e75e010.md5 | 3 + ...f.glb-6bb48994d7a8085f855df9dd0e75e010.scn | Bin 0 -> 1310 bytes .../audio/walkie_talkie/high_whale.ogg.import | 2 +- .../walkie_talkie/low_whale_one.ogg.import | 2 +- .../assets/meat_creek/MeatCreekCage.material | 4 +- .../meat_creek/UpperShelfMaterial.material | 3 + godot/assets/meat_creek/WaterSound.gd | 34 + godot/assets/meat_creek/WhaleSounds.gd | 21 + godot/assets/meat_creek/creek_cage.glb | 4 +- godot/assets/meat_creek/creek_cage.tscn | 2 +- godot/assets/meat_creek/side_tunnel_1.tscn | 50 +- godot/assets/meat_creek/upper_shelf.glb | 3 + .../assets/meat_creek/upper_shelf.glb.import | 1065 +++++++++++++++++ .../models/walkie_talkie/walkie_talkie.tscn | 1 + godot/effects/SinkBlock.tscn | 58 +- .../player/MovementSoundsAnimations.gd | 10 +- godot/effects/sink_block_wavy_meat_part.tres | 20 + godot/effects/sink_block_wavy_meat_part2.tres | 20 + godot/effects/tiled_sink_material.material | 4 +- godot/player/OnFootPhysics.gd | 4 +- godot/player/Overlay.gd | 16 +- godot/player/player.tscn | 27 +- 30 files changed, 1332 insertions(+), 37 deletions(-) create mode 100644 godot/.import/upper_shelf.glb-6bb48994d7a8085f855df9dd0e75e010.md5 create mode 100644 godot/.import/upper_shelf.glb-6bb48994d7a8085f855df9dd0e75e010.scn create mode 100644 godot/assets/meat_creek/UpperShelfMaterial.material create mode 100644 godot/assets/meat_creek/WaterSound.gd create mode 100644 godot/assets/meat_creek/WhaleSounds.gd create mode 100644 godot/assets/meat_creek/upper_shelf.glb create mode 100644 godot/assets/meat_creek/upper_shelf.glb.import create mode 100644 godot/effects/sink_block_wavy_meat_part.tres create mode 100644 godot/effects/sink_block_wavy_meat_part2.tres diff --git a/blends/levels/meat_creek_cage.png b/blends/levels/meat_creek_cage.png index 2e5a2a6..18b3ed9 100644 --- a/blends/levels/meat_creek_cage.png +++ b/blends/levels/meat_creek_cage.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1c99916ad060c0518d9a9ce34a71d7278e23ac20a549cc504cb120a1d9eac147 -size 3259584 +oid sha256:c7cd94e4a4422b1a515bbe0cdaca0790dc6b8219399d723fb57d43fc98f77fb2 +size 3208013 diff --git a/blends/levels/side_tunnel_1.blend b/blends/levels/side_tunnel_1.blend index b04fa1d..464995e 100644 --- a/blends/levels/side_tunnel_1.blend +++ b/blends/levels/side_tunnel_1.blend @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dc6a9a2c17161c85e8072237af7786d73edcf5a65a08bb668393fa25fda8e642 -size 17023541 +oid sha256:d0405fa989f0b548df3d1f83892067ca9f46a76f428dc45c2b73c9a55e41349a +size 16981133 diff --git a/godot/.import/creek_cage.glb-53be5e6586cbe0df562549341527c2c1.md5 b/godot/.import/creek_cage.glb-53be5e6586cbe0df562549341527c2c1.md5 index e0d5359..56e0e71 100644 --- a/godot/.import/creek_cage.glb-53be5e6586cbe0df562549341527c2c1.md5 +++ b/godot/.import/creek_cage.glb-53be5e6586cbe0df562549341527c2c1.md5 @@ -1,3 +1,3 @@ -source_md5="a4b045d4090a0a01a253a33da0505cb1" -dest_md5="aa0e8b90fb5b116e0726f81803c8a616" +source_md5="0fd4b06bb4f9ac715836d05cb4e85e7b" +dest_md5="0dddb11d864bd4c870b083fc31fbd6d8" diff --git a/godot/.import/creek_cage.glb-53be5e6586cbe0df562549341527c2c1.scn b/godot/.import/creek_cage.glb-53be5e6586cbe0df562549341527c2c1.scn index 42b1cdc17b11c5de9ade17bc01bdaf4a06f767c8..a393d69ae3e52a879e4c9fc559a95b243fff0ab1 100644 GIT binary patch delta 2941 zcmZ8jeN+=y7N5tLE(?e)k?`RbC=o(p2uz5XiAPP`>K`iNYPYL!Tqy*Dq7YEZhs=n| zQCdH+vuL%}T93Ob6bl<=SF0`aT=)1#@eb?^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4RiD!nW;_H}2h=aqpiGyA7@xu|HcNp7U z!*(Lp*&Via@a^mxj6LzxMV2MGKyPGfYwkZPIKk2-+vK55#uj}xU=MiIRJIX~fi-5U zK&Kc(AQVH@A*E9pP*5Z$}3>#Yu1SVNf^fdiwR}-ADI$hY@(?7gSKN zrs2j-MzFd9hGdEb3=P1Je#+o)JHWrb56lm_VoY#CbW{f_dvT||p$9d1#N=fn349gP zN(FEaLtSw!wj?-ZJgSf3I8Ywv0n)rQJ}8q?)ZoFTVg{Sw1=2^~!K5$WzCY)!U;n!Q zvRg-=KJWiPh0V;G3XqfG4{R`dsQcnr<;4~wS6F_x3$4JywK=VR;fV;)Vei@rMs 0.0: return diff --git a/godot/effects/sink_block_wavy_meat_part.tres b/godot/effects/sink_block_wavy_meat_part.tres new file mode 100644 index 0000000..d7ca1d4 --- /dev/null +++ b/godot/effects/sink_block_wavy_meat_part.tres @@ -0,0 +1,20 @@ +[gd_resource type="ShaderMaterial" load_steps=3 format=2] + +[ext_resource path="res://effects/sink_block_tiled_texture.png" type="Texture" id=1] + +[sub_resource type="Shader" id=12] +code = "shader_type spatial; +render_mode unshaded, cull_front; + +uniform sampler2D texture_albedo : hint_albedo; + +void fragment() { + vec2 uv = SCREEN_UV; + uv.x += sin((TIME + SCREEN_UV.y) * 5.0)/5.0; + ALBEDO = texture(texture_albedo, uv).rgb; +} +" + +[resource] +shader = SubResource( 12 ) +shader_param/texture_albedo = ExtResource( 1 ) diff --git a/godot/effects/sink_block_wavy_meat_part2.tres b/godot/effects/sink_block_wavy_meat_part2.tres new file mode 100644 index 0000000..d7ca1d4 --- /dev/null +++ b/godot/effects/sink_block_wavy_meat_part2.tres @@ -0,0 +1,20 @@ +[gd_resource type="ShaderMaterial" load_steps=3 format=2] + +[ext_resource path="res://effects/sink_block_tiled_texture.png" type="Texture" id=1] + +[sub_resource type="Shader" id=12] +code = "shader_type spatial; +render_mode unshaded, cull_front; + +uniform sampler2D texture_albedo : hint_albedo; + +void fragment() { + vec2 uv = SCREEN_UV; + uv.x += sin((TIME + SCREEN_UV.y) * 5.0)/5.0; + ALBEDO = texture(texture_albedo, uv).rgb; +} +" + +[resource] +shader = SubResource( 12 ) +shader_param/texture_albedo = ExtResource( 1 ) diff --git a/godot/effects/tiled_sink_material.material b/godot/effects/tiled_sink_material.material index c744675..29560ab 100644 --- a/godot/effects/tiled_sink_material.material +++ b/godot/effects/tiled_sink_material.material @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d3d1a4e3ae460f617a8c9e6b1c6efc38bc0844d5748ae509b6e0da2d565716f6 -size 54713616 +oid sha256:f6675e0961b82278a44212a3522647ddda8f9bd04ed8441c47e17a87ffe61bad +size 54724239 diff --git a/godot/player/OnFootPhysics.gd b/godot/player/OnFootPhysics.gd index c1600c8..acf5c0b 100644 --- a/godot/player/OnFootPhysics.gd +++ b/godot/player/OnFootPhysics.gd @@ -92,7 +92,7 @@ func process_velocity(delta: float): func process_falling(): - if not $Floor.is_on_floor: + if not $Floor.is_on_floor and not is_on_floor(): is_falling = true just_landed = false just_landed_medium = false @@ -118,5 +118,5 @@ func decrease_velocity_factor(by: Vector3): func _physics_process(delta): process_velocity(delta) - velocity = move_and_slide(velocity, Vector3.UP, true, 4, 0.785398) + velocity = move_and_slide(velocity, Vector3.UP, true, 4, 1.3217304764) process_falling() diff --git a/godot/player/Overlay.gd b/godot/player/Overlay.gd index 8a8ae2f..b130b17 100644 --- a/godot/player/Overlay.gd +++ b/godot/player/Overlay.gd @@ -5,13 +5,27 @@ extends CanvasLayer onready var OnFootPhysics = get_node("../OnFootPhysics") var will_fall_hard = false +var in_water: int = 0 func _ready(): $HurtScreen.modulate.a = 0.0 + var _ignore = GlobalEventBus.connect("player_entered_meat_sink", self, "enter_water") + _ignore = GlobalEventBus.connect("player_exited_meat_sink", self, "exit_water") -func _process(_delta): +func enter_water(): + print(2) + in_water += 1 + +func exit_water(): + in_water -= 1 + +func _process(delta): if OnFootPhysics.is_falling_velocity_terminal(): will_fall_hard = true if will_fall_hard and OnFootPhysics.is_on_floor(): will_fall_hard = false $HurtScreen/HurtScreenOpacityAnimation.play("opacity") + if in_water: + $WaterScreen.color.a = Util.clamped_lerp($WaterScreen.color.a, 0.55, delta, 0.05) + else: + $WaterScreen.color.a = Util.clamped_lerp($WaterScreen.color.a, 0.0, delta*5, 0.05) diff --git a/godot/player/player.tscn b/godot/player/player.tscn index 2e9eb5f..005c8c9 100644 --- a/godot/player/player.tscn +++ b/godot/player/player.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=30 format=2] +[gd_scene load_steps=33 format=2] [ext_resource path="res://player/CameraController.gd" type="Script" id=1] [ext_resource path="res://player/OnFootPhysics.gd" type="Script" id=2] @@ -21,6 +21,7 @@ [ext_resource path="res://effects/player/MovementSoundsAnimations.gd" type="Script" id=19] [ext_resource path="res://screens/PauseScreen.tscn" type="PackedScene" id=20] [ext_resource path="res://player/ObjectiveTracker.gd" type="Script" id=21] +[ext_resource path="res://effects/sink_block_tiled_texture.png" type="Texture" id=22] [sub_resource type="Animation" id=8] length = 0.001 @@ -150,6 +151,22 @@ tracks/0/keys = { "values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ] } +[sub_resource type="Shader" id=12] +code = "shader_type canvas_item; + +uniform sampler2D texture_albedo : hint_albedo; + +void fragment() { + vec2 uv = SCREEN_UV; + uv.x += sin((TIME + SCREEN_UV.y) * 5.0)/5.0; + COLOR.rgb = texture(texture_albedo, uv).rgb; +} +" + +[sub_resource type="ShaderMaterial" id=13] +shader = SubResource( 12 ) +shader_param/texture_albedo = ExtResource( 22 ) + [node name="Player" type="Spatial"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.750395, 0 ) script = ExtResource( 3 ) @@ -215,7 +232,7 @@ script = ExtResource( 19 ) [node name="Footsteps" type="AudioStreamPlayer" parent="MovementSoundsAnimations"] stream = ExtResource( 17 ) -volume_db = -1.0 +volume_db = -15.0 [node name="Timer" type="Timer" parent="MovementSoundsAnimations/Footsteps"] one_shot = true @@ -255,6 +272,12 @@ anims/opacity = SubResource( 7 ) [node name="PauseScreen" parent="Overlay" instance=ExtResource( 20 )] +[node name="WaterScreen" type="ColorRect" parent="Overlay"] +material = SubResource( 13 ) +anchor_right = 1.0 +anchor_bottom = 1.0 +color = Color( 1, 1, 1, 0 ) + [node name="ObjectiveTracker" type="Node" parent="."] script = ExtResource( 21 ) From 7bd52b4507f34721b9c7267dc1f7b842b99888e5 Mon Sep 17 00:00:00 2001 From: Spencer Killen Date: Wed, 28 Dec 2022 10:37:27 -0700 Subject: [PATCH 3/3] Add ground gravity --- blends/levels/creek_platform.blend | 4 ++-- ...m.glb-1859edb1b8317bf2ecdd06bde0c60721.md5 | 4 ++-- ...m.glb-1859edb1b8317bf2ecdd06bde0c60721.scn | Bin 9676 -> 11552 bytes godot/assets/meat_creek/creek_platform.glb | 4 ++-- godot/assets/meat_creek/side_tunnel_1.tscn | 3 ++- godot/player/OnFootPhysics.gd | 3 +++ godot/player/Overlay.gd | 1 - 7 files changed, 11 insertions(+), 8 deletions(-) diff --git a/blends/levels/creek_platform.blend b/blends/levels/creek_platform.blend index cc49992..dcf38d2 100644 --- a/blends/levels/creek_platform.blend +++ b/blends/levels/creek_platform.blend @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:537cfda7d86992a647a0e68dec9a4a13adf6b4e44ef096a21893fbcddf1ca739 -size 955672 +oid sha256:ca44bd9c4ee433d62b87a0f990c8c39d42ccbba68ee704d1a7e45a82de921174 +size 940308 diff --git a/godot/.import/creek_platform.glb-1859edb1b8317bf2ecdd06bde0c60721.md5 b/godot/.import/creek_platform.glb-1859edb1b8317bf2ecdd06bde0c60721.md5 index b4afc95..23d4c9b 100644 --- a/godot/.import/creek_platform.glb-1859edb1b8317bf2ecdd06bde0c60721.md5 +++ b/godot/.import/creek_platform.glb-1859edb1b8317bf2ecdd06bde0c60721.md5 @@ -1,3 +1,3 @@ -source_md5="dc558dbf7581e287a28daca6be3a1cca" -dest_md5="c542e847721acd50c307244492ab8175" +source_md5="972d81b0bd575b1c674dc10df9a572c3" +dest_md5="9b133d04e1308f2e5962308f1d907e03" diff --git a/godot/.import/creek_platform.glb-1859edb1b8317bf2ecdd06bde0c60721.scn b/godot/.import/creek_platform.glb-1859edb1b8317bf2ecdd06bde0c60721.scn index 904a632b96b9769dc0b3783916435c073276b056..3233c443432c997c2a79531dea42bb6531b23079 100644 GIT binary patch delta 4370 zcmZ9Qdt6l27RT2@5E1bG00D);2O-_fG>+HSPo?$*- z82@^@;~Dl?F|2$UXM0=>s%_y)f2pRpGJ}k<<`Q+Camho6^+LrhXHBtbMX8viOMg&X zFMCVXH=NZQYqHafOU>?H^QtxC3;H#Z#wq7L^1tjnSaD*`R^xkScdu#L8nM8z+pEY~ zb=YA&vCHW^PB0;Tj zPrQ`bAjS*6*u6ZNf2ysoZmL@8VT`f3dnXs>3wyM=I637dsvqiVF1@zA+%VVT?wu(} z6D&H{-0%mr*5gvkw#D5ISn zSsz8+u-$LDnXQd}M(essa~suxx~3m%t;!`t zJ^z-P0Tq$oi|$^BybbF4dUKJ+Cg;hE4!kOz2s{>XKy){I+Bc{t8@}@@vbj!S;KygW ztsRmsx_hde26e3QXB?;NSfj5ud9NPgE4q8y+?eQ&rls{x<;8NF^w%3Y9FC|rFO}R( z%bfGkjix(TnY==|@58Si;|-C^%C zbNd42kJxl)S+7*>k@f|)dZu|v!U)lI3i3xby{<&+R~oxda5v3Ml7%DfM;L|gfOJPm zPNQz0;5yb;Pbf?i`deHrc?VxAGb-0-J*Ph+xO;|G`9hJ!)nfTeYI?=ij4p;|!CaKo zdKp^HQ_Cgc@}Cmp3*HhVHLi;!e-lpIxI1IB;gR6(Sr^sD^+@X|UDkQp{Hq++n|bG* zR9tKyWOyiypE}eQb=qN#?{rA^f~)joR$Wb08qnggPVolmdz<&I$WpxgY>Shge?H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2$dC>W9?G0 z@!VUBidV5Jr)4B}mOf5dRgR2PWARvK494T_(koBPcKJQtDzD0u@DF&4yeW^uAl@i% z%O=>5H^@=BA0ESxiAScxMy#lK27UG;b#0Iy*)0vS4!4qdyR_=^GQkt1-U?sCkC1u` zJcxfo>W%PEcs;2%z;|(@OeJ-rG~pk)8RJPmg6ria*(3F`7H=bSD-7Vr$@~O-9Y0Lw zN8nr7FZyA55FL@j?CM?8uao0AmhPs{d9t$A_uPO~coo-?-YRwc#2$Hy)Z5@b+(hcf z;T!lNQa=p;h;=gaBl2h5K<0JuJ-k(%;(|}=1Xt*Mle)q)kgT4T-$@&V@5RmXinPG} zxRKON@BrRS>WAPV`~azS_ztd@zi{$;If0wSAw{qSU*xF~_$6+Wy==dY?0dPT`$ca? zuM#{)>PFayH<5ZXd>h|S>IdLaTu179xEF7ee6hn;e1Rt}9Da_^@zlh?Pw_BM#~64P zpWz`G2T$WuG=uW{fzRPx@`H%lB|C8!QJCstOjNgosc_hZpO1B^)$CFkn*#bu>SxmaO4C4 diff --git a/godot/assets/meat_creek/creek_platform.glb b/godot/assets/meat_creek/creek_platform.glb index a6693f3..434a858 100644 --- a/godot/assets/meat_creek/creek_platform.glb +++ b/godot/assets/meat_creek/creek_platform.glb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:df4162a9e6d0cb18dfbcb07d358573d4843422d28991f7327295f552d4114bee -size 1208996 +oid sha256:3c5d1b921c2bc4c37deffb7acef269761d65c33a46f54197483d3ae5f0850e8f +size 1211656 diff --git a/godot/assets/meat_creek/side_tunnel_1.tscn b/godot/assets/meat_creek/side_tunnel_1.tscn index 74ea41a..2b84c31 100644 --- a/godot/assets/meat_creek/side_tunnel_1.tscn +++ b/godot/assets/meat_creek/side_tunnel_1.tscn @@ -61,7 +61,7 @@ transform = Transform( 0.0716538, 0, 0.99743, 0, 1, 0, -0.99743, 0, 0.0716538, - environment = SubResource( 3 ) [node name="SinkBlock" parent="." index="4" instance=ExtResource( 5 )] -transform = Transform( 80, 0, 0, 0, 6.74679, 0, 0, 0, 80, 0, -5.81972, -43.3626 ) +transform = Transform( 80, 0, 0, 0, 3.87358, 0, 0, 0, 80, 0, -3.3489, -43.3626 ) [node name="platforms" type="Spatial" parent="." index="5"] @@ -139,6 +139,7 @@ max_db = 6.0 max_distance = 200.0 [node name="upper_shelf" parent="." index="10" instance=ExtResource( 13 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.09789, 0 ) [node name="AmbientSounds" type="Node" parent="." index="11"] diff --git a/godot/player/OnFootPhysics.gd b/godot/player/OnFootPhysics.gd index acf5c0b..73cbffd 100644 --- a/godot/player/OnFootPhysics.gd +++ b/godot/player/OnFootPhysics.gd @@ -5,6 +5,7 @@ onready var util = get_node("/root/Util") export var gravity: float = 6.0 # When falling, gravity is artificially increased export var gravity_downwards_factor: float = 3 +export var ground_gravity: float = 3.1 # Rate of gaining speed export var velocity_acceleration_xz: float = 3 export var velocity_acceleration_y: float = 5 @@ -51,6 +52,8 @@ func process_velocity(delta: float): else: velocity.y = max(0.0, velocity.y) target_velocity.y = max(0.0, max(target_velocity.y, jump_power * $"../MovementInput".jump_intent * jump_permission)) + if target_velocity.y == 0.0 and velocity.y == 0.0: + velocity.y = -ground_gravity if not is_jumping and $"../MovementInput".jump_intent != 0.0 and is_on_floor(): jump_permission = 0.0 is_jumping = true diff --git a/godot/player/Overlay.gd b/godot/player/Overlay.gd index b130b17..ab8cf15 100644 --- a/godot/player/Overlay.gd +++ b/godot/player/Overlay.gd @@ -13,7 +13,6 @@ func _ready(): _ignore = GlobalEventBus.connect("player_exited_meat_sink", self, "exit_water") func enter_water(): - print(2) in_water += 1 func exit_water():