Fire Weapons with Key.addListener

Call the Fire Function

We did the if(Key.isDown()) conditionals in the previous exercise, so it shouldn't be much of a stretch for you to call the fire function when the SPACE key is pressed:

Test it out. You'll notice how easy it is to go wild with the laser just by holding down the space bar:

Content on this page requires a newer version of Adobe Flash Player.

Get Adobe Flash player

That's no good... we're on the path to building a game that won't be very challenging.