Answer the question
In order to leave comments, you need to log in
What patterns or what approach is best to use in this task?
It is necessary to develop a class library that would fully implement the logic of the game - let's say a Pacman clone, and then use it when developing a graphical representation. The main point is that the graphical representation can be different (2d, 3d). It should be completely independent of the logic of the game itself and be substituted by choice.
Answer the question
In order to leave comments, you need to log in
Implementation of IoC (Inversion of Control) via Dependency Injection.
Describe the game logic by hiding all components that should be unstable/flexible (see Stable Abstractions Principle) behind abstractions (interfaces/abstract classes).
All you need is the absence of any direct dependencies on the implementation of the UI (user interface) and, preferably, input devices.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question