Most ideas came up when playing games and wanting to make some additions to the genre. Quite often I can think easily of a few twists to make my game unique in some ways.
Themes and story lines can be many things, like a walk in the forest and look around me. Sometimes it can be stuff I saw on TV or read in the newspaper or what people tell me.
Now creating computer games is a form of art in some ways, so naturally good inspiration also comes from the same kind of sources as artists in other forms of art use.