Should the main game object be static in c++
Posted
by
Som_kun
on Game Development
See other posts from Game Development
or by Som_kun
Published on 2012-07-07T04:39:06Z
Indexed on
2012/07/07
9:26 UTC
Read the original article
Hit count: 259
I am creating a 2d platformer using SDL and I was thinking that my game object could be static, but I wasn't sure if this was a good idea.
The pros (that I can see):
- Accessing settings options (such as screen size and keyboard bindings) would be easier accessed
- There should only ever be one main game loop, so this makes sure for me.
The cons:
- From what I've heard, static classes in C++ are a bear to work with
- I've read that this may cause problems later in development (things don't work right or can't be used properly
© Game Development or respective owner