Page 1 of 1

Recommendations for design pattern material

Posted: Mon Jun 04, 2018 8:24 pm
by iamseth
I'm new to game development and LÖVE. So far I've only created Pong and Flappy Bird knockoffs.

I'm still working on the Flappy Bird clone and I've spent most of time trying to decide how to separate concerns and avoid spaghetti.

Does anyone have recommendations on books/blogs/videos/etc for best practices and design patterns? A lot of the basic tutorials and literature tend to stick everything or nearly everything in a single main.lua file.

I'm currently re-writing the menus to make them look pretty with graphics, better font, and clickable buttons. I have a proof of concept working but I'm passing a lot of global state around and sending callback functions as arguments. It works but debugging this on a large application would be a nightmare. I wonder if there are tried and true patterns I ought to be using.

I realize this is overkill on a Flappy Bird clone but my goal is to engineer the hell out of this thing so I can take concepts onto future games.

Re: Recommendations for design pattern material

Posted: Wed Jun 06, 2018 7:39 pm
by raidho36
http://gameprogrammingpatterns.com/contents.html

Note that specifically using patterns is not a good thing of and in itself, if you deliberately use a programming pattern it's because it's a good drop-in solution to your problem, not because you're "supposed" to use them. With enough effort you should be able to come up with something better. Patterns do however emerge naturally in code from time to time, and because "in the wild" it happens with often enough, it's considered a pattern.