3 ms·
Cool project with awesome visuals! It's always interesting to see games published made with LÖVE in lua. I'm writing an "Advance Wars 2" clone at the moment in
by cl3misch 6y ago
Cool project with awesome visuals!
It's always interesting to see games published made with LÖVE in lua. I'm writing an "Advance Wars 2" clone at the moment in LÖVE and hope to get some inspiration from your code.
You seem to use a lot of global variables. Is that on purpose? I try to do as much as possible with local variables (although especially in game logic global entities are sometimes just the easiest way). I'm very wary of 1. global lookup overhead and 2. confusing errors when accidentally overwriting an existing global variable.
As I have never noticed both of these I'm not sure whether my angst is justified ;-)
- nonbirithm 6y agoThe author explains their reasoning about globals here. https://github.com/a327ex/blog/issues/24 https://github.com/a327ex/blog/issues/24 It mainly boils down to the fact that an indie game written by one person and never maintained after release doesn't need to be written for maintainability. Supposedly there are productivity gains the author receives from doing this. Personally, I disagree from past experiences dealing with hundreds of globals in legacy code, but to each their own.
- cl3misch 6y agoThank you for the link, that's exactly what I was looking for. I see the point that a single developer does not have to focus on maintainability so much. And if it works for him -- as it obviously does -- more power to him. But for me, I do not think I am mentally capable to reason about my program if it has to many globals. If I can have as much as possible local, my mental model also can be local. I am very new to gamedev, so this way of thinking may not be appropriate in the long run.