Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualfir

Posted 06 September 2013 - 06:01 AM

I tried to summarize this in an as general way as possible, but deciding where to put the properties depends on what you're trying to do.

The DebugSystem oder HUDManager or whatever you call

 

 

I call it something like Assistant / DebugAssistant but also had some trouble with it (It is how to manage it clearly).

 

I tried to summarize this in an as general way as possible, but deciding where to put the properties depends on what you're trying to do.

The DebugSystem oder HUDManager or whatever you call

 

the part for displaying doesn't contain a "loop sleep time" property.Imagine you would not have to use the game loop and you still would have to draw the HUD and debug messages (e. g. a model viewer or dialog editor or whatever). There still would be a HUDManager and a DebugSystem.
Imagine you decided not to use any HUD in your game and it's done so the DebugSystem isn't necessary anymore. You still would have to use the loop and know the sleep time.
In this case and in my opinion it's obvious (after thinking about this) the sleep time is a property of the game loop thing.

But you may also could still end up with at least 2 classes and both should contain a specific value, object, or list of values or objects. An example: every object within your game has a sprite and you need all sprites in the "DrawingStuffManager". In my opinion it's caused by a bad design and in this case the game objects should contain their sprites. When it comes to drawing the scene you could call the environments/levels/worlds "draw" Method which itself calls the game objects "draw" method so there is no need for a central sprite drawing class or it could be passed as parameter to the draw methods.

In general speaking: when trying to remove global variables you have to think about who is the true owner of this variables ("whose property is this?").

 

I agree that Sleep variable should probably belong to loop module, (this is window module)

 

 The thing that worries me is that I need to spread  a reference to it over a couple of modules

 

 (it may be not clearly described reference it just my be acces through Sleep name from many parts of code - some 'transparent' references just like reaching the globals, but still they are references)

 

this is some kind of something like small reference explosion I would like to awoid.


#4fir

Posted 06 September 2013 - 06:00 AM

I tried to summarize this in an as general way as possible, but deciding where to put the properties depends on what you're trying to do.

The DebugSystem oder HUDManager or whatever you call

 

 

I call it something like Assistant / DebugAssistant but also had some trouble with it (It is how to manage it clearly).

 

I tried to summarize this in an as general way as possible, but deciding where to put the properties depends on what you're trying to do.

The DebugSystem oder HUDManager or whatever you call

 

the part for displaying doesn't contain a "loop sleep time" property.Imagine you would not have to use the game loop and you still would have to draw the HUD and debug messages (e. g. a model viewer or dialog editor or whatever). There still would be a HUDManager and a DebugSystem.
Imagine you decided not to use any HUD in your game and it's done so the DebugSystem isn't necessary anymore. You still would have to use the loop and know the sleep time.
In this case and in my opinion it's obvious (after thinking about this) the sleep time is a property of the game loop thing.

But you may also could still end up with at least 2 classes and both should contain a specific value, object, or list of values or objects. An example: every object within your game has a sprite and you need all sprites in the "DrawingStuffManager". In my opinion it's caused by a bad design and in this case the game objects should contain their sprites. When it comes to drawing the scene you could call the environments/levels/worlds "draw" Method which itself calls the game objects "draw" method so there is no need for a central sprite drawing class or it could be passed as parameter to the draw methods.

In general speaking: when trying to remove global variables you have to think about who is the true owner of this variables ("whose property is this?").

 

I agree that Sleep variable should probably belong to loop module, (this is window module)

 

 The thing that worries me is that I need to spread  a reference to it over a couple of modules

 

 (it may be not clearly described reference it just my be acces through Sleep name from many parts of code - some 'transparent' references just like reaching the globals)

 

this is some kind of something like small reference explosion I would like to awoid.


#3fir

Posted 06 September 2013 - 05:59 AM

I tried to summarize this in an as general way as possible, but deciding where to put the properties depends on what you're trying to do.

The DebugSystem oder HUDManager or whatever you call

 

 

I call it something like Assistant / DebugAssistant but also had some trouble with it (It is how to manage it clearly).

 

I tried to summarize this in an as general way as possible, but deciding where to put the properties depends on what you're trying to do.

The DebugSystem oder HUDManager or whatever you call

 

the part for displaying doesn't contain a "loop sleep time" property.Imagine you would not have to use the game loop and you still would have to draw the HUD and debug messages (e. g. a model viewer or dialog editor or whatever). There still would be a HUDManager and a DebugSystem.
Imagine you decided not to use any HUD in your game and it's done so the DebugSystem isn't necessary anymore. You still would have to use the loop and know the sleep time.
In this case and in my opinion it's obvious (after thinking about this) the sleep time is a property of the game loop thing.

