Why game not player?

In the Unity 2D course, we were taught that functions should live on the asset being effected.

With that in mind, why is the game losing lives, and not the player ship?

1 Like

I think in this case its simplicity as this is an introduction into how to use Godot.
It could be simply put that instead of “lives” as a rocket doesnt have lives that its “Tries” and then it would be a game variable and so would live in the game script and the game node.

However for the simplicity of not having to fetch the lives from the player script to know when the game is over this is why is was done this way.

You are quite correct though in a more advance tutorial (Like in our 3D course) we would have the player containing the lives and getting that variable in the game script or even use a signal to achieve that.

2 Likes

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms