I coded a shoot 'em up alone at 18 after learning Lua in a single week

1 points by DamixLord ↗ HN
Hey everyone. I'm new to the "real" world of programming because I used to just code alone in my room, strictly on my own PC. My name is NZUKOU DAMIEN (my username is DamixLord), and I'm an 18-year-old developer based in Cameroon.

I've been a fan of programming since I was 12. Since then, I've messed around with several languages: Python, JS, Go, and now Lua. I don't even know why, but I just love Lua for no specific reason, so I wanted to learn it. In one week, I learned variables, functions, tables, and OOP (especially metatables, which I absolutely love). I wanted to build a project to check if my fundamentals were solid enough to reach an intermediate level, and that's how I made SPACE CONQUEROR.

I didn't go with a traditional OOP approach; instead, I mixed it up with metatables because I enjoy it, and honestly, it was a blast. I'm looking forward to your feedback, advice, etc.

Just a quick heads-up (because I have to, since some people on Reddit jumped all over me for this): I did feed my code to an AI to make it more readable (because I do weird things like declaring variables that are as long as a highway), and I copied snippets here and there because my math and logic skills can be pretty bad. I'm not writing my first article to brag or pretend I'm a genius (honestly, I have major imposter syndrome). I'm doing this to get feedback, chat, and learn from my mistakes.

Thanks again! (And one last thing: while making this, I realized that my first real project is very similar to the one Elon Musk coded when he was 12, Blastar. Coincidence? I'll let you be the judge).

The Project : https://github.com/nzukoudamien/Space-Conqueror

9 comments

[ 9.4 ms ] story [ 782 ms ] thread
> 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.

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.

Nice

A few tips: make it a "show hn", add the url to the submission, add the png to your readme

Two small issues:

- 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.

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.