Quote:Original post by Anonymous Poster
I think the above guy with the DLLs is pulling your leg.
Thats totally unecesarry for a simple game.
ummh, off the top of my head I'd say to look into Function Pointers. and have multiple gamemode functions that can be swapped at startup depending on what mode you choose.
im not pulling his leg, if he goes the route of function pointers the step of letting those pointers point to functions in dlls is trivial.
The class example i gave (zelcious beat me to it slightly but i hadn't read his post while i wrote mine) is pretty much the same as function pointers (except you have a single pointer to a class containing a group of methods instead).
Quote:
PROBLEM: In this new game, this cannot be made that simple because there will be more than four modes (single player classic, single player time attack, two player time attack etc. etc. etc), and each one will present a very different behaviour.
the key points here are:
* more than four modes
* very different behaviour
thus function pointers or abstract classes/inheritance is probably the best options, both of those can easily be replaced with dlls or scripts.
with function pointers you simply load the dll and let the pointers point to functions inside the dll.
the abstract class would be switched out for a loader and/or wrapper class in the case of scripts or dlls.
The wrapper/loader class would then contain function pointers that are initialized by the constructor (the constructor taking the name of the dll as an argument)