Bonjour à toutes et à tous!
Je développe un jeu en 2D- XNA et je voudrais bien faire le personnage se baisser. J'ai déjà mis en place d'autres animations,mais le travail continue. Je laisse mon code ci-dessous...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 protected override void UpdateAnimations() { if (currentAnimation == null) return; base.UpdateAnimations(); if (velocidade != Vector2.Zero || jumping == true) { if (direcao.X < 0 && AnimationIsNot(Animations.RunRight)) ChangeAnimation(Animations.RunRight); else if (direcao.X > 0 && AnimationIsNot(Animations.RunLeft)) ChangeAnimation(Animations.RunLeft); } else if (velocidade == Vector2.Zero || jumping == false) { if (direcao.X < 0 && AnimationIsNot(Animations.IdleRight)) ChangeAnimation(Animations.IdleRight); else if (direcao.X > 0 && AnimationIsNot(Animations.IdleLeft)) ChangeAnimation(Animations.IdleLeft); }
J'ai essayer d'ajouter le code "down" mais sans succès....
Je suis très reconnaissant d'avance pour votre attention!
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 else if (velocidade == Vector2.Zero || jumping == false) { if (direcao.Y < 0 && AnimationIsNot(Animations.DownRight)) ChangeAnimation(Animations.DownRight); else if (direcao.Y > 0 && AnimationIsNot(Animations.DownLeft)) ChangeAnimation(Animations.DownLeft); }
Partager