Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Luna: A game engine made for learning with Lua  (Read 2599 times)

0 Members and 1 Guest are viewing this topic.

ACharLuk

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Luna: A game engine made for learning with Lua
« on: August 15, 2017, 03:53:04 pm »
I'm a big fan of Lua and I'm learning SFML, so I decided to start this project about 3 months ago.
It's aim is not be a powerful engine, but to help people learn to program and make games using Lua, a language I find easy to learn for non-programmers, kids, etc.

Here's the link to the project: https://github.com/XyronLabs/Luna
You can see some examples in the wiki: https://github.com/XyronLabs/Luna/wiki

Here's a gif of a simple Breakout game I made with it: https://twitter.com/XyronLabs/status/895604095871967233

Any feedback is apreciated! :)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 9261
    • View Profile
    • development blog
    • Email
Re: Luna: A game engine made for learning with Lua
« Reply #1 on: August 15, 2017, 04:11:18 pm »
As mentioned on Reddit (DarkCisum), really liking it! :)
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

FRex

  • Hero Member
  • *****
  • Posts: 1842
    • View Profile
    • My GitHub Page
    • Email
Re: Luna: A game engine made for learning with Lua
« Reply #2 on: August 15, 2017, 10:11:01 pm »
It's interesting but a bit small still.
Is it inspired by processing?
Do you plan to compete with Love2D or is it just for learning, sketches, etc.?
ZipSavings, script to count rar/7z/zip savings: https://goo.gl/vvBj5M
LuaConsole: https://goo.gl/X4kRUk
FoxRaycaster: https://goo.gl/27nVS8
Small Games - Heart, Routing and Snek: https://goo.gl/15ZGWE https://goo.gl/k5gwWD https://goo.gl/4nKPnT
Botes - a notes app in Pascal: https://goo.gl/bzTqsi

ACharLuk

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Luna: A game engine made for learning with Lua
« Reply #3 on: August 16, 2017, 12:08:13 am »
It's interesting but a bit small still.
Is it inspired by processing?
Do you plan to compete with Love2D or is it just for learning, sketches, etc.?

It is quite small, I'm currently working on it and adding more and more features :)
Yes, it is inspired by Processing and other sketching tools.
I'm making this tool just to learn SFML, so it won't probably compete with Love2D anytime soon, it is not my aim either. I want a tool to teach and help other people learn programming  ;D
However, I plan on adding more advanced features in the future, so stay tuned  ;)

FRex

  • Hero Member
  • *****
  • Posts: 1842
    • View Profile
    • My GitHub Page
    • Email
Re: Luna: A game engine made for learning with Lua
« Reply #4 on: August 16, 2017, 12:09:26 am »
I'm much more low level user and I already know Lua fairly well but I always like seeing it used because it's so niche.
ZipSavings, script to count rar/7z/zip savings: https://goo.gl/vvBj5M
LuaConsole: https://goo.gl/X4kRUk
FoxRaycaster: https://goo.gl/27nVS8
Small Games - Heart, Routing and Snek: https://goo.gl/15ZGWE https://goo.gl/k5gwWD https://goo.gl/4nKPnT
Botes - a notes app in Pascal: https://goo.gl/bzTqsi

ToyAuthor

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • Email
Re: Luna: A game engine made for learning with Lua
« Reply #5 on: August 16, 2017, 05:03:25 am »
I am happy to meet a new lua user here.
Lua is a very friendly language for non-programmers.

But your lua script looks too simple.
Why those interfaces of Luna are global function?
It may make user confused.

Try to build a C extension module for Lua would be better.
Just like this style:
https://github.com/ToyAuthor/ToyBox/blob/master/resource/lua/examples/Window/main.lua

Or you can create your own global table as name space.(Just like Love2D)

ACharLuk

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Luna: A game engine made for learning with Lua
« Reply #6 on: August 16, 2017, 08:34:45 am »
I am happy to meet a new lua user here.
Lua is a very friendly language for non-programmers.

But your lua script looks too simple.
Why those interfaces of Luna are global function?
It may make user confused.

Try to build a C extension module for Lua would be better.
Just like this style:
https://github.com/ToyAuthor/ToyBox/blob/master/resource/lua/examples/Window/main.lua

Or you can create your own global table as name space.(Just like Love2D)

I made the functions global to keep the code simple.
I'm learning the C api (how to handle tables and such) so I may be missing some of the features it has. I'll take a look into your code and see how it works, thank you!  ;D

Elias Daler

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
    • Blog
    • Email
Re: Luna: A game engine made for learning with Lua
« Reply #7 on: August 16, 2017, 09:09:08 am »
I recommend you to use sol2 for Lua/C++ stuff instead of dealing with Lua C API. It will make binding a lot easier and you'll be able to do more faster.
Tomb Painter, Re:creation dev | eliasdaler.github.io | @EliasDaler | Tomb Painter dev log

