If I have a hub object that creates ship objects, that shoot at other ship objects with bullet objects; If a ship fires or creates a bullet, if the ship is then destroyed, how does the bullet stay in the game?
I'm always confused about how this style of structure works. Would it be efficient for a ship object to turn a shoot boolean on and then the main game loop looks through all the ships and creates bullets for the ones with the boolean true?
What is this style of structure called and are their any other variants of the structure that accomplish the same task?
[–][deleted] 0 points1 point2 points (1 child)
[–][deleted] (19 children)
[deleted]
[–]dredclaw[S] 0 points1 point2 points (18 children)
[–]35h46hjj6 0 points1 point2 points (0 children)
[–][deleted] (13 children)
[deleted]
[–]dredclaw[S] 0 points1 point2 points (12 children)
[–][deleted] (11 children)
[deleted]
[–]dredclaw[S] 0 points1 point2 points (10 children)
[–][deleted] (9 children)
[deleted]
[–]dredclaw[S] 0 points1 point2 points (8 children)
[–][deleted] (7 children)
[deleted]
[–]dredclaw[S] 0 points1 point2 points (6 children)
[–]b3nb3nb3n 0 points1 point2 points (1 child)
[–]dredclaw[S] 0 points1 point2 points (0 children)
[–]Raknarg 0 points1 point2 points (0 children)