Why two methods?

Hi! In the video you seperate the boost input and the rotations inputs in two methods, is there a particular reason? Does it affect the game in any way?

Hi Zodi,

Welcome to our community! :slight_smile:

Theoretically, we could keep everything in one method. However, in larger games, the code quickly becomes larger and difficult to maintain. For this reason, it is good practice to follow the single responsibility principle to organise our code.

If something goes wrong, for example, with the rotation, we know exactly where to look for it and don’t have to waste our time reading other code to identify the relevant parts for the rotation.

Did this clear it up for you? :slight_smile:


See also:

1 Like

Yes thank you very much! I was worried i wouldnt get help considered how old this course is but im glad I can get active help and support still to this date.

I’m glad I was able to help. :slight_smile:

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

Privacy & Terms