Page 1 of 1

how to make my guy swing a sword and kill actor

PostPosted: Sat Jan 26, 2008 10:36 pm
by wildmancoyote
hey wats up im kinda new to this stuff and so far ive and its kinda made me mad so can somone help me with this whenever you get the chance make a demo or watever

Re: how to make my guy swing a sword and kill actor

PostPosted: Sun Jan 27, 2008 4:47 pm
by alkoh002
I guess you want to do this without any scripts? Heres on way:

1. make a actor called "sword" or fist or whatever. Make so this actor destroys enemy on collision.

2. When player press hit button (ctrl) create actor "sword" in front of the player. Also, when sword is created, make its parent player.

3. On key up (ctrl) destroy actor "sword".

Did you understand?

Re: how to make my guy swing a sword and kill actor

PostPosted: Sun Jan 27, 2008 7:27 pm
by wildmancoyote
hey sorry to bother you again but i didnt get that totaly im such a newb at this i know

Re: how to make my guy swing a sword and kill actor

PostPosted: Sun Jan 27, 2008 8:46 pm
by DilloDude
Basically, what you need to do is first have animations for the guy swinging the sword (without the sword). Set it up so this plays when you press a key. Have another actor that is the sword, which lines up with the player doing the same animation. When it is swinging, set a variable (you might want a few values so you can have a more powerful swing as well), and when not swingin, the variable should be 0. When the sword collides with an enemy, check the variable and do damage accordingly.
The alternate method is to use three actors:
  • One graphic which includes both player and sword, and doesn't collide with anything.
  • One separate mask, which is invisible, which the graphic is parented to. This should do all the events that the player normally would.
  • On attack mask, also invisible (this need only be created when attacking). This does the damage.
Both ways have pros and cons.