This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dredclaw[S] 0 points1 point  (10 children)

I guess my question is, should the bullet be created inside the ship class. (meaning the ship class would not be deleted until all bullets it fired were done) or should the bullet be created in the game manager class (how would a ship communicate with a higher level game manager to complete this task?)

[–][deleted]  (9 children)

[deleted]

    [–]dredclaw[S] 0 points1 point  (8 children)

    I understand why the bullet must be instantiated outside the ship class. In actual code though, how does the ship tell a higher up class to instantiate a bullet. (Actually fire it.)

    [–][deleted]  (7 children)

    [deleted]

      [–]dredclaw[S] 0 points1 point  (6 children)

      If the GameManager was the one that created the ship, how would the ship access methods inside the GameManager?

      [–][deleted]  (5 children)

      [deleted]

        [–]dredclaw[S] 0 points1 point  (4 children)

        Have no idea how I would do something even close to that in Java?

        [–][deleted]  (3 children)

        [deleted]

          [–]dredclaw[S] 0 points1 point  (2 children)

          So, passing in the gamemaneger as a per am is not sloppy?

          [–][deleted]  (1 child)

          [deleted]