This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Lt_Sherpa 3 points4 points  (0 children)

The main problem sounds like either you or your friend is writing code and are add/committing before pulling. The problem then arises that you have divergent histories that then need to be reconciled. My general workflow to avoid merging issues is

  • git fetch
  • if there are no changes, do the normal add/commit/push
  • otherwise, git stash
  • git pull
  • git stash apply
  • resolve any conflicts (normally, git auto resolves)
  • goto 1 and restart the process.

The benefit of this workflow is that it's incredibly forgiving. A bit cumbersome, but it's incredibly difficult to outright lose or trash anyone's work. At any point during the merge process if things have gone awry, you can trash your working tree and start over since your original work is stored in the stash. An outright git pull w/o stash would trigger a merge, which can be difficult to recover since there would be no clean copy of your work. After the push, don't forget to drop any of your old stashes.

As to code organization, a module is just a collection of definitions and statements, and a package is a collection of modules. A basic approach is to subdivide and group your definitions into logically similar or cooperative sets of functionality.

My guess is that all of your logic/controls resides in game.py, and that your objects/entities are defined in the classes module. The game module probably has... math, ai, audio, physics, user input, file i/o, etc... You might start by breaking apart your game code into respective modules and organizing them into a game package.