0 Favourites

Melle Combat for top-down game

This forum is currently in read-only mode.
  • I have my enemies chase my player but when they catch him what is the best way to calculate damage. I would like to have it so they take so many hit points per second but I can't figure out how to make that work.

    Also does anyone know of any good tutorials for the RTS movement. I got the basics down but I need to get some more complicated functions out of it.

    Thanks again you guys are great.

  • Try using the System -> Time -> "every x milliseconds" or "every x ticks" event conditions.

    For 1 second you can do "every 1000 milliseconds".

    I don't know much about ticks and how they work.

  • dps is a complex theme.

    It involves the player's hit rate and strength, and the enemy's defense:

    If the player hits 1 time per second with a strength of 20, the dps is 20. If the enemy has a defense of 50%, it will take 10 hp per second.

    If you change the player's hit speed to 5 times per second, the dps is 100 and the enemy would take 50 hp per second.

    Or instead change the strength to 10, the dps is 10 and the enemy would take 5 hp per second.

    Or change the defense to 20%, dps would still be 20, but enemy would take 16 hp per second.

    Another way would be to not have any strength on the player's side, but let the enemy suffer as long as it collides with the player. Then you'd do something like

    + As long as they collide

    -> reduce enemy's hp by 20 * TimeDelta

    This would let lose the enemy 20 hp per second as long as they collide, no matter how often the player actually hits (animation-wise)

    I don't know much about ticks and how they work.

    This post was once written to help people using "else", but deeply explains a tick also :)

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Thanks alot, what I ended up doing is using the every x milliseconds. I set a private variable to 5 and every 10th of second the variable decreases by 1, you can only hit when the variable is 0, therefore, 2 hits per second. Works like a charm.

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