So my question is, in a situation where you were using scripting to develop a game, what would you script and what would you code in C++? So far I know I obviously will have to have C++ handle my draw (openGL) calls, but besides that, I feel like things like sprite classes and game logic could be developed in either language fairly easily.
Some people prefer to code nearly the entire game in script, others only script unique events. Personally, I would:
- All types of controller - player, camera, AI...
- Events, dialoges, cutscenes (some visual scripting language is still a huge plus here)
- Specific behaviour of single game objects
- All graphical algorithms. I quess your game is 2D based on you mentioning sprites, but you know, you *could* even script-bind your opengl-drawcalls... I wouldn't recommend it.
- Things that are performance-critical. Yeah, you can program things like A*-paththinding and core AI in script, but I would rather do those things in code than script.
- Everythings thats a "core" aspect of your game, and is largely reusable. Notice, this is merely my opinion, but I really think it is better to write stuff like gui, input, physics etc in code, and add script binding where you need it. For me, scripting is best used, as I mentioned, to handle very specific behaviour where otherwise you would end up creating a new class for each and every game object. Everything that is largely reusable and easy to reuse (like, almost all your game entities will need some sort of physics interaction so you can easily hardcode this, as a basic example).