Forum

> > Off Topic > Lua vs. C++
ForenübersichtOff Topic-ÜbersichtEinloggen, um zu antworten

Englisch Lua vs. C++

34 Antworten
Seite
Zum Anfang Vorherige 1 2 Nächste Zum Anfang

alt Lua vs. C++

Greenhawk
User Off Offline

Zitieren
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!

Tell me what you guys think.

alt Re: Lua vs. C++

Yates
Reviewer Off Offline

Zitieren
C++ obviously.

Just look, it has two friggin' plus signs! (++)

alt Re: Lua vs. C++

Greenhawk
User Off Offline

Zitieren
user Assassin moder hat geschrieben
C++ is a programming language.

LUA is like scripted based.


Let's say i wanted to make a game. I know I would use Lua for the game objects and etc. but what would I use C++ for?

alt Re: Lua vs. C++

Infinite Rain
Reviewer Off Offline

Zitieren
С++ Is programming language. Lua is scripting language. The difference between two is freaking obvious.

user Greenhawk hat geschrieben
Let's say i wanted to make a game. I know I would use Lua for the game objects and etc. but what would I use C++ for?

You would use C++ for everything.

alt Re: Lua vs. C++

DC
Admin Off Offline

Zitieren
user Greenhawk hat geschrieben
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).

alt Re: Lua vs. C++

Greenhawk
User Off Offline

Zitieren
@user 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

alt Re: Lua vs. C++

DC
Admin Off Offline

Zitieren
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.

alt Re: Lua vs. C++

Assassin moder
User Off Offline

Zitieren
@user Greenhawk: You can also use C# indeed. I'm using it to programming with it. It's simple, also, I don't saw any C++ code, just C# so..

Second: Blitwizard 2D is open source so you can use both.

alt Re: Lua vs. C++

Alpha Beta
User Off Offline

Zitieren
You can still get BlitzPlus for free. It's similar to BlitzMax (CS2D was written in it), but less features.

edit://

I just realized that you can download the BlitzMax successor, Monkey X, for free!
That's probably the best choice for you.
2× editiert, zuletzt 29.05.14 20:18:54

alt Re: Lua vs. C++

Infinite Rain
Reviewer Off Offline

Zitieren
@user 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.

alt Re: Lua vs. C++

Alpha Beta
User Off Offline

Zitieren
Never said it wasn't. But if you can get something for free, then better take it.
But yeah, you can try Monkey.

alt Re: Lua vs. C++

Greenhawk
User Off Offline

Zitieren
Thank you all for the info. I'll start with LOVE 2D and if I don't like it, I can just make my own engine
Zum Anfang Vorherige 1 2 Nächste Zum Anfang
Einloggen, um zu antwortenOff Topic-ÜbersichtForenübersicht