animation for taking pills
This commit is contained in:
parent
fb5b6da3d3
commit
a5f3e610a7
@ -11,10 +11,7 @@ func _process(delta):
|
|||||||
Logger.info("Player took a pill; new level: %s" % [Pills.get_round_level()])
|
Logger.info("Player took a pill; new level: %s" % [Pills.get_round_level()])
|
||||||
_animation.play("PillTaking")
|
_animation.play("PillTaking")
|
||||||
|
|
||||||
#_animation.playback_speed = _vel.length() / MOVE_SPEED
|
|
||||||
#Logger.warn("speed: " + String(_animation.playback_speed))
|
|
||||||
|
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
_animation = get_parent().get_node("AnimationPlayer") as AnimationPlayer
|
_animation = get_parent().get_node("PillAnimationPlayer") as AnimationPlayer
|
||||||
assert(null != _animation)
|
assert(null != _animation)
|
@ -23,7 +23,40 @@ shader_param/masked_view = SubResource( 1 )
|
|||||||
|
|
||||||
[sub_resource type="CylinderShape" id=4]
|
[sub_resource type="CylinderShape" id=4]
|
||||||
|
|
||||||
[sub_resource type="Animation" id=5]
|
[sub_resource type="Animation" id=6]
|
||||||
|
length = 0.8
|
||||||
|
loop = true
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/path = NodePath("Body/PillCameras:translation")
|
||||||
|
tracks/0/interp = 2
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PoolRealArray( 0, 0.2, 0.4, 0.6 ),
|
||||||
|
"transitions": PoolRealArray( 1, 1, 1, 1 ),
|
||||||
|
"update": 0,
|
||||||
|
"values": [ Vector3( 0, 1.8, 0 ), Vector3( -0.1, 1.9, 0 ), Vector3( 0, 1.8, 0 ), Vector3( 0.1, 1.9, 0 ) ]
|
||||||
|
}
|
||||||
|
tracks/1/type = "method"
|
||||||
|
tracks/1/path = NodePath("Footsteps")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PoolRealArray( 0.3, 0.7 ),
|
||||||
|
"transitions": PoolRealArray( 1, 1 ),
|
||||||
|
"values": [ {
|
||||||
|
"args": [ ],
|
||||||
|
"method": "play_footstep"
|
||||||
|
}, {
|
||||||
|
"args": [ ],
|
||||||
|
"method": "play_footstep"
|
||||||
|
} ]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id=9]
|
||||||
resource_name = "PillTaking"
|
resource_name = "PillTaking"
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
tracks/0/path = NodePath("PillTaker/Pill:visible")
|
tracks/0/path = NodePath("PillTaker/Pill:visible")
|
||||||
@ -59,40 +92,7 @@ tracks/2/keys = {
|
|||||||
"times": PoolRealArray( 0, 1 ),
|
"times": PoolRealArray( 0, 1 ),
|
||||||
"transitions": PoolRealArray( 1, 1 ),
|
"transitions": PoolRealArray( 1, 1 ),
|
||||||
"update": 0,
|
"update": 0,
|
||||||
"values": [ Vector3( 0, 0, -1 ), Vector3( 0, 1, 0 ) ]
|
"values": [ Vector3( 0, 0, -1 ), Vector3( 0, 0.7, 0 ) ]
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id=6]
|
|
||||||
length = 0.8
|
|
||||||
loop = true
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/path = NodePath("Body/PillCameras:translation")
|
|
||||||
tracks/0/interp = 2
|
|
||||||
tracks/0/loop_wrap = true
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/keys = {
|
|
||||||
"times": PoolRealArray( 0, 0.2, 0.4, 0.6 ),
|
|
||||||
"transitions": PoolRealArray( 1, 1, 1, 1 ),
|
|
||||||
"update": 0,
|
|
||||||
"values": [ Vector3( 0, 1.8, 0 ), Vector3( -0.1, 1.9, 0 ), Vector3( 0, 1.8, 0 ), Vector3( 0.1, 1.9, 0 ) ]
|
|
||||||
}
|
|
||||||
tracks/1/type = "method"
|
|
||||||
tracks/1/path = NodePath("Footsteps")
|
|
||||||
tracks/1/interp = 1
|
|
||||||
tracks/1/loop_wrap = true
|
|
||||||
tracks/1/imported = false
|
|
||||||
tracks/1/enabled = true
|
|
||||||
tracks/1/keys = {
|
|
||||||
"times": PoolRealArray( 0.3, 0.7 ),
|
|
||||||
"transitions": PoolRealArray( 1, 1 ),
|
|
||||||
"values": [ {
|
|
||||||
"args": [ ],
|
|
||||||
"method": "play_footstep"
|
|
||||||
}, {
|
|
||||||
"args": [ ],
|
|
||||||
"method": "play_footstep"
|
|
||||||
} ]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="AudioStreamRandomPitch" id=7]
|
[sub_resource type="AudioStreamRandomPitch" id=7]
|
||||||
@ -104,12 +104,12 @@ random_pitch = 1.3
|
|||||||
[node name="Player" type="KinematicBody" groups=[
|
[node name="Player" type="KinematicBody" groups=[
|
||||||
"Player",
|
"Player",
|
||||||
]]
|
]]
|
||||||
collision_layer = 7
|
collision_layer = 5
|
||||||
collision_mask = 7
|
collision_mask = 5
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
body_nodepath = NodePath("Body")
|
body_nodepath = NodePath("Body")
|
||||||
lookingAt_nodepath = NodePath("Body/PillCameras/LookingAt")
|
lookingAt_nodepath = NodePath("Body/PillCameras/LookingAt")
|
||||||
animation_nodepath = NodePath("AnimationPlayer")
|
animation_nodepath = NodePath("WalkAnimationPlayer")
|
||||||
ui_interact_nodepath = NodePath("HUD/PressInteract")
|
ui_interact_nodepath = NodePath("HUD/PressInteract")
|
||||||
camera_nodepath = NodePath("Body/PillCameras")
|
camera_nodepath = NodePath("Body/PillCameras")
|
||||||
|
|
||||||
@ -130,26 +130,20 @@ current = true
|
|||||||
[node name="TrueView" type="Viewport" parent="Body/PillCameras"]
|
[node name="TrueView" type="Viewport" parent="Body/PillCameras"]
|
||||||
size = Vector2( 1024, 600 )
|
size = Vector2( 1024, 600 )
|
||||||
render_target_update_mode = 3
|
render_target_update_mode = 3
|
||||||
shadow_atlas_size = 4
|
|
||||||
|
|
||||||
[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, 7.45058e-009, 1.8, 0 )
|
||||||
cull_mask = 2
|
cull_mask = 2
|
||||||
current = true
|
current = true
|
||||||
fov = 80.0
|
|
||||||
far = 2000.0
|
|
||||||
|
|
||||||
[node name="MaskedView" type="Viewport" parent="Body/PillCameras"]
|
[node name="MaskedView" type="Viewport" parent="Body/PillCameras"]
|
||||||
size = Vector2( 1024, 600 )
|
size = Vector2( 1024, 600 )
|
||||||
render_target_update_mode = 3
|
render_target_update_mode = 3
|
||||||
shadow_atlas_size = 4
|
|
||||||
|
|
||||||
[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, 7.45058e-009, 1.8, 0 )
|
||||||
cull_mask = 1
|
cull_mask = 1
|
||||||
current = true
|
current = true
|
||||||
fov = 80.0
|
|
||||||
far = 2000.0
|
|
||||||
|
|
||||||
[node name="ScreenTexture" type="ColorRect" parent="Body/PillCameras"]
|
[node name="ScreenTexture" type="ColorRect" parent="Body/PillCameras"]
|
||||||
material = SubResource( 3 )
|
material = SubResource( 3 )
|
||||||
@ -167,11 +161,14 @@ remote_path = NodePath("../MaskedView/MaskedCamera")
|
|||||||
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 )
|
||||||
shape = SubResource( 4 )
|
shape = SubResource( 4 )
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
[node name="WalkAnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
autoplay = "Walk"
|
autoplay = "Walk"
|
||||||
anims/PillTaking = SubResource( 5 )
|
|
||||||
anims/Walk = SubResource( 6 )
|
anims/Walk = SubResource( 6 )
|
||||||
|
|
||||||
|
[node name="PillAnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
|
playback_speed = 2.0
|
||||||
|
anims/PillTaking = SubResource( 9 )
|
||||||
|
|
||||||
[node name="Footsteps" type="Spatial" parent="."]
|
[node name="Footsteps" type="Spatial" parent="."]
|
||||||
script = ExtResource( 4 )
|
script = ExtResource( 4 )
|
||||||
|
|
||||||
@ -184,10 +181,11 @@ pitch_scale = 1.5
|
|||||||
[node name="HUD" parent="." instance=ExtResource( 6 )]
|
[node name="HUD" parent="." instance=ExtResource( 6 )]
|
||||||
|
|
||||||
[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 )
|
||||||
script = ExtResource( 7 )
|
script = ExtResource( 7 )
|
||||||
|
|
||||||
[node name="Pill" type="Spatial" parent="PillTaker"]
|
[node name="Pill" type="Spatial" parent="PillTaker"]
|
||||||
transform = Transform( 1, 0, 0, 0, -4.37114e-008, -1, 0, 1, -4.37114e-008, 0, 1, 0 )
|
transform = Transform( 1, 0, 0, 0, -4.37114e-008, -1, 0, 1, -4.37114e-008, 0, 0.7, 0 )
|
||||||
visible = false
|
visible = false
|
||||||
|
|
||||||
[node name="MeshInstance" type="MeshInstance" parent="PillTaker/Pill"]
|
[node name="MeshInstance" type="MeshInstance" parent="PillTaker/Pill"]
|
||||||
|
BIN
Models/pill/blue.material
Normal file
BIN
Models/pill/blue.material
Normal file
Binary file not shown.
BIN
Models/pill/other.material
Normal file
BIN
Models/pill/other.material
Normal file
Binary file not shown.
@ -63,7 +63,7 @@ _global_script_class_icons={
|
|||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="retrace"
|
config/name="retrace"
|
||||||
run/main_scene="res://Level/World.tscn"
|
run/main_scene="res://Level/PathTestWorld.tscn"
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.png"
|
||||||
|
|
||||||
[autoload]
|
[autoload]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user