• Advertisement
Sign in to follow this  

[.net] C# game - using the singleton pattern for the gameengine

This topic is 4737 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, i´m currently designing a little gameengine in c# and managed directx. thinking about the core of the game (containing the timer, physicsclacs, gamelogic and input processing) i wan´t to use the singleton pattern so i can access i. ex. the timer for my splashscreens or the gametime. i how far would this pattern slow down my performance or disadvantages would it bring along, because i´ve never seen it in any examplegames or tutorials ... ? thnx the Dude [Edited by - mauzi_the_Dude on March 4, 2005 12:16:35 AM]

Share this post


Link to post
Share on other sites
Advertisement
Hi Mauzi!

The singleton pattern doesn't slow down anything - it may give you a little perfomance boost because you don't have to send your timer etc. in other functions every frame or at startup.


You can use the pattern if:
.) You just want to do it fast and get it working.


But you don't have to use it if you design your system in a way that everything "plays" its own roll. But that is not that easy and you will have to learn alot till you can. ( I myself too! )

If this is one of your first engines then I would say GoForIt! and use the singleton- pattern. You don't want to make Source2- do you? :)

Bye,
Riddle.

Share this post


Link to post
Share on other sites
not really, i'm please when i get the whole thing working alright.
thnx for the motivation then i'll go for it ;)

i'll keep you update with the progress

greetz the Dude

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement