Being upfront about AI cleanup and copied math snippets is useful context; for better feedback, ask reviewers to focus on your Lua metatable design and game loop structure.
al_borland 2 days ago [-]
> because I do weird things like declaring variables that are as long as a highway
Don't let people talk you out of descriptive variable names. It makes code much more readable, easier to understand, and will help when you come back to it later. We're not battling to save every bit anymore and editors have auto-complete.
Congrats on the project, I can't say much more, because GitHub locked me out for clicking between files too fast... I guess that's a thing now.
bruce511 19 hours ago [-]
Naming is hard. The name needs to be long enough to make the variable meaningful, but not longer.
I have encountered a programmer (in the corporate space) who bought into the "longer name" concept, to the point where he started complaining that the compiler had a 128 char limit for variable names.
For example instead of a variable called say "tax" he'd use something like "CustomerSalesTax". That was mostly bearable, but the context (and the fact it was the only tax field) made the extra description redundant.
That habit expanded though. Until he had names 50+ characters long. By then the code is illegible. Especially when the difference in variable names is minor. As in
TotalDepreciationAnnualisedInterimTaxValue
versus
TotalDepreciationAnnualisedInterimBookValue
So yeah, descriptive names good. Verbose names bad.
DamixLord 2 days ago [-]
Thanks
gabrielsroka 1 days ago [-]
Nice
A few tips: make it a "show hn", add the url to the submission, add the png to your readme
369548684892826 2 days ago [-]
Have you seen this 2D game engine called Love? It's for Lua, and I've heard it's very good
- you have a separator that isn't commented out on line three. Just don't add these at all, it doesn't help anything.
- your requires (eg "Projets.Space Conqueror.outils") should point to folders (Projets/Space Conquerer/outils.lua) but don't. Paths will be relative to wherever the Lua interpreter or executable is.
I made those two changes and it plays fine. You should really do a final check and make sure things run before committing.
Someone else suggested Love2D, which would be a great framework for Lua games, but you can also get LuaJIT and SDL (2 or 3, probably should use 3) to work without it, so you can use graphics, sound, etc. if you want. Using metatables is the right way to do it with Lua, not every language is a fit for every paradigm and I think it's better to work with a language than try to impose arbitrary patterns onto it.
Please don't "feed your code to an AI to make it more readable" in the future. You don't know if the AI will just introduce random bugs and it really doesn't matter. Learn by making your own code more readable, yourself, if that concerns you.
And don't worry about impostor syndrome. You actually finished a project, and you wrote it yourself. That puts you ahead of every vibe coder and most amateur game developers.
Rendered at 01:29:25 GMT+0000 (Coordinated Universal Time) with Vercel.
Don't let people talk you out of descriptive variable names. It makes code much more readable, easier to understand, and will help when you come back to it later. We're not battling to save every bit anymore and editors have auto-complete.
Congrats on the project, I can't say much more, because GitHub locked me out for clicking between files too fast... I guess that's a thing now.
I have encountered a programmer (in the corporate space) who bought into the "longer name" concept, to the point where he started complaining that the compiler had a 128 char limit for variable names.
For example instead of a variable called say "tax" he'd use something like "CustomerSalesTax". That was mostly bearable, but the context (and the fact it was the only tax field) made the extra description redundant.
That habit expanded though. Until he had names 50+ characters long. By then the code is illegible. Especially when the difference in variable names is minor. As in
TotalDepreciationAnnualisedInterimTaxValue versus TotalDepreciationAnnualisedInterimBookValue
So yeah, descriptive names good. Verbose names bad.
A few tips: make it a "show hn", add the url to the submission, add the png to your readme
https://love2d.org/
- you have a separator that isn't commented out on line three. Just don't add these at all, it doesn't help anything.
- your requires (eg "Projets.Space Conqueror.outils") should point to folders (Projets/Space Conquerer/outils.lua) but don't. Paths will be relative to wherever the Lua interpreter or executable is.
I made those two changes and it plays fine. You should really do a final check and make sure things run before committing.
Someone else suggested Love2D, which would be a great framework for Lua games, but you can also get LuaJIT and SDL (2 or 3, probably should use 3) to work without it, so you can use graphics, sound, etc. if you want. Using metatables is the right way to do it with Lua, not every language is a fit for every paradigm and I think it's better to work with a language than try to impose arbitrary patterns onto it.
Please don't "feed your code to an AI to make it more readable" in the future. You don't know if the AI will just introduce random bugs and it really doesn't matter. Learn by making your own code more readable, yourself, if that concerns you.
And don't worry about impostor syndrome. You actually finished a project, and you wrote it yourself. That puts you ahead of every vibe coder and most amateur game developers.