I am a student currently learning about Functional Reactive paradigm using F#. It's radically new viewpoint for me. Yesterday I learned about creating a simple ping-pong game using this paradigm. The idea I grasp so far is : we think values as functions of time. On its pure form, it's stateless. However, I need to remember the position of the ball (or state). So I always pass the current position of the ball as the parameter of the global function.
If we talk about slight more complex games, like Space Invaders, we have a lot of states (aliens' position, aliens' current HP, number of remaining bombs, etc)
Is there an elegant/best way to tackle this problem? Do we always store states on the top level? Do all current states should be given as the additional input argument of the global function?
Can anybody explain this using simple sample on F#? Thanks a lot.