diff --git a/godot/.import/stringy_meat.jpg-8af41dda9bee7ed09f987b508cf64292.etc2.stex b/godot/.import/stringy_meat.jpg-8af41dda9bee7ed09f987b508cf64292.etc2.stex new file mode 100644 index 0000000..88eb6fd Binary files /dev/null and b/godot/.import/stringy_meat.jpg-8af41dda9bee7ed09f987b508cf64292.etc2.stex differ diff --git a/godot/.import/stringy_meat.jpg-8af41dda9bee7ed09f987b508cf64292.md5 b/godot/.import/stringy_meat.jpg-8af41dda9bee7ed09f987b508cf64292.md5 new file mode 100644 index 0000000..f63718f --- /dev/null +++ b/godot/.import/stringy_meat.jpg-8af41dda9bee7ed09f987b508cf64292.md5 @@ -0,0 +1,3 @@ +source_md5="b69e58a3b703963508b0c45580e92b83" +dest_md5="0521cc0071c51c7730c641f4be12d07b" + diff --git a/godot/.import/stringy_meat.jpg-8af41dda9bee7ed09f987b508cf64292.s3tc.stex b/godot/.import/stringy_meat.jpg-8af41dda9bee7ed09f987b508cf64292.s3tc.stex new file mode 100644 index 0000000..736675c Binary files /dev/null and b/godot/.import/stringy_meat.jpg-8af41dda9bee7ed09f987b508cf64292.s3tc.stex differ diff --git a/godot/.import/stringy_meat.jpg-8af41dda9bee7ed09f987b508cf64292.stex b/godot/.import/stringy_meat.jpg-8af41dda9bee7ed09f987b508cf64292.stex new file mode 100644 index 0000000..56a1a37 Binary files /dev/null and b/godot/.import/stringy_meat.jpg-8af41dda9bee7ed09f987b508cf64292.stex differ diff --git a/godot/.mono/metadata/ide_messaging_meta.txt b/godot/.mono/metadata/ide_messaging_meta.txt index 2e743dd..ed26ace 100644 --- a/godot/.mono/metadata/ide_messaging_meta.txt +++ b/godot/.mono/metadata/ide_messaging_meta.txt @@ -1,2 +1,2 @@ -43123 +35121 /home/squirrel/.local/bin/godot_mono diff --git a/godot/assets/stringy_meat.jpg b/godot/assets/stringy_meat.jpg new file mode 100644 index 0000000..e36aac0 --- /dev/null +++ b/godot/assets/stringy_meat.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb44abfb63ea9a11baf3562a686a6023c8a2a2a2a361ddfd05fb9bb639c612a5 +size 3092477 diff --git a/godot/assets/stringy_meat.jpg.import b/godot/assets/stringy_meat.jpg.import new file mode 100644 index 0000000..96ccb4b --- /dev/null +++ b/godot/assets/stringy_meat.jpg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="StreamTexture" +path.s3tc="res://.import/stringy_meat.jpg-8af41dda9bee7ed09f987b508cf64292.s3tc.stex" +path.etc2="res://.import/stringy_meat.jpg-8af41dda9bee7ed09f987b508cf64292.etc2.stex" +metadata={ +"imported_formats": [ "s3tc", "etc2" ], +"vram_texture": true +} + +[deps] + +source_file="res://assets/stringy_meat.jpg" +dest_files=[ "res://.import/stringy_meat.jpg-8af41dda9bee7ed09f987b508cf64292.s3tc.stex", "res://.import/stringy_meat.jpg-8af41dda9bee7ed09f987b508cf64292.etc2.stex" ] + +[params] + +compress/mode=2 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=true +flags/filter=true +flags/mipmaps=true +flags/anisotropic=false +flags/srgb=1 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/godot/tests/sink_block/SinkRegion.gd b/godot/effects/SinkBlock.gd similarity index 96% rename from godot/tests/sink_block/SinkRegion.gd rename to godot/effects/SinkBlock.gd index ee363cf..2f95481 100644 --- a/godot/tests/sink_block/SinkRegion.gd +++ b/godot/effects/SinkBlock.gd @@ -1,4 +1,4 @@ -extends Area +extends Node onready var util = get_node("/root/Util") onready var global_event_bus = get_node("/root/GlobalEventBus") diff --git a/godot/effects/SinkBlock.tscn b/godot/effects/SinkBlock.tscn new file mode 100644 index 0000000..f71d993 --- /dev/null +++ b/godot/effects/SinkBlock.tscn @@ -0,0 +1,24 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://effects/meat_sink_block_texture.tres" type="Material" id=1] +[ext_resource path="res://effects/SinkBlock.gd" type="Script" id=2] + +[sub_resource type="CubeMesh" id=3] + +[sub_resource type="BoxShape" id=4] + +[node name="SinkBlock" type="MeshInstance"] +transform = Transform( 1, 0, 0, 0, 0.264811, 0, 0, 0, 1, 2.72806, 0.561258, 0 ) +mesh = SubResource( 3 ) +material/0 = ExtResource( 1 ) +script = ExtResource( 2 ) + +[node name="SinkRegion" type="Area" parent="."] +transform = Transform( 1, 0, 0, 0, 3.77628, 0, 0, 0, 1, -2.72806, -2.11947, 0 ) + +[node name="CollisionShape" type="CollisionShape" parent="SinkRegion"] +transform = Transform( 1, 0, 0, 0, 0.264811, 0, 0, 0, 0.988649, 2.72806, 0.561258, 0 ) +shape = SubResource( 4 ) + +[connection signal="body_entered" from="SinkRegion" to="." method="_on_SinkRegion_body_entered"] +[connection signal="body_exited" from="SinkRegion" to="." method="_on_SinkRegion_body_exited"] diff --git a/godot/effects/meat_sink_block_texture.tres b/godot/effects/meat_sink_block_texture.tres new file mode 100644 index 0000000..96fd3a3 --- /dev/null +++ b/godot/effects/meat_sink_block_texture.tres @@ -0,0 +1,66 @@ +[gd_resource type="ShaderMaterial" load_steps=5 format=2] + +[ext_resource path="res://assets/stringy_meat.jpg" type="Texture" id=1] + +[sub_resource type="Shader" id=4] +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; +}" + +[sub_resource type="ShaderMaterial" id=5] +shader = SubResource( 4 ) +shader_param/texture_albedo = ExtResource( 1 ) + +[sub_resource type="Shader" id=3] +code = "// NOTE: Shader automatically converted from Godot Engine 3.5.1.stable.mono's SpatialMaterial. + +shader_type spatial; +render_mode async_visible,blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx; +uniform vec4 albedo : hint_color; +uniform sampler2D texture_albedo : hint_albedo; +uniform float specular; +uniform float metallic; +uniform float roughness : hint_range(0,1); +uniform float point_size : hint_range(0,128); +uniform vec3 uv1_scale; +uniform vec3 uv1_offset; +uniform vec3 uv2_scale; +uniform vec3 uv2_offset; + + +void vertex() { + UV=UV*uv1_scale.xy+uv1_offset.xy; +} + + +void fragment() { + vec2 base_uv = UV; + vec4 albedo_tex = texture(texture_albedo,base_uv); + albedo_tex *= COLOR; + ALBEDO = albedo.rgb * albedo_tex.rgb; + METALLIC = metallic; + ROUGHNESS = roughness; + SPECULAR = specular; +} +" + +[resource] +resource_name = "TestMeat" +next_pass = SubResource( 5 ) +shader = SubResource( 3 ) +shader_param/albedo = Color( 1, 1, 1, 1 ) +shader_param/specular = 0.5 +shader_param/metallic = 0.0 +shader_param/roughness = 1.0 +shader_param/point_size = 1.0 +shader_param/uv1_scale = Vector3( 1, 1, 1 ) +shader_param/uv1_offset = Vector3( 0, 0, 0 ) +shader_param/uv2_scale = Vector3( 1, 1, 1 ) +shader_param/uv2_offset = Vector3( 0, 0, 0 ) +shader_param/texture_albedo = ExtResource( 1 ) diff --git a/godot/player/FallingFOV.gd b/godot/player/FallingFOV.gd deleted file mode 100644 index 4075dd5..0000000 --- a/godot/player/FallingFOV.gd +++ /dev/null @@ -1,15 +0,0 @@ -extends Node - -onready var camera = get_parent() -onready var OnFootPhysics = get_node("../../../../../OnFootPhysics") -onready var default_fov = camera.fov -onready var max_fov = default_fov + 20 -var min_speed = 0.5 - -func _process(_delta): - if OnFootPhysics.velocity.y >= 0.0: - return - var terminal_velocity = -OnFootPhysics.get_terminal_falling_velocity() - var speed = -OnFootPhysics.velocity.y - var weight = (terminal_velocity - speed) / (terminal_velocity - min_speed) - camera.fov = lerp(max_fov, default_fov, weight) diff --git a/godot/player/HighSpeedFOV.gd b/godot/player/HighSpeedFOV.gd new file mode 100644 index 0000000..eabe6ce --- /dev/null +++ b/godot/player/HighSpeedFOV.gd @@ -0,0 +1,18 @@ +extends Node + +onready var camera = get_parent() +onready var OnFootPhysics = get_node("../../../../../OnFootPhysics") +onready var default_fov = camera.fov +onready var max_fov = default_fov + 20 +var min_speed = 0.5 + +# Commenting out code only addresses falling, but FOV should also change a bit when sprinting. +func _process(_delta): + pass + #if OnFootPhysics.velocity.y >= 0.0: + # + # return + #var terminal_velocity = -OnFootPhysics.get_terminal_falling_velocity() + #var speed = -OnFootPhysics.velocity.y + #var weight = (terminal_velocity - speed) / (terminal_velocity - min_speed) + #camera.fov = lerp(max_fov, default_fov, weight) diff --git a/godot/player/PlatformMechanics.gd b/godot/player/PlatformMechanics.gd index a313853..d9243f5 100644 --- a/godot/player/PlatformMechanics.gd +++ b/godot/player/PlatformMechanics.gd @@ -2,7 +2,7 @@ extends Node onready var global_event_bus = get_node("/root/GlobalEventBus") var sink_counter = 0 -export var SINK_BLOCK_SLOWDOWN_AMOUNT = Vector3(0.8, 0.1, 0.8) +export var SINK_BLOCK_SLOWDOWN_AMOUNT = Vector3(0.7, 0.1, 0.7) func _ready(): global_event_bus.connect("player_entered_meat_sink", self, "on_player_enter_meat_sink") diff --git a/godot/player/player.tscn b/godot/player/player.tscn index 367de85..9cfcbc3 100644 --- a/godot/player/player.tscn +++ b/godot/player/player.tscn @@ -10,7 +10,7 @@ [ext_resource path="res://effects/player/Flashlight.tscn" type="PackedScene" id=8] [ext_resource path="res://effects/player/MovementSounds.tscn" type="PackedScene" id=9] [ext_resource path="res://player/CloseToFloor.gd" type="Script" id=10] -[ext_resource path="res://player/FallingFOV.gd" type="Script" id=11] +[ext_resource path="res://player/HighSpeedFOV.gd" type="Script" id=11] [ext_resource path="res://player/Overlay.gd" type="Script" id=12] [ext_resource path="res://assets/BloodMush.png" type="Texture" id=13] @@ -51,7 +51,7 @@ root_node = NodePath("../CameraAnimationFSM") [node name="Flashlight" parent="Smoothing/CameraController/Rotation/Camera" instance=ExtResource( 8 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.00211835, 0 ) -[node name="FallingFOV" type="Node" parent="Smoothing/CameraController/Rotation/Camera"] +[node name="HighSpeedFOV" type="Node" parent="Smoothing/CameraController/Rotation/Camera"] script = ExtResource( 11 ) [node name="OnFootPhysics" type="KinematicBody" parent="."] diff --git a/godot/tests/sink_block/test_sink_block.tscn b/godot/tests/sink_block/test_sink_block.tscn index afdea47..14255be 100644 --- a/godot/tests/sink_block/test_sink_block.tscn +++ b/godot/tests/sink_block/test_sink_block.tscn @@ -1,18 +1,13 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://player/player.tscn" type="PackedScene" id=1] -[ext_resource path="res://tests/sink_block/SinkRegion.gd" type="Script" id=2] -[ext_resource path="res://tests/ground_squish/TestMeat.material" type="Material" id=3] +[ext_resource path="res://effects/SinkBlock.tscn" type="PackedScene" id=2] [sub_resource type="CubeMesh" id=1] [sub_resource type="ConcavePolygonShape" id=2] data = PoolVector3Array( -1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, 1, -1, 1, 1, -1, -1, -1, -1, -1 ) -[sub_resource type="CubeMesh" id=3] - -[sub_resource type="BoxShape" id=4] - [node name="Spatial" type="Spatial"] [node name="MeshInstance" type="MeshInstance" parent="."] @@ -26,18 +21,4 @@ shape = SubResource( 2 ) [node name="Player" parent="." instance=ExtResource( 1 )] -[node name="SinkBlock" type="MeshInstance" parent="."] -transform = Transform( 1, 0, 0, 0, 0.264811, 0, 0, 0, 1, 2.72806, 0.561258, 0 ) -mesh = SubResource( 3 ) -material/0 = ExtResource( 3 ) - -[node name="SinkRegion" type="Area" parent="SinkBlock"] -transform = Transform( 1, 0, 0, 0, 3.77628, 0, 0, 0, 1, -2.72806, -2.11947, 0 ) -script = ExtResource( 2 ) - -[node name="CollisionShape" type="CollisionShape" parent="SinkBlock/SinkRegion"] -transform = Transform( 1, 0, 0, 0, 0.264811, 0, 0, 0, 0.988649, 2.72806, 0.561258, 0 ) -shape = SubResource( 4 ) - -[connection signal="body_entered" from="SinkBlock/SinkRegion" to="SinkBlock/SinkRegion" method="_on_SinkRegion_body_entered"] -[connection signal="body_exited" from="SinkBlock/SinkRegion" to="SinkBlock/SinkRegion" method="_on_SinkRegion_body_exited"] +[node name="SinkBlock" parent="." instance=ExtResource( 2 )]