G
G
Gennady Kruglov2019-06-30 21:10:55
Game development
Gennady Kruglov, 2019-06-30 21:10:55

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

2 answer(s)
E
Evgeny Romashkan, 2019-06-30
@robinzonejob

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.

G
Griboks, 2019-07-01
@Griboks

I think you need to create a real-time simulation model , moreover:
- with public properties like coordinates./life...
- check the control input parameters (button pressed, mouse position) every cycle
- the cycle is started from outside

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question