Player Animation converted to Animation Tree

Level 1 Design
Door Mechanism
Core Gameplay Mechanism - In-Progress
This commit is contained in:
Indrajith K L
2022-04-18 01:21:58 +05:30
parent 31089507aa
commit 77b9080c3b
30 changed files with 433 additions and 177 deletions

View File

@@ -1,13 +1,16 @@
extends Node2D
export var health=10
var collected = false
func _ready():
$AnimationPlayer.play("idle")
func _on_Area2D_body_entered(body):
if (body.name=="Player"):
body.health += health
if (body.name=="Player" and !collected):
collected = true
SignalBus.emit_signal("on_apples_collected",1)
self.hide()
$Sprite/Area2D.set_collision_mask_bit(1,false)
$pickup.play()
func _on_pickup_finished():

View File

@@ -24,17 +24,20 @@ tracks/0/keys = {
[sub_resource type="Animation" id=3]
resource_name = "idle"
length = 2.0
loop = true
step = 0.0625
tracks/0/type = "bezier"
step = 0.04
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"points": PoolRealArray( 0, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0, 2, -0.25, 0, 0.25, 0, 3, -0.25, 0, 0.25, 0, 4, -0.25, 0, 0.25, 0, 5, -0.25, 0, 0.25, 0, 6, -0.25, 0, 0.25, 0, 7, -0.25, 0, 0.25, 0, 8, -0.25, 0, 0.25, 0, 9, -0.25, 0, 0.25, 0, 10, -0.25, 0, 0.25, 0, 11, -0.25, 0, 0.25, 0, 12, -0.25, 0, 0.25, 0, 13, -0.25, 0, 0.25, 0, 14, -0.25, 0, 0.25, 0, 15, -0.25, 0, 0.25, 0, 16, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 0.0625, 0.125, 0.1875, 0.25, 0.3125, 0.375, 0.4375, 0.5, 0.5625, 0.625, 0.6875, 0.75, 0.8125, 0.875, 0.9375, 1 )
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 16, 16, 16 ]
}
[node name="Apple" type="Node2D"]
@@ -52,11 +55,11 @@ shape = SubResource( 1 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
playback_default_blend_time = 387.02
playback_speed = 64.0
playback_speed = 6.56
anims/RESET = SubResource( 2 )
anims/idle = SubResource( 3 )
[node name="pickup" type="AudioStreamPlayer2D" parent="."]
[node name="pickup" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 3 )
[connection signal="body_entered" from="Sprite/Area2D" to="." method="_on_Area2D_body_entered"]