Hello,
So, I'm currently making a rogue-like game (pretty sure I start every thread I make like that lol) and I find myself questioning the implementation of OOP in what I have so far. (2-D tile side-scroller btw).
Finding it hard to find the words for describing my design, sorry in advance if I am unclear
Here some classes that are relevant to my question:
Main game class
This contains my main game loop, and the 'master' draw function
Screen class
This is a base class for all of my, um, screens, menu's, game over and ingame
Ingame screen class
inherits from screen, overrides the draw function to draw tile map and at the moment the entities and the player
has a Room array for map
Room class
contains tile array and entity list (vector)
At the moment I have a Screen variable in the Main game class which I change between on calls, which works fine.
To me, it seems natural for the Level map (of Rooms) and the player should be in the Main game and update from there, rather than going through the calling them (or updating them in) IngameScreen class.
I would do this, but then that lies to a hurdle of setting/getting them in the Screen class.
Its easier to leave them in the IngameScreen class, but, then problems comes with input (I have a working system).
As I said, communication isn't as fluid as it could/should be (sorry[words why do you escape me :( ]). But if you have any thoughts let me know.
thanks