Page 1 of 1

Architecture

Posted: Sun Aug 13, 2023 10:32 am
by mello
Hi.
I'm wanna try create my own game in lua, but doesn't have experience with non-typed languages.
What architecture of project do you recommend?
Where I can read about that?

Code: Select all

-- My suggestion
main.lua
src/enitity.lua
src/game_window.lua
src/level_loader.lua

Re: Architecture

Posted: Sun Aug 13, 2023 11:18 am
by dusoft
Have you searched the forum before posting? There have been multiple threads about this, e.g.
viewtopic.php?p=246142

How does non-typed and typed language affect your architecture btw, it is independent AFAIK?

Re: Architecture

Posted: Tue Aug 15, 2023 5:39 am
by Rigachupe
mello wrote: Sun Aug 13, 2023 10:32 am Hi.
I'm wanna try create my own game in lua, but doesn't have experience with non-typed languages.
What architecture of project do you recommend?
Where I can read about that?

Code: Select all

-- My suggestion
main.lua
src/enitity.lua
src/game_window.lua
src/level_loader.lua
I would add a data folder with images, sounds, musics, levels folders to complete the setting. It will work whatewer you name you folder so either you look at github of people who put a love2d game in it to copy the style or create your own.

Re: Architecture

Posted: Tue Aug 15, 2023 5:44 am
by GVovkiv
Rigachupe wrote: Tue Aug 15, 2023 5:39 am
I would add a data folder with images, sounds, musics, levels folders to complete the setting. It will work whatewer you name you folder so either you look at github of people who put a love2d game in it to copy the style or create your own.
So... how typed or non-typed language difference would affect this?

Re: Architecture

Posted: Tue Aug 15, 2023 12:04 pm
by duaner
mello wrote: Sun Aug 13, 2023 10:32 amI'm wanna try create my own game in lua, but doesn't have experience with non-typed languages.
Did you mean interpreted languages (vs. compiled)?

Re: Architecture

Posted: Tue Aug 15, 2023 7:04 pm
by Azzla
duaner wrote: Tue Aug 15, 2023 12:04 pm
mello wrote: Sun Aug 13, 2023 10:32 amI'm wanna try create my own game in lua, but doesn't have experience with non-typed languages.
Did you mean interpreted languages (vs. compiled)?
I think we're just confusing semantics, I've always referred to them as static/dynamically-typed or strong/weak languages.

Anyway, that has very little to do with how you structure your game. I'm a bit OCD but here's how I typically do it:
Image

Your mileage may vary. Everything is pretty self-explanatory, I'll just add that 'dicts' is for dictionaries of large amounts of information. Enemy types, different weapon types, level information, whatever you have "a lot of variations" of.

Re: Architecture

Posted: Tue Aug 15, 2023 7:12 pm
by Bobble68
mello wrote: Sun Aug 13, 2023 10:32 am Hi.
I'm wanna try create my own game in lua, but doesn't have experience with non-typed languages.
What architecture of project do you recommend?
Where I can read about that?

Code: Select all

-- My suggestion
main.lua
src/enitity.lua
src/game_window.lua
src/level_loader.lua
I just do whatever I want, which is probably not a good idea, since it makes my projects look like this:
Untitled.png
Untitled.png (19.3 KiB) Viewed 11840 times
Please ignore the fact I have polygon, levelpolygon, flowlevelpolygon and special polygon

Re: Architecture

Posted: Tue Aug 15, 2023 7:34 pm
by Azzla
Bobble68 wrote: Tue Aug 15, 2023 7:12 pm
I just do whatever I want, which is probably not a good idea, since it makes my projects look like this:

Untitled.png

Please ignore the fact I have polygon, levelpolygon, flowlevelpolygon and special polygon
LOL, this is totally reminding me of my first "big" project where my scope just creeped into insanity and nothing made any sense. Also, high-five of solidarity for Zerobrane. :nyu: