alecthomas / entityx

EntityX - A fast, type-safe C++ Entity-Component system
MIT License
2.21k stars 295 forks source link

Add a CMake target for the example, fix compile errors and a weird bug #252

Closed theo543 closed 1 year ago

theo543 commented 1 year ago

Hi!

I added a target to fetch SFML, copy the font file and compile the example so the example can be launched directly from the IDE. To make it compile I had to set the language to C++11, replace a deprecated SFML method setColor with setFillColor and add a fallback define for M_PI.

When I opened the example all the circles were spawning in the same place and constantly colliding. I think the cause is RAND_MAX == 32767. I replaced it with a mt19937 and added a debug option to use std::rand. Maybe it's a Windows thing?

https://user-images.githubusercontent.com/81699222/233811408-2387bc8a-b3a3-4c82-80ab-c0eff7b52f08.mp4

alecthomas commented 1 year ago

Awesome thanks!

theo543 commented 1 year ago

There's a failing test, is that normal?