Cooldown

0 favourites
  • 8 posts
  • Im new to Construct and after doing some Tutorials im starting on a game. But I have a question. I would like to make it to where I cant constantly spam my attack. I have tried the cooldown plugin but for some reason I cant get it to work. So I need an alternative. And also my my enemy that shoots lightning constantly shoots it. Thanks!

    <img src="smileys/smiley11.gif" border="0" align="middle" />

  • Do you for something like an automatic weapon? Well, I had the same problem, Mouse>Button Is Down>System Create Object>Bullet

    And that would spam the creation of bullets. So what did I do? Well, I created a global var named "CanShoot", then for the first event, I did:

    Mouse>Button Is Down>System Create Object>Bullet

                        >System>SetValue>CanShoot to "false"

                        >System>Wait 1

                        >System>SetValue>CanShoot"true"

    Then I added a condition to the Mouse>Button Is Down for checking if CanShoot was true or false.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks Very much. But when i add the action >System>SetValue>CanShoot to false it says "Unknown Expression "False" "

  • variable = 0

        - make bullet

        - set variable to 10

    variable > 0

        - subtract 1 from variable

  • mediafire.com

    still cant get it to work heres the download link.

    This is just an example not my actual game.

    <img src="smileys/smiley1.gif" border="0" align="middle" />

  • mediafire.com

    still cant get it to work heres the download link.

    This is just an example not my actual game.

    <img src="smileys/smiley1.gif" border="0" align="middle" />

    Works here. Had to change 10 to a bigger value to really notice the difference

  • Oh my goodness.. I feel stupid thankl you so much for your replies i got it to work! <img src="smileys/smiley1.gif" border="0" align="middle" />

  • hmm i have another idea of doing this by 1 event :

    condition1: if keyboard z pressed:

    condition2: system : compare two values ( bullet.count <= 0 )

    action : create bullet

    action2: wait any seconds

    action3: bullet destroy

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