Ok i have a mc called dracoplay and inside is another mc called Drakep and inside that there is another mc called wing and head as you may have guessed they make up a dragon. So dracoplay is the character that gets coded. Drakp is the body and the head and wing have animations. Now my problem is making it breath fire so that it will keep firing until i let go of the left click (I already found a way for it fire when i click but i have to click again for it to stop). I would also like for it to shoot towards the mouse.
Share
from what i’m seeing, you should use two eventListeners, a mouseDown and mouseUp-event 🙂 I’ll write some basic code that should help you.
these two eventListeners should be added in the constructor of your code. Then, the toggleFire-method will look like this:
the last function you need is the breatheFire-function.
and this should do the trick.