eliasreid / rad-shooter

Simply c++ arcade-y shooting game using SDL. WIP, no installer
1 stars 0 forks source link

Not cleaning enemies on remove_if, or app exit. #11

Closed eliasreid closed 4 years ago

eliasreid commented 4 years ago

Maybe just change the data structure. Might as well have regular array with a max # of enemies, therefore no need for dynamic allocation of the vector.

Go for std::array

eliasreid commented 4 years ago

vector has an under the hood capacity - can reserver memory by calling reserve function. So I can reserve like 50 enemies, then no dynamic allocation until that point.