Jump to content

Recommended Posts

Posted

I have written my le2 game in the c language without too many probs but when I buy le3 I will have to decide on c++ or lua.

 

I know almost nothing about lua so my question is this: is it a short step from c to c++ or should I learn lua?

What do you think?

 

Maybe after a short time someone should run a poll on which language is most used with Leadwerks 3.

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Posted

I think Lua is good for simple behavior and learning. For performance you will want to write demanding code in C++. We made Darkness Awaits in pure Lua just because it's easy to understand, but in reality you would probably use C++ for the AI and player, just because it would allow you to have more characters active at once.

 

Most games will probably use a combination of C++ and Lua. C++ for the main code, Lua for simple things like doors and game level interactions.

 

 

Posted

Thanks. I will be looking for a first person example to get me started. I am no good at setup code but ok at gameplay stuff. Anything in the main loop I can handle.

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Posted

Please dont make the mistake and equal c with c++, c++ is based on c but has some major improvement (new(constructor)/delete(destructor), templates, classes (private/public/proctected, inheritance, virtual)..... etc.)

 

When you mastered c, c++ isnt that hard but there are differences (malloc/realloc/free vs new/delete ... dont to mention stl).

Posted

Now your scaring me.ohmy.png

 

I probably won;t need most of those.

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Posted

Oh you will, because

 

class mytest
{
public:
 mytest() : someint(0), somefloat(0.0f)
 {
   calcsome();
 }
private:
 int someint;
 float somefloat;
 void calcsome()
 {
 }
}

int main()
{
 mytest* test = new test();
 // or
 mytest test2();
}

 

is much better then somethind like

int someint;
float somefloat;
void calcsome()
{
}

void xyz_init(int a, float B)
{
someint = a;
somefloat = b;
calcsome();
}

int main()
{
 xyz_init(0, 0.0f);
}

Posted

Please dont make the mistake and equal c with c++, c++ is based on c but has some major improvement (new(constructor)/delete(destructor), templates, classes (private/public/proctected, inheritance, virtual)..... etc.)

 

When you mastered c, c++ isnt that hard but there are differences (malloc/realloc/free vs new/delete ... dont to mention stl).

I probably use about 2/3 of those things. The subset of C++ we stick to is pretty simple to use. I wanted to keep things simple so we could be sure it would compile everywhere.

Let's build cool stuff and have fun. :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...