Making game constants/tables available to game logic classes/routines in a modular manner
Posted
by
Extrakun
on Game Development
See other posts from Game Development
or by Extrakun
Published on 2011-03-15T02:25:43Z
Indexed on
2011/03/15
8:22 UTC
Read the original article
Hit count: 363
programming
Suppose I have a game where there are several predefined constants and charts (a XP chart, cost of goods and so on). Those could be defined at runtime, or load from files at start-up. The question is how should those logic routines access the constants and charts?
For example, I could try using global variables, but that cause all classes relying on the variables to be tightly coupled with them.
© Game Development or respective owner