| 03-21-2006, 10:09 AM | #1 |
Hi, I have been wondering which would be better. Let us say that i have a global variable named udg_reusablePoint and at some point, I would assign a point to it (the center of a region for example, where creeps spawn). This point is to be used more than once and rather frequently (periodically, every 20 seconds). Assume that it will be used until the game ends. Which would be better? To assign the center of the region to udg_reusablePoint at map initialization and keep it there (since it is always used)? Or to assign it and then destroy it everytime I use it? |
| 03-21-2006, 10:26 AM | #2 |
Of course faster way is to assign and keep it. |
| 03-21-2006, 02:59 PM | #3 |
But then that point variable is not really "reusable" in a sense that you could use it for all temporary location objects. |
| 03-21-2006, 10:57 PM | #4 |
Do you mean that I can assign a different value for that variable (so the previous value is no longer reusable)? Hmm, that wouldn't be a problem when I never modify it after its initiaaaaal... instanciation? Would it? Oh, and when I assign a different value to it, does the older value gets overwritten? Or does is go floating about eating space? (._.)? |
| 03-21-2006, 11:21 PM | #5 | ||
Quote:
Quote:
|
