First project with Lua and LOVE, would love some feedback if possible

Show off your games, demos and other (playable) creations.
Post Reply
SmugGoat
Prole
Posts: 1
Joined: Sat May 12, 2018 3:51 am

First project with Lua and LOVE, would love some feedback if possible

Post by SmugGoat »

I wanted to get into some game development and I thought the best way would be to work from the ground up. Here is my mandatory Asteroids clone. Take a look at the code and give me some constructive criticism.

My background is in C++ and ARM Assembly so that's where I'm coming from.
asteroids.love
unzip to get at the source
(3.49 KiB) Downloaded 246 times
KayleMaster
Party member
Posts: 234
Joined: Mon Aug 29, 2016 8:51 am

Re: First project with Lua and LOVE, would love some feedback if possible

Post by KayleMaster »

Pretty good !

Definitely better than my first game. Anyways, you're not using any locals which means a lot of stuff is in the global namespace.
I've attached a reworked version of your game, literally runs the same, the only difference being that they're no globals anymore, except width and height in love.load.
Attachments
asteroid.zip
(3.91 KiB) Downloaded 145 times
User avatar
NotARaptor
Citizen
Posts: 59
Joined: Thu Feb 22, 2018 3:15 pm

Re: First project with Lua and LOVE, would love some feedback if possible

Post by NotARaptor »

It's weird - the "global by default, implicit declaration" approach seems utterly wrong to me, coming from a c/c++ background too. I distinctly remember hating AS2 for this very reason.

I get where it comes from though, as it's mostly used as a scripting language.

Wish there was a "use strict" equivalent!
KayleMaster
Party member
Posts: 234
Joined: Mon Aug 29, 2016 8:51 am

Re: First project with Lua and LOVE, would love some feedback if possible

Post by KayleMaster »

There are some strict modules that warn when you write to the global namespace or something like that, google strict.lua
User avatar
NotARaptor
Citizen
Posts: 59
Joined: Thu Feb 22, 2018 3:15 pm

Re: First project with Lua and LOVE, would love some feedback if possible

Post by NotARaptor »

Oh cool! I will look into that. I guess it makes sense; the global scope is a table, and if you can change its metatable you could detect writes. Thanks
Darlex
Party member
Posts: 128
Joined: Sun Sep 24, 2017 10:02 am
Location: Chile
Contact:

Re: First project with Lua and LOVE, would love some feedback if possible

Post by Darlex »

Wow! This is your first game?! I just programmed a box with buggy collisions
Hi! I wish you have an amazing day!
Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests