Jump to content

Melee attack detection


grimor
 Share

Recommended Posts

I'm wondering about how to make melee attack collision detection. I've got a player spritesheet with attack animation, but don't know how to detect collision in front of my sprite in for example 30 pixels right. I was thinking about adding additional sprite on attack with hitbox which is 30px wide in front of my player, but don't know it is right thing to do.

 

 

Link to comment
Share on other sites

Yeah, i was started doing it already that way ;) Ok, last question. If i make Player class, can I somehow put there game.load.spritesheet statements ? What i mean is can I "append" some code into preload(), create(), update(), render() methods from Player class ?

 

Or it there other way to handle a lot of preloading code ?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...