Recently I'm working on a 2d game engine example in .Net with C#. My main problem is that I can't figure out how I should include the game logic within the game. Currently I have a base engine which is a set of classes that they are running sub-systems like
Core functionality. There is an editor which helps the user to add resources, build levels, write scripts and other stuffs.
I came up with an idea to use Reflection and
CSharpCodeProvider from my editor to compile the written code. This way I can get an executable of my product too. This way is quite well but I would like to know what's really the solution and architecture to do this.
My engine's role is 2d platform. The scripting language is C# right now because I can't consist any other embeddable language for now. The game needs compilation and
CSharpCodeProvider is the only way for me to do it meantime.