The Daily Click ::. Forums ::. Klik Coding Help ::. Need some help with Swords.
 

Post Reply  Post Oekaki 
 

Posted By Message

JetpackLover



Registered
  01/03/2007
Points
  212
28th April, 2009 at 01:49:13 -


Originally Posted by Del Duio
I find it almost always looks / works better to have the sword be part of the same sprite as the guy but if you want to have 50 swords that look different than each other you could be in for some future headaches.

Here's what I'm doing now, and I find it's the best method for me and doesn't have to rely on any hitboxes (per se) :

1.) Complete your hero's sprite with all the animations you'll need for attacking.
2.) Clone your hero!
3.) Go into the clone's animation editor and ERASE everything on him that's not a sword.
4.) Make an event that always sets the clone's X & Y position to the hero's, and that forces the clone's animation & frame to whatever the hero's are.
5.) Make the clone invisible.
6.) When you go to have weapons collisions, test if the CLONE is overlapping the ENEMY and the animation "ATTACK" is playing, then subtract damages and stuff from the enemy's HP. Since the CLONE is only the sword, you'll have really accurate hit detection


NOTE: You can also do something similar with your hero taking damage from the enemy, where your hero's weak points (e.g. head) are susceptible to being hit or whatever.



I use this exact same technique, it's a very good way to separate weapons from the player and it's extremely accurate.

 
http://www.invincibletime.com/

Devlog for HD MMF Game Omulus. Check it out because it's gonna be awesome. http://omulus.tumblr.com/

Follow me on the twitters https://twitter.com/JetpackLover


MBK



Registered
  07/06/2007
Points
  1578

VIP Member
28th April, 2009 at 09:03:48 -

That's the same method I came up with for my "Elf Beatemup Movement Engine" Del Duio! ....

I never use the Always for that sort of thing though .... much better off making walking movement for the character AND the sword (jumping too), that way everything moves at exactly the same pace.


 
Click Me! http://www.create-games.com/project.asp?view=main&id=1444

http://www.mediafire.com/download.php?aoo1dnnlq5i

Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
28th April, 2009 at 15:15:09 -

Cool!

MMF coding is for sure my weakest spot so it's nice to having something I came up with actually be viable for somebody else

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!
   

Post Reply



 



Advertisement

Worth A Click