Should I Allocate This On The Heap?

closed account (zb0S216C)
I'm building a small concept game. The player holds a torch( flash light if you're American ) that requires batteries every time the torch's batteries die. In the game, there will be multiple instances of the DFBATTERY( at least 100 ). I was wondering, should I allocate the members of DFBATTERY onto the heap?
that's most likely. though your description isn't elaborate enough to say for sure.
closed account (zb0S216C)
Thanks for the reply hamsterman. The DFBATTERY structure is of type class and has 3 members overall: 2 booleans and 1 unsigned. The structure also has multiple methods.
I was more thinking about the nature of the game itself. I assume it's something where you have to run around in a map and there may be batteries lying in certain places. There are always several approaches. All of them will use dynamic memory at some point. If it's a tile based map, a tile could hold a (possibly null) pointer to a battery. If it's not, you should probably have a list of all batteries and their coordinates.
closed account (zb0S216C)
OK. Thanks, hamsterman.
Topic archived. No new replies allowed.