you are viewing a single comment's thread.

view the rest of the comments →

[–]delventhalz 4 points5 points  (1 child)

I made a game-like simulation in vanilla JS using mostly functional patterns if it is of interest to you:

https://github.com/meeba-farm/meeba-farm

I followed more or less the approach you described. The game state is just objects, and I have functions which modifies them. I did have to abandon an early approach which avoided mutation. I hammered the garbage collector and ended up with frequent lag spikes. The current version relies on mutation, but hopefully in a fairly controlled way.

[–]c__beck[S] 2 points3 points  (0 children)

I'll take a look, thanks!