diff --git a/GODOT/Player.gd b/GODOT/Player.gd index 593a7e1..97afad6 100644 --- a/GODOT/Player.gd +++ b/GODOT/Player.gd @@ -92,3 +92,15 @@ func start(pos): show() vie = 3 $CollisionShape2D.disabled = false + +func _on_TimerIsostasieVie_timeout(): + var anim = $AnimatedSprite.get_animation() + if "hit" in anim: + if "gauche" in anim: + $AnimatedSprite.play("gauche") + if "droite" in anim: + $AnimatedSprite.play("droite") + if "bas" in anim: + $AnimatedSprite.play("bas") + if "haut" in anim: + $AnimatedSprite.play("haut") diff --git a/GODOT/Player.tscn b/GODOT/Player.tscn index 089658e..1de68f3 100644 --- a/GODOT/Player.tscn +++ b/GODOT/Player.tscn @@ -27,55 +27,55 @@ atlas = ExtResource( 11 ) region = Rect2( 0, 0, 32, 32 ) [sub_resource type="AtlasTexture" id=5] -atlas = ExtResource( 7 ) -region = Rect2( 32, 0, 32, 32 ) - -[sub_resource type="AtlasTexture" id=6] -atlas = ExtResource( 11 ) +atlas = ExtResource( 3 ) region = Rect2( 0, 0, 32, 32 ) +[sub_resource type="AtlasTexture" id=6] +atlas = ExtResource( 2 ) +region = Rect2( 32, 0, 32, 32 ) + [sub_resource type="AtlasTexture" id=7] +atlas = ExtResource( 3 ) +region = Rect2( 0, 32, 32, 32 ) + +[sub_resource type="AtlasTexture" id=8] atlas = ExtResource( 8 ) region = Rect2( 32, 0, 32, 32 ) -[sub_resource type="AtlasTexture" id=8] -atlas = ExtResource( 6 ) -region = Rect2( 0, 0, 32, 32 ) - [sub_resource type="AtlasTexture" id=9] -atlas = ExtResource( 2 ) +atlas = ExtResource( 6 ) region = Rect2( 0, 0, 32, 32 ) [sub_resource type="AtlasTexture" id=10] atlas = ExtResource( 2 ) -region = Rect2( 32, 0, 32, 32 ) +region = Rect2( 0, 0, 32, 32 ) [sub_resource type="AtlasTexture" id=11] atlas = ExtResource( 2 ) -region = Rect2( 0, 32, 32, 32 ) +region = Rect2( 32, 0, 32, 32 ) [sub_resource type="AtlasTexture" id=12] -atlas = ExtResource( 4 ) -region = Rect2( 0, 0, 32, 32 ) +atlas = ExtResource( 2 ) +region = Rect2( 0, 32, 32, 32 ) [sub_resource type="AtlasTexture" id=13] -atlas = ExtResource( 1 ) +atlas = ExtResource( 7 ) region = Rect2( 32, 0, 32, 32 ) [sub_resource type="AtlasTexture" id=14] -atlas = ExtResource( 4 ) -region = Rect2( 0, 32, 32, 32 ) +atlas = ExtResource( 11 ) +region = Rect2( 0, 0, 32, 32 ) [sub_resource type="AtlasTexture" id=15] -atlas = ExtResource( 3 ) +atlas = ExtResource( 4 ) region = Rect2( 0, 0, 32, 32 ) [sub_resource type="AtlasTexture" id=16] -atlas = ExtResource( 2 ) +atlas = ExtResource( 1 ) region = Rect2( 32, 0, 32, 32 ) [sub_resource type="AtlasTexture" id=17] -atlas = ExtResource( 3 ) +atlas = ExtResource( 4 ) region = Rect2( 0, 32, 32, 32 ) [sub_resource type="AtlasTexture" id=18] @@ -102,29 +102,29 @@ animations = [ { "name": "gauche", "speed": 5.0 }, { -"frames": [ SubResource( 5 ), SubResource( 6 ) ], +"frames": [ SubResource( 5 ), SubResource( 6 ), SubResource( 7 ) ], "loop": true, -"name": "gauche-hit", +"name": "bas-hit", "speed": 5.0 }, { -"frames": [ SubResource( 7 ), SubResource( 8 ) ], +"frames": [ SubResource( 8 ), SubResource( 9 ) ], "loop": true, "name": "droite-hit", "speed": 5.0 }, { -"frames": [ SubResource( 9 ), SubResource( 10 ), SubResource( 11 ) ], +"frames": [ SubResource( 10 ), SubResource( 11 ), SubResource( 12 ) ], "loop": true, "name": "bas", "speed": 5.0 }, { -"frames": [ SubResource( 12 ), SubResource( 13 ), SubResource( 14 ) ], +"frames": [ SubResource( 13 ), SubResource( 14 ) ], "loop": true, -"name": "haut-hit", +"name": "gauche-hit", "speed": 5.0 }, { "frames": [ SubResource( 15 ), SubResource( 16 ), SubResource( 17 ) ], "loop": true, -"name": "bas-hit", +"name": "haut-hit", "speed": 5.0 }, { "frames": [ SubResource( 18 ), SubResource( 19 ), SubResource( 20 ) ], @@ -155,3 +155,4 @@ shape = SubResource( 22 ) [node name="TimerIsostasieVie" type="Timer" parent="."] one_shot = true [connection signal="body_entered" from="." to="." method="_on_Joueur_body_entered"] +[connection signal="timeout" from="TimerIsostasieVie" to="." method="_on_TimerIsostasieVie_timeout"]