Classes are useful for exactly what you're talking about here. If you wanted to handle an arbitrary number of players without using classes, you could, by using dictionaries or arrays, but you'd soon find that you basically reinvent the way classes work with the functions and such you'd have. A class isn't just a collection of variables. It's also things you can do with those variables, applied to whichever instance you're interested in. And with BGT, you can rely on all instances of a given class to have the same variables and methods, whereas if you're adding and removing and modifying variables in arrays or dictionaries in a less structured way, it's actually quite easy to forget something, or cause a swarm of index out of bounds errors, etc.
The two things that are a little bit strenuous to get use to with BGT are rare outside of BGT. Those are the way handles are implemented (not too different from C++, but enough so to be confusing), and the lack of a "new" keyword or similar to make creating new objects easier. I usually write a new_x function, where x is the name of the class, to get around the latter. Handles ... someone should just make a whole tutorial on how to use those.
The more complex your project becomes, the more useful classes will be instead of parallel arrays and dictionaries. I'll grant that I was able to get away without really learning how to use them for, like, a year, year and a half? In Javascript, where arrays work very differently. For something like players for an online game, though, I'd strongly recommend a class, since you might find that you need to add or change something later, and it's much easier to avoid missing anything if all the relevant parts are in a class.
看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
George... Don't do that.