How can I simulate temperature in the BGE?

Partially related:

Note that the shader in the link above is a screen shader and not a OOP shader like you are looking for to work with game-properties.