animation question

Non-platform specific questions.

animation question

Postby Freddy » Fri Jul 20, 2007 4:16 pm

Alright, I have different animations for my character in a game I want to create, but I have a few animation problems. For example: I want the enemy
actor to get hurt when it collides with the animation of my player, 'punch', or something like that. But I dont want the enemy character to be hurt when it collides with my player, just when it is just standing. How can I do this?
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score

Postby Jay S. » Fri Jul 20, 2007 6:58 pm

Maybe this would help... enter this in a Draw Actor event for the player:

Code: Select all
if(animindex==2)
{
//stuff...
}

And so on...

So say, for example, you have three animations: standing, walking and punching. The standing animation would be animindex 0, walking would be 1, and punching would be 2. Just say which animation you want for this action, then enter the events in the "if."

I hope I said that in a comprehensible manner... :)
User avatar
Jay S.
 
Posts: 118
Joined: Thu Apr 26, 2007 6:51 pm
Location: My computer desk. :P
Score: 9 Give a positive score

Postby DilloDude » Fri Jul 20, 2007 11:24 pm

Here is the way I would do it:
you want separate actors. Make the part of you that does the damage a different actor from the rest of you. For example, if your player is a guy with a sword, then make an actor 'player' and another 'sword'. All animations would have to match up. When sword collides with an enemy, test if it is swinging (either by animindex or by a special variable) and do damage accordingly. The advantage to this method as oppesed to using one actor with variables is that you can still get hurt. So if I swing with a sword, and somebody touches me in the face, I die, not him.
A similar method involves one single graphic that is displayed and two hidden actors that aren't. The player would then have an image the basic shape of the player, and would do all the stuff that a player normally does. The attack part would be the shape of the part that does damage (whether it's a sword, a fist, or whatever).
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby Freddy » Sat Jul 21, 2007 3:00 pm

To Jay S., Dont worry, I understood everything, Thanks! :D
To DilloDude (love the name), Interesting concepts, thanks for the options.
:D
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score

Postby DilloDude » Sun Jul 22, 2007 2:06 am

Of course, there are advantages to using the second method I mentioned. First, you have a different collision area for the player, so that obscure parts of the graphic don't collide. Second, the part that does damage is always there. Otherwise, if you did a slash around to the side, whilst facing one direction you could hit the enemy where if you were facing the other direction you wouldn't because the sword is behind you and is not showing in that spot.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest