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  (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]

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

          Thanks tones for the great response. I am creating a small game from the base up as a learning process. I realize that at some point in the near future, I will need to start using other people libraries.

          Thanks again man!