Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
Hello everyone, I am creating an action game in which the player can shoot by left-clicking the mouse. Only, I ha spams the left mouse button the game becomes too easy.
Is there a way to prevent the player from shooting repeatedly ?
Develop games in your browser. Powerful, performant & highly capable.
You'll want to set a timer variable.
Something like this:
on left click:
if timer > 0.5:
--> shoot bullet
--> set timer to 0
--> add dt to timer
You can change the '0.5' to change the possible rate of fire. You can also change 'on left click' to 'left button down' to allow them to hold the mouse button down to keep firing.
Thanks Sqiddster for awnsering this fast !