TheCherno / Sparky

Cross-Platform High Performance 2D/3D game engine for people like me who like to write code.
Apache License 2.0
1.1k stars 222 forks source link

Lua support? #23

Open ghost opened 9 years ago

ghost commented 9 years ago

Hey!

As we all know Lua is a great scripting language and since the project it is made in C++ the dev time could take longer than in Java for example.So I think Lua will come in handy!

Edit 1: Will we ever see android support ? Edit 2: Cmake for non windows users?

andreiBatinas commented 9 years ago

Hey! Lua support would be awesome, for Android Support, would need to use OpenGL ES. But adding the possibility to make scripts in Lua would be awesome indeed.

Zelif commented 9 years ago

Considering enscripten side of the program uses OpenGL ES, I don't see this being much of a difficult problem to fix. You would need to pick and choose some of the emscripten defines (main loop ones) and keep the ones u need such as the shaders and ES headers and defines.

LUA would take a while to implement and unless you use it to make the game directly it would be hard to keppy having to update it, LUA is better off when things are less likely to change.

ghost commented 8 years ago

I don't think Lua is a good scripting language. Of course it is easy to learn/understand. However, it doesn't use the conventions of other languages. Example : Arrays start from 1 not from 0

ghost commented 8 years ago

@myrage2000 If these guys used Lua they must have considered Lua as a good scripting language: https://en.wikipedia.org/wiki/Lua_(programming_language)#Video_games https://en.wikipedia.org/wiki/Category:Lua-scripted_video_games

ghost commented 8 years ago

I'm using lua for my projects, and I don't think it's a good language. Even Garry (Garry'smod author) says it, lua isn't that great. Very useful and simple, not good. It also depends on what you want it to do

Jacob-Mango commented 8 years ago

Asking to be assigned on this.

KevinW1998 commented 8 years ago

I have already started so it is a bit late for me to change on which library to use.

luajit has the same API from Lua 5.1. So if you're code is working with Lua 5.1 it will also works with luajit.

Jacob-Mango commented 8 years ago

If it is similar header code then I will look into changing. I noticed that it is faster in some parts. I am using Lua 5.3 though and compiled it in Visual Studio. Will look into changing it tomorrow. Shouldn't be that hard if it is similar.

Jacob-Mango commented 8 years ago

Did some quick research. Using LUA 5.1 would be better then using 5.3 which is why LuaJit doesn't support 5.3.

e: alright. I have successfully swapped over lua to luajit. More speed :)

I will continue tomorrow.

KevinW1998 commented 8 years ago

Good to hear! I am looking forward to this!

Jacob-Mango commented 8 years ago

Ok. So far in Sparky, the only thing you can do in Lua right now is, play sounds. But, I atleast got classes set up. Rest should be easy.

KevinW1998 commented 8 years ago

I wouldn't recommend writing the classes manually. If cligen works good, then I might add a wrapper generator for lua too.

Jacob-Mango commented 8 years ago

No, I am not going to write the classes manually. I will write a tool or something to do that. But I had to write atleast one manually so I could see how I was going to intergrate Lua.

Jacob-Mango commented 8 years ago

Change of plans. I for now I will write all the required classes manually. You could add the LUA generator on top later on when cligen is done, if you want, or I could.