Darthfett / A-Priori-Physics-System

A side-scroller game based upon Mega Man X, with a priori collision detection, and objects being represented as a sequence of connected points.
3 stars 0 forks source link

Reduce Game dependency #38

Closed Darthfett closed 12 years ago

Darthfett commented 12 years ago

Reduce the dependency of other modules and classes upon the game module/class.

By reducing the amount of dependency, modules will be less tightly coupled, and more easily tested and refactored.

One method of approaching this is by using Dependency Injection to provide classes with a 'provider'. For example, the entity classes can use a 'time provider' to get the current time, rather than directly referencing the game module.

Darthfett commented 12 years ago

A search for 'import game' finds only occurrences in 'main.py', and 'test_physics.py' (which needs reworking).