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 » Sat May 12, 2018 3:56 am

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 122 times

KayleMaster
Party member
Posts: 190
Joined: Mon Aug 29, 2016 8:51 am

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

Post by KayleMaster » Sat May 12, 2018 5:01 pm

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 45 times

NotARaptor
Prole
Posts: 43
Joined: Thu Feb 22, 2018 3:15 pm

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

Post by NotARaptor » Sat May 12, 2018 5:47 pm

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: 190
Joined: Mon Aug 29, 2016 8:51 am

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

Post by KayleMaster » Sat May 12, 2018 5:49 pm

There are some strict modules that warn when you write to the global namespace or something like that, google strict.lua

NotARaptor
Prole
Posts: 43
Joined: Thu Feb 22, 2018 3:15 pm

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

Post by NotARaptor » Sat May 12, 2018 5:56 pm

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

User avatar
Darlex
Prole
Posts: 40
Joined: Sun Sep 24, 2017 10:02 am
Contact:

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

Post by Darlex » Thu May 17, 2018 2:00 am

Wow! This is your first game?! I just programmed a box with buggy collisions
ERROR

Post Reply

Who is online

Users browsing this forum: bludburn and 3 guests