jeudi 19 février 2015

I've been taught not to place most methods in a general "System" class but where do they go instead?

I'm making a game. It seems most natural to put almost all the game logic in the Game class, have it create all the objects and have mostly getters and setter methods in them. Is this actually wrong? Should I try to force some of the game logic into the other classes like the process of Player taking his turn as a method of Player?


In a typical game, if a player shooting is triggered by a mouse click, how would you go from the click event to updating the screen state to destroying the target object in terms of where the methods would be located and objects calling each other?


Should I even be getting rid of the Game class and somehow having the other objects all calling each other?


Aucun commentaire:

Enregistrer un commentaire