ACharLuk

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Luna: A game engine made for learning with Lua
« Reply #8 on: August 16, 2017, 10:22:01 am »
I recommend you to use sol2 for Lua/C++ stuff instead of dealing with Lua C API. It will make binding a lot easier and you'll be able to do more faster.

Thank you for the suggestion! I'll take a look into that, it seems really interesting.  :)

FRex

  • Hero Member
  • *****
  • Posts: 1842
    • View Profile
    • My GitHub Page
    • Email
Re: Luna: A game engine made for learning with Lua
« Reply #9 on: August 17, 2017, 12:04:47 am »
I don't personally like such libraries due to their complexity/size and the fact they encourage binding lots of stuff to Lua. I just use C API as is. I think that outside of big libraries like wxLua, etc. Lua should be used either with a small C/C++ kernel or sprinkled sparingly around a large mainly C/C++ program to provide some data loading or callbacks. As for your program, maybe you should bind just vertices to Lua and then use them to reimplement shapes like cricles and rects in Lua to show it off and make the C++ code simpler.

Your opinions may vary since I'm super familiar with Lua by now, especially 5.1 (I wrote a CS engineering paper about its implementation for my exam).
ZipSavings, script to count rar/7z/zip savings: https://goo.gl/vvBj5M
LuaConsole: https://goo.gl/X4kRUk
FoxRaycaster: https://goo.gl/27nVS8
Small Games - Heart, Routing and Snek: https://goo.gl/15ZGWE https://goo.gl/k5gwWD https://goo.gl/4nKPnT
Botes - a notes app in Pascal: https://goo.gl/bzTqsi

Ricky

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
    • Tejada
    • Email
Re: Luna: A game engine made for learning with Lua
« Reply #10 on: August 17, 2017, 04:57:54 am »
Haha cool! I've been working on my own similar project since '13 but have bee very inconsistent. Hopefully you finish it!
Wilt thou yet say before him that slayeth thee, I am God? but thou shalt be a man, and no God, in the hand of him that slayeth thee.

ACharLuk

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Luna: A game engine made for learning with Lua
« Reply #11 on: August 17, 2017, 12:05:38 pm »
I don't personally like such libraries due to their complexity/size and the fact they encourage binding lots of stuff to Lua. I just use C API as is. I think that outside of big libraries like wxLua, etc. Lua should be used either with a small C/C++ kernel or sprinkled sparingly around a large mainly C/C++ program to provide some data loading or callbacks. As for your program, maybe you should bind just vertices to Lua and then use them to reimplement shapes like cricles and rects in Lua to show it off and make the C++ code simpler.

Your opinions may vary since I'm super familiar with Lua by now, especially 5.1 (I wrote a CS engineering paper about its implementation for my exam).

I am still learning how the C API works, so I'm not using any more libraries for now, maybe in the future if they make developing easier  :)

ACharLuk

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Luna: A game engine made for learning with Lua
« Reply #12 on: August 17, 2017, 12:09:20 pm »
Haha cool! I've been working on my own similar project since '13 but have bee very inconsistent. Hopefully you finish it!

Thanks! I'm working on it pretty much full time now on summer, before the classes start again ;)
It is far from finished, but I hope I'll have a stable and useful release soon so anyone can start using it
  ;D

FRex

  • Hero Member
  • *****
  • Posts: 1842
    • View Profile
    • My GitHub Page
    • Email
Re: Luna: A game engine made for learning with Lua
« Reply #13 on: August 18, 2017, 03:24:27 pm »
Maybe you could simplify your C++ code and get more Lua code if you just had more Lua code implementing various shapes and a C function to set textures, outut vertexes, etc. and not bind every SFML shape to Lua itself. I might show an example of what I mean if you want and if I have the time.
ZipSavings, script to count rar/7z/zip savings: https://goo.gl/vvBj5M
LuaConsole: https://goo.gl/X4kRUk
FoxRaycaster: https://goo.gl/27nVS8
Small Games - Heart, Routing and Snek: https://goo.gl/15ZGWE https://goo.gl/k5gwWD https://goo.gl/4nKPnT
Botes - a notes app in Pascal: https://goo.gl/bzTqsi

ACharLuk

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Luna: A game engine made for learning with Lua
« Reply #14 on: August 18, 2017, 07:26:55 pm »
Maybe you could simplify your C++ code and get more Lua code if you just had more Lua code implementing various shapes and a C function to set textures, outut vertexes, etc. and not bind every SFML shape to Lua itself. I might show an example of what I mean if you want and if I have the time.

I did it like this when I started the project, but it will change when I add custom shapes to it ^_^

 

anything