It is this part that is hardest to talk about in a general sense, because nearly every single game will have different requirements. I will look at some generic ideas, focussing on our example. Encapsulation serves as a way of protecting information from modification outside of the class itself. This does though prove awkward at times because even retrieval of the variable is invalid. Each window has its own message queue, and messages are handled on a FILO basis.
Messaging also allows a certain degree of 'fake' parallel processing.
Let us look at an example. Let us assume the monsters in our game are connected via a 'radio link' - that is, if they encounter an enemy, they alert everyone else. Or if a monster doesn't respond to a random check, another monster is sent over to check. This kind of behaviour requires a lot of knowledge of the game world - but this information is not available to individual monsters. Now, using functions, my code would be much more complicated than its messaging counterpart I am using.