I want to make a top-down 2d shooting game using libgdx. There will be a lot of bullet objects that I want to keep track of and dispose when they go off the screen. I was thinking that I would use something like
static ArrayList<Bullet> bullets;
to keep track of my bullets in the Bullet class, check this array list for any bullets that are off the screen, dispose of them if they are, and delete that bullet from the ArrayList. I was wondering if this is the best way to do this. It seems like something that should be pretty common and so I wanted to make sure that this is the best way of doing this.