Hello I need help regarding my problem.
We know that there are 2 ways on how to listen if a mouse button was pressed:
1st you check it using poll event
2nd you can use the sf::Mouse::isButtonPressed or something like that
If you will ask, I have a sprite that fires a machine gun. So it had to be holding the button down and it fires rapidly. I also have bullet sprite stored inside vector so I can manage it easily.
One thing I have notice is that if I click the mouse button, just ONE click, it had created 70+ pointers for my bullet sprite.
I have tried the poll event. It works great!! 1 bullet per one click, but I cant hold the mouse button.
Is there anyway I could achieve my desired behavior? SHould I check for the rate of fire?
I need a gun that fires either you click the button or you hold it.
Thanks!