But you may also could still end up with at least 2 classes and both should contain a specific value, object, or list of values or objects. An example: every object within your game has a sprite and you need all sprites in the "DrawingStuffManager". In my opinion it's caused by a bad design and in this case the game objects should contain their sprites. When it comes to drawing the scene you could call the environments/levels/worlds "draw" Method which itself calls the game objects "draw" method so there is no need for a central sprite drawing class or it could be passed as parameter to the draw methods.

In general speaking: when trying to remove global variables you have to think about who is the true owner of this variables ("whose property is this?").

 

I agree that Sleep variable should probably belong to loop module, (this is window module)

 

 The thing that worries me is that I need to spread  a reference to it over a couple of modules

 

 (it may be not clearly designed reference it just my be acces through Sleep name from many parts of code - some 'transparent' references just like reaching the globals)

 

this is some kind of something like small reference explosion I would like to awoid.


#2fir

Posted 06 September 2013 - 05:58 AM

I tried to summarize this in an as general way as possible, but deciding where to put the properties depends on what you're trying to do.

The DebugSystem oder HUDManager or whatever you call

 

 

I call it something like Assistant / DebugAssistant but also had some trouble with it (It is how to manage it clearly).

 

 

 

 

 

 

I tried to summarize this in an as general way as possible, but deciding where to put the properties depends on what you're trying to do.

The DebugSystem oder HUDManager or whatever you call

 

the part for displaying doesn't contain a "loop sleep time" property.Imagine you would not have to use the game loop and you still would have to draw the HUD and debug messages (e. g. a model viewer or dialog editor or whatever). There still would be a HUDManager and a DebugSystem.
Imagine you decided not to use any HUD in your game and it's done so the DebugSystem isn't necessary anymore. You still would have to use the loop and know the sleep time.
In this case and in my opinion it's obvious (after thinking about this) the sleep time is a property of the game loop thing.

But you may also could still end up with at least 2 classes and both should contain a specific value, object, or list of values or objects. An example: every object within your game has a sprite and you need all sprites in the "DrawingStuffManager". In my opinion it's caused by a bad design and in this case the game objects should contain their sprites. When it comes to drawing the scene you could call the environments/levels/worlds "draw" Method which itself calls the game objects "draw" method so there is no need for a central sprite drawing class or it could be passed as parameter to the draw methods.

In general speaking: when trying to remove global variables you have to think about who is the true owner of this variables ("whose property is this?").

 

I agree that Sleep variable should probably belong to loop module, (this is window module)

 

 The thing that worries me is that I need to spread  a reference to it over a couple of modules

 

 (it may be not clearly designed reference it just my be acces through Sleep name from many parts of code - some 'transparent' references just like reaching the globals)

 

this is some kind of something like small reference explosion I would like to awoid.


#1fir

Posted 06 September 2013 - 05:49 AM

I tried to summarize this in an as general way as possible, but deciding where to put the properties depends on what you're trying to do.

The DebugSystem oder HUDManager or whatever you call the part for displaying doesn't contain a "loop sleep time" property.
Imagine you would not have to use the game loop and you still would have to draw the HUD and debug messages (e. g. a model viewer or dialog editor or whatever). There still would be a HUDManager and a DebugSystem.
Imagine you decided not to use any HUD in your game and it's done so the DebugSystem isn't necessary anymore. You still would have to use the loop and know the sleep time.
In this case and in my opinion it's obvious (after thinking about this) the sleep time is a property of the game loop thing.

But you may also could still end up with at least 2 classes and both should contain a specific value, object, or list of values or objects. An example: every object within your game has a sprite and you need all sprites in the "DrawingStuffManager". In my opinion it's caused by a bad design and in this case the game objects should contain their sprites. When it comes to drawing the scene you could call the environments/levels/worlds "draw" Method which itself calls the game objects "draw" method so there is no need for a central sprite drawing class or it could be passed as parameter to the draw methods.

In general speaking: when trying to remove global variables you have to think about who is the true owner of this variables ("whose property is this?").

 

I agree that Sleep variable should probably belong to loop module,

 

 The thing that worries me is that I need to spread  a reference to it over a couple of modules

 

 (it may be not clearly designed reference it just my be acces through Sleep name from many parts of code - some 'transparent' references just like reaching the globals)

 

this is some kind of something like small reference explosion I would like to awoid. 


PARTNERS