Dash function and ignoring platform user input

0 favourites
  • 5 posts
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • I want to build a dash function for my platformer. When the dash button is pressed, the player should move quickly in the direction it's facing, but the user shouldn't be able to cancel the dash movement by pressing another button (like move-arrow or fire).

    Here's my logic, everything works except the "start ignoring platform user input" part. If I leave that in there the player doesn't move, i.e., it stays in one place during the dashing animation. But if I take it out, the user can stop the dash movement by pressing another button (like move-arrow or fire).

    Any suggestions on how I can get the player to move but ignore input at the same time?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You have already created a variable 'state', you can use this as a condition on your movement events, if 'not' in state dashing. This will block out movement while dashing.

  • Thanks for the suggestion, but I'm not managing my player movements, I'm letting the platform behavior do that for me. If I understand you correctly, your suggestion means I would need to turn on/off all default platform movements based on the state variable. I'm looking for a simpler solution, especially since I use that state variable for many things in the game, which could potentially (and inadvertently) affect the player movement with this approach.

    Is there a way to ignore user input but still let the platform behavior do it's thing? Seems like platform simulate should do that, but per my code that doesn't seem to be the case.

  • Do you mean you are using default control with arrow keys? If you want to implement things like dashes you'll need to create movement events, even if it is identical to the default controls such as right key is down then simulate control right. Then within these events you can add conditions such as 'is not dashing'. When you said simpler solution what did you have in mind? You created a few events to dash on key press, to make an event to move left and right on key press is just 2 simple events.

  • I'm following you now. I knew I was going to have to modify standard controls since my player doesn't jump, but had yet to get around to it. I added the following and disabled default controls for platform behavior and it's working as I was hoping. Thanks!

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