fix bug personnage rouge et immobile

This commit is contained in:
Mylloon 2021-01-03 11:24:14 +01:00
parent 5241c0a60f
commit ae179bb19e
2 changed files with 40 additions and 27 deletions

View file

@ -92,3 +92,15 @@ func start(pos):
show() show()
vie = 3 vie = 3
$CollisionShape2D.disabled = false $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")

View file

@ -27,55 +27,55 @@ atlas = ExtResource( 11 )
region = Rect2( 0, 0, 32, 32 ) region = Rect2( 0, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=5] [sub_resource type="AtlasTexture" id=5]
atlas = ExtResource( 7 ) atlas = ExtResource( 3 )
region = Rect2( 32, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=6]
atlas = ExtResource( 11 )
region = Rect2( 0, 0, 32, 32 ) 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] [sub_resource type="AtlasTexture" id=7]
atlas = ExtResource( 3 )
region = Rect2( 0, 32, 32, 32 )
[sub_resource type="AtlasTexture" id=8]
atlas = ExtResource( 8 ) atlas = ExtResource( 8 )
region = Rect2( 32, 0, 32, 32 ) 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] [sub_resource type="AtlasTexture" id=9]
atlas = ExtResource( 2 ) atlas = ExtResource( 6 )
region = Rect2( 0, 0, 32, 32 ) region = Rect2( 0, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=10] [sub_resource type="AtlasTexture" id=10]
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 32, 0, 32, 32 ) region = Rect2( 0, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=11] [sub_resource type="AtlasTexture" id=11]
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 0, 32, 32, 32 ) region = Rect2( 32, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=12] [sub_resource type="AtlasTexture" id=12]
atlas = ExtResource( 4 ) atlas = ExtResource( 2 )
region = Rect2( 0, 0, 32, 32 ) region = Rect2( 0, 32, 32, 32 )
[sub_resource type="AtlasTexture" id=13] [sub_resource type="AtlasTexture" id=13]
atlas = ExtResource( 1 ) atlas = ExtResource( 7 )
region = Rect2( 32, 0, 32, 32 ) region = Rect2( 32, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=14] [sub_resource type="AtlasTexture" id=14]
atlas = ExtResource( 4 ) atlas = ExtResource( 11 )
region = Rect2( 0, 32, 32, 32 ) region = Rect2( 0, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=15] [sub_resource type="AtlasTexture" id=15]
atlas = ExtResource( 3 ) atlas = ExtResource( 4 )
region = Rect2( 0, 0, 32, 32 ) region = Rect2( 0, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=16] [sub_resource type="AtlasTexture" id=16]
atlas = ExtResource( 2 ) atlas = ExtResource( 1 )
region = Rect2( 32, 0, 32, 32 ) region = Rect2( 32, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=17] [sub_resource type="AtlasTexture" id=17]
atlas = ExtResource( 3 ) atlas = ExtResource( 4 )
region = Rect2( 0, 32, 32, 32 ) region = Rect2( 0, 32, 32, 32 )
[sub_resource type="AtlasTexture" id=18] [sub_resource type="AtlasTexture" id=18]
@ -102,29 +102,29 @@ animations = [ {
"name": "gauche", "name": "gauche",
"speed": 5.0 "speed": 5.0
}, { }, {
"frames": [ SubResource( 5 ), SubResource( 6 ) ], "frames": [ SubResource( 5 ), SubResource( 6 ), SubResource( 7 ) ],
"loop": true, "loop": true,
"name": "gauche-hit", "name": "bas-hit",
"speed": 5.0 "speed": 5.0
}, { }, {
"frames": [ SubResource( 7 ), SubResource( 8 ) ], "frames": [ SubResource( 8 ), SubResource( 9 ) ],
"loop": true, "loop": true,
"name": "droite-hit", "name": "droite-hit",
"speed": 5.0 "speed": 5.0
}, { }, {
"frames": [ SubResource( 9 ), SubResource( 10 ), SubResource( 11 ) ], "frames": [ SubResource( 10 ), SubResource( 11 ), SubResource( 12 ) ],
"loop": true, "loop": true,
"name": "bas", "name": "bas",
"speed": 5.0 "speed": 5.0
}, { }, {
"frames": [ SubResource( 12 ), SubResource( 13 ), SubResource( 14 ) ], "frames": [ SubResource( 13 ), SubResource( 14 ) ],
"loop": true, "loop": true,
"name": "haut-hit", "name": "gauche-hit",
"speed": 5.0 "speed": 5.0
}, { }, {
"frames": [ SubResource( 15 ), SubResource( 16 ), SubResource( 17 ) ], "frames": [ SubResource( 15 ), SubResource( 16 ), SubResource( 17 ) ],
"loop": true, "loop": true,
"name": "bas-hit", "name": "haut-hit",
"speed": 5.0 "speed": 5.0
}, { }, {
"frames": [ SubResource( 18 ), SubResource( 19 ), SubResource( 20 ) ], "frames": [ SubResource( 18 ), SubResource( 19 ), SubResource( 20 ) ],
@ -155,3 +155,4 @@ shape = SubResource( 22 )
[node name="TimerIsostasieVie" type="Timer" parent="."] [node name="TimerIsostasieVie" type="Timer" parent="."]
one_shot = true one_shot = true
[connection signal="body_entered" from="." to="." method="_on_Joueur_body_entered"] [connection signal="body_entered" from="." to="." method="_on_Joueur_body_entered"]
[connection signal="timeout" from="TimerIsostasieVie" to="." method="_on_TimerIsostasieVie_timeout"]