- Joined
- Jun 26, 2017
- Messages
- 886
I am making a math game and I am using the same game mechanics for different exercises like addition or multiplication.
Untill now I was using the same code for each game modifying it with a global variable called appType and two or three select blocks to have different behaviour.
Then I have an abstract class for the handling of the exercises, which is extended by each exercise class.
Now I wonder if there is a better solution. Maybe have the code that is used in every game separated in some Modules that are imported in each game.
How are you solving these problems? I think it is the same with bigger testing environments?!
Untill now I was using the same code for each game modifying it with a global variable called appType and two or three select blocks to have different behaviour.
Then I have an abstract class for the handling of the exercises, which is extended by each exercise class.
Now I wonder if there is a better solution. Maybe have the code that is used in every game separated in some Modules that are imported in each game.
How are you solving these problems? I think it is the same with bigger testing environments?!