3 ms·
An arcade game should be organized using a game loop. Just make the game loop update the state of the entire game world each frame. This makes it relatively e
by stcredzero 17y ago
An arcade game should be organized using a game loop. Just make the game loop update the state of the entire game world each frame. This makes it relatively easy to write most of the game in a functional fashion. (You may have to have n "phases" in your game loop. Movement phase, collision resolution phase, etc.)
The OP is accustomed to thinking only in terms of mutating state. He can't get away from it. He wouldn't have had all of these problems if he'd just done ye olde AI class with turn-based board game project in Lisp. (With a prof who set a coding standard for pure functional Lisp.)
- didroe 17y agoHow do you solve the problems he mentioned in his followup post? He seems to be saying that there are a lot of people going on about how easy it is but no examples beyond simple games.
- copenja 17y agoThis same guy also wrote an article describing the exact same functional style game loop that you are describing: http://prog21.dadgum.com/23.html http://prog21.dadgum.com/23.html
- stcredzero 17y agoI stand corrected. He knows his stuff already. I'll reread his OP.