adding sound for eating (stolen by Karl made by Marlene eating an apple)

adding collision for Player - Meldewesen
This commit is contained in:
incredibleLeitman 2019-12-03 12:33:10 +01:00
parent e2063273b4
commit d77f55705c
6 changed files with 141 additions and 67 deletions

File diff suppressed because one or more lines are too long

View File

@ -50,6 +50,11 @@ func _ready():
_inventory = get_node("HUD") _inventory = get_node("HUD")
# setup collisions with Meldewesen
var area = get_node("InteractArea") as Area
assert(null != area)
area.connect("area_entered", self, "_on_interact_entered")
func _physics_process(delta): func _physics_process(delta):
process_input() process_input()
@ -155,3 +160,9 @@ func _input(event):
# Prevent player from doing a purzelbaum # Prevent player from doing a purzelbaum
_camera.rotation_degrees.x = clamp(_camera.rotation_degrees.x, -70, 70) _camera.rotation_degrees.x = clamp(_camera.rotation_degrees.x, -70, 70)
func _on_interact_entered (area: Area):
if area.is_in_group("Enemy"):
Logger.info("ermagerd they touched :-o !")
#TODO: fade to black and restart scene
#_animation.

View File

@ -1,16 +1,14 @@
[gd_scene load_steps=16 format=2] [gd_scene load_steps=18 format=2]
[ext_resource path="res://Characters/Player/Player.gd" type="Script" id=1] [ext_resource path="res://Characters/Player/Player.gd" type="Script" id=1]
[ext_resource path="res://Characters/Player/PillCameras.gd" type="Script" id=2] [ext_resource path="res://Characters/Player/PillCameras.gd" type="Script" id=2]
[ext_resource path="res://Shaders/PillScreenRenderer.shader" type="Shader" id=3] [ext_resource path="res://Shaders/PillScreenRenderer.shader" type="Shader" id=3]
[ext_resource path="res://Characters/Player/Footsteps.gd" type="Script" id=4] [ext_resource path="res://Resources/Audio/dino-eat.wav" type="AudioStream" id=4]
[ext_resource path="res://Resources/Audio/Step.wav" type="AudioStream" id=5] [ext_resource path="res://Characters/Player/Footsteps.gd" type="Script" id=5]
[ext_resource path="res://Characters/Player/UI/UI.tscn" type="PackedScene" id=6] [ext_resource path="res://Resources/Audio/Step.wav" type="AudioStream" id=6]
[ext_resource path="res://Characters/Player/PillTaker.gd" type="Script" id=7] [ext_resource path="res://Characters/Player/UI/UI.tscn" type="PackedScene" id=7]
[ext_resource path="res://Level/Interactables/Pills/Pills.tscn" type="PackedScene" id=8] [ext_resource path="res://Characters/Player/PillTaker.gd" type="Script" id=8]
[ext_resource path="res://Level/Interactables/Pills/Pills.tscn" type="PackedScene" id=9]
[sub_resource type="ViewportTexture" id=1] [sub_resource type="ViewportTexture" id=1]
viewport_path = NodePath("Body/PillCameras/MaskedView") viewport_path = NodePath("Body/PillCameras/MaskedView")
@ -27,7 +25,7 @@ shader_param/masked_view = SubResource( 1 )
[sub_resource type="CylinderShape" id=4] [sub_resource type="CylinderShape" id=4]
[sub_resource type="Animation" id=6] [sub_resource type="Animation" id=5]
length = 0.8 length = 0.8
loop = true loop = true
tracks/0/type = "value" tracks/0/type = "value"
@ -60,7 +58,7 @@ tracks/1/keys = {
} ] } ]
} }
[sub_resource type="Animation" id=9] [sub_resource type="Animation" id=6]
resource_name = "PillTaking" resource_name = "PillTaking"
tracks/0/type = "value" tracks/0/type = "value"
tracks/0/path = NodePath("PillTaker/Pills:visible") tracks/0/path = NodePath("PillTaker/Pills:visible")
@ -98,11 +96,41 @@ tracks/2/keys = {
"update": 0, "update": 0,
"values": [ Vector3( 180, 0, 0 ), Vector3( -90, 0, 0 ) ] "values": [ Vector3( 180, 0, 0 ), Vector3( -90, 0, 0 ) ]
} }
tracks/3/type = "audio"
tracks/3/path = NodePath("Eating/Chrum")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"clips": [ {
"end_offset": 0.0,
"start_offset": 0.0,
"stream": ExtResource( 4 )
} ],
"times": PoolRealArray( 0 )
}
tracks/4/type = "method"
tracks/4/path = NodePath("Eating/Chrum")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"values": [ {
"args": [ 0.0 ],
"method": "play"
} ]
}
[sub_resource type="AudioStreamRandomPitch" id=7] [sub_resource type="AudioStreamRandomPitch" id=7]
audio_stream = ExtResource( 5 ) audio_stream = ExtResource( 6 )
random_pitch = 1.3 random_pitch = 1.3
[sub_resource type="CylinderShape" id=8]
[node name="Player" type="KinematicBody" groups=[ [node name="Player" type="KinematicBody" groups=[
"Player", "Player",
]] ]]
@ -118,7 +146,8 @@ camera_nodepath = NodePath("Body/PillCameras")
[node name="Body" type="Spatial" parent="."] [node name="Body" type="Spatial" parent="."]
[node name="PillCameras" type="Spatial" parent="Body"] [node name="PillCameras" type="Spatial" parent="Body"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 7.45058e-009, 1.8, 0 ) editor/display_folded = true
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00764713, 1.80765, 0 )
script = ExtResource( 2 ) script = ExtResource( 2 )
[node name="LookingAt" type="RayCast" parent="Body/PillCameras"] [node name="LookingAt" type="RayCast" parent="Body/PillCameras"]
@ -134,7 +163,7 @@ size = Vector2( 1024, 600 )
render_target_update_mode = 3 render_target_update_mode = 3
[node name="TrueCamera" type="Camera" parent="Body/PillCameras/TrueView"] [node name="TrueCamera" type="Camera" parent="Body/PillCameras/TrueView"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 7.45058e-009, 1.8, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00764713, 1.80765, 0 )
cull_mask = 2 cull_mask = 2
current = true current = true
@ -143,7 +172,7 @@ size = Vector2( 1024, 600 )
render_target_update_mode = 3 render_target_update_mode = 3
[node name="MaskedCamera" type="Camera" parent="Body/PillCameras/MaskedView"] [node name="MaskedCamera" type="Camera" parent="Body/PillCameras/MaskedView"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 7.45058e-009, 1.8, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00764713, 1.80765, 0 )
cull_mask = 1 cull_mask = 1
current = true current = true
@ -165,14 +194,21 @@ shape = SubResource( 4 )
[node name="WalkAnimationPlayer" type="AnimationPlayer" parent="."] [node name="WalkAnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "Walk" autoplay = "Walk"
anims/Walk = SubResource( 6 ) anims/Walk = SubResource( 5 )
[node name="PillAnimationPlayer" type="AnimationPlayer" parent="."] [node name="PillAnimationPlayer" type="AnimationPlayer" parent="."]
playback_speed = 2.0 playback_speed = 2.0
anims/PillTaking = SubResource( 9 ) anims/PillTaking = SubResource( 6 )
[node name="Eating" type="Spatial" parent="."]
editor/display_folded = true
[node name="Chrum" type="AudioStreamPlayer3D" parent="Eating"]
stream = ExtResource( 4 )
[node name="Footsteps" type="Spatial" parent="."] [node name="Footsteps" type="Spatial" parent="."]
script = ExtResource( 4 ) editor/display_folded = true
script = ExtResource( 5 )
[node name="Footstep1" type="AudioStreamPlayer3D" parent="Footsteps"] [node name="Footstep1" type="AudioStreamPlayer3D" parent="Footsteps"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1 )
@ -180,14 +216,20 @@ stream = SubResource( 7 )
unit_db = -25.0 unit_db = -25.0
pitch_scale = 1.5 pitch_scale = 1.5
[node name="HUD" parent="." instance=ExtResource( 6 )] [node name="HUD" parent="." instance=ExtResource( 7 )]
[node name="PillTaker" type="Spatial" parent="."] [node name="PillTaker" type="Spatial" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0 )
script = ExtResource( 7 ) script = ExtResource( 8 )
[node name="Pills" parent="PillTaker" instance=ExtResource( 8 )] [node name="Pills" parent="PillTaker" instance=ExtResource( 9 )]
transform = Transform( 0.1, 0, 0, 0, -4.37114e-009, 0.1, 0, -0.1, -4.37114e-009, 0, 0.7, 0 ) transform = Transform( 0.1, 0, 0, 0, -4.37114e-009, 0.1, 0, -0.1, -4.37114e-009, 0, 0.7, 0 )
visible = false visible = false
[node name="InteractArea" type="Area" parent="."]
[node name="CollisionShape" type="CollisionShape" parent="InteractArea"]
transform = Transform( 1.2, 0, 0, 0, 1, 0, 0, 0, 1.2, 0, 1, 0 )
shape = SubResource( 8 )
[editable path="HUD"] [editable path="HUD"]

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/dino-eat.wav-1c02eb9853b763034b31d57fdabb6775.sample"
[deps]
source_file="res://Resources/Audio/dino-eat.wav"
dest_files=[ "res://.import/dino-eat.wav-1c02eb9853b763034b31d57fdabb6775.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0