I was wondering if you could receive keyboard input just like Java, C+, etc. Or if there isn't is there external libraries?
Here's some info on the 2D, Maze-Game: You use the arrow keys to navigate through the maze. You use the UP and DOWN arrow keys to select the objects in the menu, for example:
--> New Game
Load Game
Options
And so on... I appreciate any help. Good day.
Lua on its own does not provide any libraries that aren't part of ANSI C, which is part of the extensive portability of the language.
As such, you miss out on things like keyboard input and graphics, but also operations that might be considered "simple," like listing the files in a directory.
Most likely, there's a library for what you need, and if there isn't, then keep in mind that Lua is one of the friendliest languages to write C-side libraries for.
LOVE is a good framework that couples quite a few extensions to Lua (including a rather abstracted interface to SDL) with a distribution method, more or less. If you're developing games with Lua, this is a good place to start.
EDIT: If you're on Windows with LuaJIT and you're okay with global key hooks, then I developed a library recently (May 2015) that solves that problem: https://github.com/LPGhatguy/global-keys
There are libraries like curses that may help; here is one tutorial one reading arrow keys with curses in Lua. There is also luaposix library, which includes curses.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With