Though, at this point, since I don’t yet have a good understanding of what is happening with the syntax OR what is happening under the hood in terms of add, get I thought it might be easier to understand if I limit myself to solving with PVector only. And then move on to creating separate object classes.
However perhaps my reasoning is faulty in following that rationale… This is a case of I don’t know what I don’t know…

how to remove the bullets (in a backward for-loop) that are dead (because they left the screen or hit something, then the variable dead in the class Explosion is set to true). The core idea is to set a variable dead and don’t display the bullet when dead is true. Then in the backward for-loop we remove the dead ones finally from the ArrayList.

My thinking is to make grids that are contained within selected grid cells.
Pseudocode:
1/ make a base grid of cells
2/ then loop thru the base grid cells
3/ determine which grid cells would then be subdivided into a grid of smaller grid cells via random, modulo, probability, or another determinant
4/ then make a grid of cells that is contained within a cell’s width and height

I think I understand how to do the first three steps. I’m not sure how to implement step #4.

3/ determine which grid cells would then be subdivided into a grid of smaller grid cells via random, modulo, probability, or another determinant

that could be done via mouse click as well (to select a cell to subdivide)

debxyz:

4/ then make a grid of cells that is contained within a cell’s width and height

This new grid of cells could just go into the same ArrayList (if you store the rectangle’s size also). No matter whether you store the data in two parallel ArrayLists or in one ArrayList with a class: When you init the new sub-grid within a previous cell just assign the new sub-cells the right position and size. No need to come up with a new data structure or a new ArrayList.

This new grid of cells could just go into the same ArrayList (if you store the rectangle’s size also). No matter whether you store the data in two parallel ArrayLists or in one ArrayList with a class: When you init the new sub-grid within a previous cell just assign the new sub-cells the right position and size. No need to come up with a new data structure or a new ArrayList.

This is definitely helpful info as I had been wondering about whether I need a second ArrayList to store the sub-divides. Thank you so much!!

we replace one cell with four cells that fill the space of the old cell

the calculation of the pos and size of the four new cells is done in mousePressed() and then just brought into the four new cells into the ArrayList. You had calculations in the class SubGrid . Not needed.

Did you notice that you can (like in the image) click in a cell, and then click in a sub-cell and then again in a sub-cell and so on?

I see. This is starting to make more and more sense.
I think part of my problem has been transitioning from the regular array[] mind set to ArrayList mind set… ArrayList feels much more nebulous right now…
But seeing these examples is super helpful!
Many thanks again for your help!