Hello everyone. I had a problem that had been around for a long time, ever since I started learning game programming until now. Every time I make projects about platform games, I meet them. The problem is how to manage animation for the movements of the character in the most reasonable way. I want animation to suit each type of character movement such as: jump, run, ... Every time I develop more features for the character, adding animation for me is very difficult. I have tried many but have encountered bugs every time. That is logic error.That made me depressed and had given up with many games.
More specific. My character has these animation: idle, run, jump, crouch, climb, hurt. I need your help. I meet a lot of logic error when manage them. I think I don't have a proper method yet. Can anyone help me please? Thank you so much!
If you need I will send my dump code in the comment.
Looking for animation logic
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Looking for animation logic
I wrote a short tutorial on how to make animations:
https://2dengine.com/?p=animation
There are more sophisticated libraries out there,
but I think you can easily implement it yourself.
https://2dengine.com/?p=animation
There are more sophisticated libraries out there,
but I think you can easily implement it yourself.
-
- Citizen
- Posts: 78
- Joined: Wed Sep 11, 2019 10:38 am
Re: Looking for animation logic
Oh. May be my bad english make you miss understand.
-
- Citizen
- Posts: 78
- Joined: Wed Sep 11, 2019 10:38 am
Re: Looking for animation logic
I use anim8 library to make animation. It's OK. The problem is logic. I don't know how to switch animation when player walk, jump, hurt,...
Re: Looking for animation logic
Oh, I see.
This is actually a very good question.
You could have different states for the player where each state has its own animation.
Just keep in mind that the player only be in one state at a time.
This is actually a very good question.
You could have different states for the player where each state has its own animation.
Just keep in mind that the player only be in one state at a time.
-
- Citizen
- Posts: 78
- Joined: Wed Sep 11, 2019 10:38 am
Re: Looking for animation logic
It mean I need to create a variable named state to storage state of my player?
-
- Citizen
- Posts: 78
- Joined: Wed Sep 11, 2019 10:38 am
Re: Looking for animation logic
Ok. I use that method and to now everything works well. Thank you.
Re: Looking for animation logic
Take a look at my tutorial:
https://2dengine.com/?p=fsm
I have modified it specifically to answer your question.
https://2dengine.com/?p=fsm
I have modified it specifically to answer your question.
-
- Citizen
- Posts: 78
- Joined: Wed Sep 11, 2019 10:38 am
Re: Looking for animation logic
Ah yes! Good solution. Good tutorial. It help me a lot! Thank you!
-
- Citizen
- Posts: 78
- Joined: Wed Sep 11, 2019 10:38 am
Re: Looking for animation logic
I have visited your site. And I see your work so amazing! I see you have some project public on Steam. Good work. Keep doing.
Who is online
Users browsing this forum: No registered users and 97 guests