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
In some games, if you press 1, it switches to pistol, then you let go, then you can click to fire. If you press 2, it switches to sniper, then let go, then you click to fire.
How do I simulate that?
What you can do is spawn a pistol sprite or play the pistol animation when 1 is pressed and then test for if the sprite is on screen or the animation playing when the mouse is clicked, from that you can fire the gun. Same with sniper, spawn or start animation when 2 is pressed and then test for if the sniper is on when you click.
Here is an old capx I made for a different but similar question. It does what you want but in it you click the gun picture instead of pushing 1 or 2.. same principle. Click on (A) "button" to fire.
https://drive.google.com/open?id=0Bx-ufu2WID53MWFjT2owWEVEWHc (click the download arrow in upper right corner to download).
Develop games in your browser. Powerful, performant & highly capable.
Thanks to both!