Dodge/Dive in ARPG game

0 favourites
  • 5 posts
From the Asset Store
five golem elements Sprites Sheet.Best for enemy or villain game characters.
  • Hi. I'm doing an ARPG in the style of Zelda (LttP), a 3/4 overhead action-style game. I'm having, however, an awful lot of problems trying to get the controls down.

    This is my problem: As you can see on the screenshot, I've set it up so the player loses the 8-dir control of the character and it instead switches to a bullet behavior, goes in the direction of the mouse for half a second, and then reverts to 8-dir. This is working pretty well as far as I'm concerned. The problem however, comes with the DodgeTimer variable.

    I want the Dodge function to be disabled for a couple seconds, so I've set a variable. When the variable is not 0, an autonomous process should take care to reset it once enough seconds have passed. And the thing is, it works! At the first time. Then I'm able to click without the function being disabled for some time (the text box I set to monitor the variable shows a '3' briefly, but quickly reverts back to 0), and then it works again. And then it will do the same thing again.

    So what's the problem here? The processes are correct as far as I can tell, and it works flawlessly except for 4 times out of 5, when the counter just resets to 0 without waiting for the seconds.

    I'd be really thankful if anyone pointed out the problem for me.

    Here's the screenshot.

    <img src="http://www.freeimagehosting/w89fu" border="0" />

  • Sorry, here's the real one.

    <img src="" border="0" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Goddammit... u___u.

    Clickable version.

  • Try changing your DodgeTimer reset event to this:


    System -> Every 1 Seconds

    System -> DodgeTime > 0


    Subtract 1 from DodgeTimer

    Tis will count down the DodgeTimer by 1 second every second, rather than waiting and setting to 0.

    The reason I think you are having problems is because your event is running every tick because your condition is true, so in 3 seconds at 60fps it's called 180 times. The one called at tick 1 will set DodgeTimer to 0 at the same time the one at tick 180 is called, i.e. at 3 seconds, but the ones called at all the ticks will still be waiting. So, every tick between 3 seconds and 6 seconds after the event conditions were first true, DodgeTimer will be set to 0.

  • Gonna try that when I get home. I pretty much suspected the cause was that I was essentially strapping lightbulb to a nuclear reactor-- too much power to make it work confortably.

    Also, I've found this, which could potentially save me a good chunk of hassle in that respect, considering I want to make heavy use of cooldown mechanics in general. Thanks a lot! :D

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