Help with Zelda-Like Attacking

  • Hey all. I've been trying to get a 2d Zelda-style attacking system (with mouse-aiming) to work, but the sword seems to randomly not make collision with enemies. It only registers a collision about 30% of the time.

    Here's the commented capx, if anyone would like to help; thanks!: dl.dropbox.com/u/68722177/test.capx

  • I took a look at your capx and you've made some unique choices for the way you have setup your game and there might be some ways to simplify what's going on.

    For the sword swinging i'd recommend simply creating an animation of a sword swinging over a few frames in photoshop or whatever, then shape its collision box in the shape of a pie slice.

    Have the pie piece always aim towards which way the mouse is pointing, and then use "on mouse clicked" play animation "swing" then

    have a second event that looks to see if it hit a bad guy.

    you can make it visible/invisible as needed.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • That would technically "work", but it's not an exact solution.

    In 2d Zeldas (excluding the NES/Gameboy titles), the sword deals damage when it makes contact with the enemy during the swing arc, not when the enemy is simply in range of the attack.

  • under your collision event sheet change "sword - on collision with beebot"

    to "sword - is overlapping another object (beebot)" and it works.

    to help with debugging i noticed that the top right bee would only die when being struck with the very tip of the sword. so if the player is right on top of the bee and swinging there is no collision to detect, the sword spawns already on top of the bee.

  • Worked like a charm - Thanks!

    And thanks for the debug explanation, as well!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)