Player combat please help

0 favourites
  • 3 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hello what would the proper way to make the player do attacks like this? Thanks

    Basic attack

    Combo attack (if button pressed simultaneously)

    And a charge attack (if button is held down)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Bump

  • The basic attack should be simple to make. Add a mouse or a keyboard object, and on key press event add your attack actions.

    The combo attack its a bit tricky, I'm not sure when you want to be usable, but lets say you can use combo when enemy is bellow 5 hp and you need to press left click mouse and q at the same time.

    First you add a global variable called combo attack set it to 0 on start, also you will need to add a instance variable to the enemy we gonna call it bellow_50 set it also to 0 on start, then add an event with conditions, left mouse pressed, q pressed, combo attack is 1 and enemy instance variable bellow_50 is 1. After that you add another event which checks if enemy is bellow 50%, and add the actions global variable combo attack set to 1, enemy instance variable set to 1. When this to are set to 1, then you can combo attack the enemy, go back to the combo event check and add your actions.

    For the charged attack, add a global variable called charged, add an keyboard event when key is being held down, add another condition every 0.5 seconds add ad to action to increment the global variable charged by 1. Now you will need another event when key is being released, as action add damage + global variable charged, this will add all that extra damage to the attack. and you reset the variable to 0 after that.

    I think that should be it, but take a note this is advanced construct stuff and its hard to implement, it will take a good event scripting and trail and error's until you get it right.

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