Hacker News new | past | comments | ask | show | jobs | submit login

It is hard. At least that's what I read in:

http://prog21.dadgum.com/23.html

EDIT: but not that hard, according to http://prog21.dadgum.com/37.html ;)




Wow, thanks for that link!

The author's explanation was incredibly clear and I feel like I got a handle on it!

Just 'lift' the relevant game state and pass mutatations along in a simular way to how you might pass exceptions along with a promise based system... Then it eventually feeds to a makeSounds() or an updateAnimations() or whatever! That way the code can keep all related functionality in one place, instead of spreading sound or animation related methods all over the code base encapsulated in each object with its own logic! Brilliant!


And pass the previous frame state to the same functional pipeline, recursively... Now I need to make an OOP vs FP game loop/physics engine in javascript and compare and contrast the approaches! (Feel free to leave the votes alone on this one, or down vote to oblivion, because I am just using HN for note keeping so I leave the thought in context...)




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: