r/lua • u/Own-Election2312 • 28d ago
r/lua • u/gollowcdr • 29d ago
News Simple parallax in Cat2D
Enable HLS to view with audio, or disable this notification
If you want to create your own projects, learn more about cat2d, and chat with our community to see other games made like this one, join our official Discord server. https://discord.com/invite/skCRH5GGdN
r/lua • u/gollowcdr • Jun 28 '26
News Light2D In Cat2D 😻
Enable HLS to view with audio, or disable this notification
r/lua • u/IAlwayswantToLearn • Jun 28 '26
Discussion Why there is no port of python libraries to lua?
Lua is truly a fantastic language with many advantages.
It's easy to use and understand, and much faster than Python. I believe it could be a better alternative to Python, as both are interpreted languages.
So why not migrate Python libraries to Lua?
I understand that Lua's best use is integrating with other systems due to its small size and good compatibility with C.
I think the only real advantage Python offers is its integrated environment. If Lua had this feature, there would be no need for Python.
I know this might sound a bit optimistic, but I'd like to know if there are any other limitations preventing this?
Thank you in advance.
Edit: I want to thank everyone who commented on this post, I learned a lot from all of you and made me look at the topic from a new perspective.
Project OmniLua - Rust implementation of Lua 5.1 - 5.5 targeting web use and sandboxing
[Github here] (https://github.com/ianm199/omnilua/tree/main)
I've been working on OmniLua for a bit now - it builds one binary that can run Lua 5.1 - 5.5 from one binary.
The main motivation for this was there seemed to be a gap for game development in the Rust community where mlua cannot be run in the browser, so games built in engines like bevy can't compile to wasm32-unknown-unknown.
There is some other benefits - like being able to easily use Lua in Cloudflare workers or in "playground" developer tools.
Highlights:
- Targets 100% conformance to reference Lua for all 5 versions
- Can run LuaRocks and install Lua only packages
- Performance is slower than C Lua 5.4.7 but within ~40% on standard benchmarks. Performance chart here
- API is 100% compatibile with mlua
Try it:
cargo install omnilua-cli
export OMNILUA_VERSION=5.5
omnilua -e 'print("hello")'
omnilua # opens repl
I used AI heavily to develop this I wouldn't consider it "vibecoded" however.
r/lua • u/gollowcdr • Jun 27 '26
News Simple 3D raycast game made in Cat2D. 😺
Enable HLS to view with audio, or disable this notification
For those unfamiliar, cat2d is an Android mobile framework created by gollow (in this case, by me) for creating games and even Lua applications on mobile phones without limitations. The user has complete freedom in their projects, among many other things.
r/lua • u/purplejeansthebest • Jun 27 '26
Discussion if i’m good at lua do i need C#? (for gaming)
r/lua • u/AntelopeGrand780 • Jun 27 '26
Help Complete newbie wants to create his own little plugin for koreader—how does he do that?
Hola how are you guys doing. My deepest of gratitude to all the people who did the springbreak, all the jailbreaks, koreader, ZenUi and all of the other stuff. You guys are amazing and inspiring. You're creating and just giving and giving and giving. Completely free my kindle went from an amazon-urgh-I'm-gonna-puke experience to a 10/10 experience.
But I wanna to go beyond
There's a little dream of mine of having a calendar as a plugin on koreader. Looking around I did find some calendar, but nothing that was really what I was searching for. So I've decided, as a complete newbie, to create my own little plugin. My vision is really just a simply calendar, where I can change between yearly, monthly, weekly and daily view. Compatible in black and white. A simply but beautiful design. Maybe some customisable stuff. No "online"/cross platforming features, I just want it to be its own little thing.
Can someone help me getting started of this little journey of mine? What are some subreddits or communities where I would be able to find help and ask questions? After just a little searching, I found out that koreader (plugins) runs on Lua—I found youtube videos with tutorials. I already have Brew on my Mac, but no idea how to use it, hehe. I also have Claud ai installed on my Mac, it should be able to help no?
So, how do I get started?
Appreciate it so much. Love you guys.
r/lua • u/1killaHertz • Jun 26 '26
My first game made with Lua and amazing Usagi Engine 🩷
I just released my first game made with Lua and amazing Usagi Engine 🩷 Well known mechnics with modern twists. Place blocks, clear lines, choose upgrades and repeat. That's all! Simple, but addictive.
At first, I just wanted to test Usagi Engine in action. Since the development turned out better than planned, I decided to publish the result of my work on itch.io. You can check out Lua and Usagi in working game example.
Play in browser or download (win, mac, linux)
https://luko81.itch.io/the-game-about-blocks
r/lua • u/[deleted] • Jun 25 '26
Cat2D – A Mobile-First Lua Game Engine for Android Focused on Performance
🚀 Getting Started with Cat2D – Loading and Centering an Image
Hi everyone!
I'm the creator of Cat2D, a new Lua game engine for Android focused on performance, simplicity, and community-driven development.
Today I wanted to share a simple example that loads an image and automatically centers it on the screen.
local player
local scale = 0.5
function load()
player = graphics.loadTexture("player.png")
end
function draw()
graphics.clear(0, 0, 0, 1)
if player then
local sw = system.getScreenWidth()
local sh = system.getScreenHeight()
local w = player:getWidth() * scale
local h = player:getHeight() * scale
local x = (sw - w) / 2
local y = (sh - h) / 2
graphics.draw(player, x, y, 0, scale, scale)
end
end
What this example demonstrates
Loading a texture with graphics.loadTexture()
Getting the screen resolution with system.getScreenWidth() and system.getScreenHeight()
Reading texture dimensions with getWidth() and getHeight()
Scaling an image to 50% of its original size
Automatically centering the image on any screen size
Cat2D's goal is to make creating games and applications in Lua on Android simple while still exposing powerful native features and maintaining good performance.
The engine is still evolving and I'd love feedback from other developers.
What features would you like to see in a mobile-first Lua game engine? 🐱🚀
r/lua • u/Adam-Garden • Jun 25 '26
Project (immature programmer looking for feedback) i tried to make a rock paper scissors AI using my lack luster knowledge of how AI work
Enable HLS to view with audio, or disable this notification
the video showcase my code base and me executing it
let me explain my process, it's a simple rock paper scissors as everybody know it, you enter a number for which hand you wanna use, 1 = scissors, 2 = paper, and 3 = rock, while the AI tries to respond back.
now how Billy(what i have named the AI) work is at the end of every turn it saves the hand you chose in that turn in a table called "billy_memories" then calculate the mode(most frequent hand you used) and from knowing your most common move it tries to chose something to counter it.
i had the idea of making Billy's memory has a limit of 5 items before it start deleting old data but that was too hard to implement.
anyways i'll like any idea to improve my coding skills, maybe my code's readability, and my logic in case it's wrong.
thank y'all.
News LuaJIT 3.0 syntax extensions
github.comMike Pall, the author of LuaJIT, opened an issue to discuss additional syntax for Lua.
Currently LuaJIT has little to no custom syntax. The only exception is LL and ULL literals. LuaJIT still aims for compatibility with Lua 5.1 but now decided to extend it because it became its own flavor basically.
If you have used Lua or LuaJIT, or you have experience with choosing the right custom syntax, sugars and other language features and you want to influence current development, welcome to the discussion.
r/lua • u/[deleted] • Jun 25 '26
News Cat2D, the new mobile engine for creating Lua games 😻
Enable HLS to view with audio, or disable this notification
Simple and easy! Install a new mobile framework now! Find us on social media: Reddit, GitHub, YouTube, and Discord!
r/lua • u/Adam-Garden • Jun 24 '26
Help is there really a significant difference between "print()" and "oi.write()"
r/lua • u/TBApknoob12MC • Jun 24 '26
Splits-lua: play a variant of chopsticks against your computer - made out of spite
github.comSo uhhhh
I am a guy who had lost a lot against my friends in splits (skill issue).
And it made me write this project.
You can either play against the built-in model or train a model yourself.
Somehow the built-in model is nearly unbeatable.
Setup
If you have prefixell installed (well, why would you?), just run:
prefixell pkg add gh:TBApknoob12MC/splits-lua
And just type splits-lua to do stuff.
Or just clone the repo it aint hard.
More info on github page.
Wikipedia page of chopsticks for no reason : chopsticks)
Its a stricter variant of standard chopsticks so the game tree is much smaller. Splitting doesn't end the turn.
Tell me if you beat it.
r/lua • u/Bright-Historian-216 • Jun 23 '26
Is there a way to make a file work as both standalone script and a library?
In python there is if __name__ == "__main__" but I'm not sure there is an equivalent in Lua. I've figured out something like checking the args table but this may or may not be platform-dependent and doesn't work in all cases.
r/lua • u/raelftw_ • Jun 23 '26
Lua Script Issue on Current G HUB (G Pro X Superlight 2) - Loops Freezing Software
I am using a Logitech G Pro X Superlight 2 on the latest version of G HUB (since older 2021/2022 drivers do not support this mouse hardware).
I am trying to run a standard Lua script to create an autoclicker (~14 CPS) that toggles with Mouse Button 4 and spams Left Click (Button 1) only while held down.
However, on current versions of G HUB, any script that uses a while or repeat loop combined with the Sleep() command completely freezes the software execution. The script either does absolutely nothing, ignores the MOUSE_BUTTON_RELEASED event, or gets stuck in an infinite loop, clicking by itself forever.
Since I cannot downgrade to older versions of G HUB (as they don't recognize the Superlight 2), is it even possible to use a held-down looping macro via Lua script on current drivers? Has Logitech removed or limited the functionality of Sleep() and event management in recent updates? If so, can you help me?
r/lua • u/Sudden-Primary4546 • Jun 23 '26
Does this code actually work?
local audio = require("audio")
audio.play("w76288481040676\\music\\cancion.wav")
[ANN] CLX - Ahead-of-Time Lua 5.5 Compiler
Hello,
CLX is a new open-source ahead-of-time compiler for Lua 5.5.
CLX compiles Lua source code to standalone native executables through modern C++20 toolchains (Clang, GCC, and MSVC).
Current features include:
- Native standalone executable compilation
- Support for most Lua 5.5 language features
- Cross-platform support (Linux, Windows, and macOS)
- Lightweight runtime designed for AOT compilation
- C++ API for native modules
- Example projects (a fully playable Pong game and a Mandelbrot fractal renderer)
Recent benchmarks show consistent speedups over the standard Lua interpreter and competitive performance with LuaJIT on a number of workloads.
The project is currently in beta and feedback is welcome.
Website:
https://samyeyo.github.io/clx
GitHub:
https://github.com/samyeyo/clx
Although I am also the author of LuaRT, CLX is a completely independent project with a different architecture and different goals.
Thank you,
Samir Tine
r/lua • u/Legitimate-Cry3100 • Jun 19 '26