SFML community forums

General => SFML projects => Topic started by: zper on November 02, 2020, 06:36:07 am

Title: Cellular automata with ImGui + SFML + Bazel
Post by: zper on November 02, 2020, 06:36:07 am
Hi everyone  ;D

Currently, I am experimenting (and learning on the way) to work with SFML + Imgui with Bazel under the hood. Therefore, a new project arose - Game of Life!

It's a fun and interesting concept for simulating simple yet smart agent systems with cellular automatons. If you're interested in the project (or, at least, dissolve the "wtf" mist by reading the previous), feel free to enter into the realm of the "GameOfLife" Github repository -> https://github.com/zpervan/GameOfLife (https://github.com/zpervan/GameOfLife)

Also, I would appreciate it if someone with more experience has some tips and tricks regarding SFML or general program design of the application.  8)

Thanks and stay safe!
Title: Re: Cellular automata with ImGui + SFML + Bazel
Post by: Nexus on November 02, 2020, 09:21:21 am
Without looking at all the files, the SFML parts I've seen look good, maybe you should call window.clear(); in runner.cpp unconditionally (not sure what IMGUI does).

The state checking looks messy, why not an enum with running/paused/stopped?
Also, try to avoid global/static variables, they're often not needed with good design.
Title: Re: Cellular automata with ImGui + SFML + Bazel
Post by: zper on November 02, 2020, 10:29:52 am
Without looking at all the files, the SFML parts I've seen look good, maybe you should call window.clear(); in runner.cpp unconditionally (not sure what IMGUI does).

The state checking looks messy, why not an enum with running/paused/stopped?
Also, try to avoid global/static variables, they're often not needed with good design.

Yeah, I had something in mind to do with enums, but this was a quick hack to have some simulation states. As for the global variables - I agree with you there also.

Thanks for the mini-review  8)

Feel free to add more suggestions, they are more than welcome!  ;D