I like C++ and Lua a lot but I'm debating with myself to see which is better, or just simply one relies on the other. I know C++ is a very popular language and all but th code seems to be code within code within another code. At the same time it can be used to program/design anythinh
In Lua it's straight forward and real easy to learn. It is also used in video games for Ai scripts, spawns and etc. Also let's not forget, it was used to make the world wide bodacious and awesome Counter-Strike 2D!
Also let's not forget, it was used to make the world wide bodacious and awesome Counter-Strike 2D!
That's wrong. CS2D wasn't made in Lua. I just "embedded" a Lua script engine in CS2D so you can modify stuff using Lua scripts (older versions of CS2D didn't even have any Lua at all. I added it with later updates).
Games are commonly not completely written in scripting languages like Lua because it would simply be too slow. There are frameworks to script entire games anyway. Löve for example https://love2d.org - but it probably isn't a good idea for large and complex games because of the speed. It works well for little games though.
The main difference between Lua and C++: C++ and most other programming languages are compiled to machine code. This is what the CPU understands and therefore it makes the execution as fast as possible. Scripting languages are either compiled to byte code when needed (just in time compiling) or they are not compiled at all but parsed directly. Both is slower than simply executing precompiled machine code. Especially parsing is always significantly slower. Byte code is marginally slower (Java for example is compiled to byte code for the Java VM).
@ DC: Ohhhh ok. I was gonna use Love2d for a big project too, but now I gotta find another framework . Anyway thanks for the clarity and thanks to the others too
It also depends on the game type of course. Some games simply don't need that much performance or can be optimized very well even when being quite complex and large. Of course you can do a huge point and click adventure with Löve or a jump and run game with tons of levels.
@ Alpha Beta:
CS2D is still written in BlitzMax. And I would not suggest you using BlitzPlus because its graphics features sucks. I'm using it for console-based applications though.