3 ms·
In their defense, while the syntactic structure of the program may have had hash made out of it, the specific problem they described is indeed something that yo
by jerf 11y ago
In their defense, while the syntactic structure of the program may have had hash made out of it, the specific problem they described is indeed something that you could experience with a game engine with that design. I haven't quite seen that exact problem pop up for someone on /r/haskell, because that usually gets posts about how to design the loop in the first place, but the loop he describes has certainly been laid out there.
The only quibble is that usually when you do the "every entity declares its desired action and the core loop harmonizes it", you do it more symbolically. The player character does not issue a symbolic "I wish to move to position 38" command, it issues an "I wish to move 3 units to the right" symbolic result, and the enemy issues the "I wish to push the player two units to the left" symbolic result, generally with both results carrying their source info too, and then, when the loop goes to harmonize these things, it has more information with which to do it than opaque closures or something that the harmonization code can't understand.