Advertisement

Paradox With Modular Programming in C++

Started by August 04, 2000 10:38 AM
0 comments, last by Whirlwind 24 years, 4 months ago
I am at a logical impass. In an effort to keep things seperated from each other as much as possible, I have came across the first of many problems with this approach. I want to set an entitie''s y (y is up in this case) based on the entitie''s x,z position on a terrain. I really don''t want to toss a copy of the terrain object at the program (although using it as a such might work) since it is a lot more than the module needs. I really don''t want to toss an entity object a the terrain function. If possible, I''d like to keep the object management code seperate from the terrain code, but that probably won''t happen after this realization.
What you need is a ''world manager'' module. This will tie together your map, entities and any other game world elements. Your game-specific code then only needs to interact with the world manager module and not several different ones.

In this case the entity module would process the entity, calculate it''s movement then pass it''s coordinates to the world manager. The world manager would then look up the current game map and extract the correct z value for those coordinates, pass it back to the entity module, which would store it in the entity.

This topic is closed to new replies.

Advertisement