relay01
Level 0
<<<o>>> = Dopler Effect
|
|
« on: June 02, 2010, 01:38:05 PM » |
|
So I've been pondering the line where code meets game resources and have been wondering what is a better idea.
Say we have several high to lower level game resources like sprites, sounds, levels, player(s), menus, etc. implemented in code and now we just have to all have them work together to form what we would consider a game.
Idea 1: It can only be assumed that things like sprites and sounds may be tied to a higher level classes like level and player.
Each high level may have its own lower level data types.
This would make the programmer have to implement resource management for every higher level class.
So basically in this scheme, each higher level class would manage their own resources. For instance Level handles their sprites, sounds, and music - Player handles it's own sprites, sounds, and music.
Idea 2: Rather then having some of the higher level classes like level and player manage their own resources, we implement an even higher level class that manages all resources like say "GameHandler" that each lower level class only contains routines used to make modifications to the game data.
In this scheme, Level just worries about doing it's own level stuff, and it's up to a higher GameHandler to worry about the resourses associated with it.
I'm not sure if this makes sense, its kindof hard to describe I guess.
Basically I'm asking, what do you think the best way of managing game resources is?
What are the pros and cons as they pertain to game speed and code maintainability, or readability.
|