Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
untoldengine opened this issue Jun 11, 2021 · 2 comments

Comments

@untoldengine
Copy link

Hi @marcobambini

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

  • Singleton Design Pattern
  • Strategy Design Pattern
  • Observer Design Pattern
  • State Design Pattern

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:

  • Singleton Design Pattern
  • Strategy Design Pattern
  • Observer Design Pattern
  • State Design Pattern

DesignPatternsExamples.zip

@marcobambini
Copy link
Owner

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
Copy link
Contributor

RobLoach commented Aug 7, 2021

I would recommend creating a repository with these in there 👍 . They look great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants