Game Code Design Patterns

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Game Code Design Patterns

Post by Karai17 »

https://github.com/excessive/love-game-patterns

Here is an example of various ways to write game code, written by @shakesoda. This includes a bare procedural approach, an OOP approach, and an ECS approach. Bonus inclusion is a hand-minified version of the procedural code cut down to only 1318 bytes! All of the examples are functionally identical and provide a look into different ways of structuring game code to provide the same results.

If you have some other way of reimplementing this exact game, feel free to send a PR! Any questions about the various approaches are welcome, we're all here to learn! :D
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
CameronGoble
Prole
Posts: 3
Joined: Fri Sep 15, 2017 2:14 am

Re: Game Code Design Patterns

Post by CameronGoble »

Wow! Really illustrative. I love how you so clearly show the same result from these three different approaches.

I'm a hobbyist programmer from the 1990s: the heady days of OOP. So that's my go-to. Lately, I'd been curious about ECS. Your demos answer practically every question I could think of as to what the different approaches entail.

Much appreciated!
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Game Code Design Patterns

Post by Karai17 »

Awesome! I'm glad you found this useful. If you have any unanswered questions, feel free to ask!
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 55 guests