obiwac/python-minecraft-clone

~: Refactor everything

Opened this issue · 1 comments

In the interest of maintaining coherency between episodes, I decided not to do that much refactoring, even when the alternative solution was a little clunkier. Things are becoming a little disorganized right now though (albeit still not that bad), so an episode on code structure is probably de rigueur.

Here are the things I'd like to take a look at making better:

  • Little by little, more and more things which needed to be accessible by multiple classes at a time were added to the World class, which is then passed around everywhere. This should be what the Game class is for instead.
  • Block/entity data parsing code should probably be somewhere else.
  • matrix.py was never a good idea. Originally it was to reduce dependencies of the project, but it turns out it makes code needlessly verbose, which isn't worth it.

If you have any other ideas, be sure to add them below as comments!

I probably should've rolled this into episode 13a, forgot about this issue.

Oh well, matrix.py will be replaced in EP13b and I guess I can do the rest during EP13 (cuz I'll have to add another parser for entities and will probably add even more stuff to World).

Cf. #57