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.
First project with Lua and LOVE, would love some feedback if possible
-
- 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
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.
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 166 times
- 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
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!
I get where it comes from though, as it's mostly used as a scripting language.
Wish there was a "use strict" equivalent!
-
- 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
There are some strict modules that warn when you write to the global namespace or something like that, google strict.lua
- 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
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
Re: First project with Lua and LOVE, would love some feedback if possible
Wow! This is your first game?! I just programmed a box with buggy collisions
Hi! I wish you have an amazing day!
Who is online
Users browsing this forum: Ahrefs [Bot] and 4 guests