Each mood is a state in a state machine, for example idle, happy, scared and celebrate. Your product switches between them with simple inputs, so the mascot can react to a tap, a score, a success or an error. Small touches like blinking and gentle movement keep it alive between moods.