Just a general question about scripts

So is the creation of single scripts for each game object just an organizational tool in the creation of games? Technically, it could all be in one script right? But it’s used in a manner to find your specific code quicker??

I like it broken down in chunks like this but just trying to wrap my head around it this morning.

Right or wrong?

Jenn

Hi Jenn,

You are right. Theoretically, most things could be done in one script, and even in one method. However, that approach is considered as bad practice because walls of code are usually hard to debug. For this reason, we follow the single responsibility principle. Everything has got a specific purpose/task.

Break the logic down into graspable chunks but keep an eye on the overall concepts. If there are too many chunks, the code will become hard to read/debug, too.

Makes sense… Ty Nina… I think it’s great that it’s broken down in chunks…

I can only imagine if a HUGE game were in one script… One of my favorite Unity games is Ori… I love platform games. Wonder how many scripts that thing had…

As I take this class, it makes me look at games a little different. Oh, that bounces. Oh, that fires… etc…

Ori is awesome. I played it a couple of months before I started learning Unity. And when I started with Unity and got familiar with the game engine, I had a new point of view on the game, and I admired the work of its creators even more. It’s definitely not something that a single developer could put together within a few days. I recently bought Ori and the Will of Wisps. Unfortunately, I haven’t found time to play it yet.

It bodes well that you are analysing the/a game from the prespective of a game developer because it means that you are genuinely interested in this field, which is, in my opinion, a prerequisite to become good/better. Furthermore, you can learn a lot of techniques and solutions by doing that. :slight_smile:


See also:

2 Likes

I also have Ori and the Will of Wisps… I have barely started it as well. Both Ori’s are just beautiful games. So glad they they are downloadable for the switch. The colors in them are so gorgeous. Who ever made them are so talented. I can only dream of being that good, but maybe one day…

That is my kind of platform game…!! So glad someone else loves them as well.

Jenn

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

Privacy & Terms