we have deleted with for loops. but we do something much better using while loops.
starting with a new project, we copy our entity class from our previous '080_centerPosition' project & updated it.
then making a player class which extends with our entity class.
coding an array of players, then 3 functions: one to create, one to delete & the last to make a type of border our player array will delete itself once passed.
we then lastly update our movement, render & make sure we can use our mouse to create & delete players in the array.
now we can delete any entity in any order no matter what, making this a much better option for handling deletion of entities
SUPPORT ON PATREON FROM AS LITTLE AS $1:
intro & outro music is from this EP:
like, share & subscribe to stay up to date.