marcobambini / gravity

Gravity Programming Language
https://gravity-lang.org
MIT License
4.29k stars 227 forks source link

Sharing code examples on how to implement design patterns using Gravity #364

Open untoldengine opened 3 years ago

untoldengine commented 3 years ago

Hi @marcobambini

I wrote several code examples that show how to implement several design patterns using Gravity, such as:

I figured that these examples may help someone in the Gravity community, especially game devs/game engine devs. Unfortunately, I don't know anything about compilers and can't really contribute back by fixing bugs. However, I figured that writing code examples may be helpful to the community.

I'm attaching all the Design Patterns I wrote using Gravity. Please, do go over them since I may have made some mistakes. I'm not a Gravity expert yet, so I'm sure I did some mistakes. However, I did test the examples and they all worked. (I basically ported these design patterns from C++ to Gravity)

P.S. If you decide to show them on Gravity Page or any place where you feel they should be shown, I recommend showing the design patterns in the order shown below. They are ordered from easiest to implement to more complex:

DesignPatternsExamples.zip

marcobambini commented 3 years ago

Hi @untoldengine,

Thank you for your contribution.

I have that the best way to expose your excellent work is by extension ending the official documentation. I'll try to find out the time to update it.

Thank you!

RobLoach commented 3 years ago

I would recommend creating a repository with these in there :+1: . They look great!