It is a lot easier to activate hack-mode if you aren't updating your IM status, checking twitter, checking proggit, checking HN, checking email, etc.
Once I'm in hack-mode, however, it doesn't really matter if I'm are connected to the Internet (or if a bomb went off, for that matter).
I think, however, that getting addicted to a silly flash game might be more of a symptom than the root cause (lack of motivation).
For more motivation, I might get started writing a piece of code that is interesting to me (to warm up), then transition from it into the code that I actually have to write.
Another thing to look at is physiological causes, make sure you have proper blood sugar level (I'm personally a chronic "I forgot to eat, again..." type of person, and that really hurts your ability to do anything).
Also, exercising regularly will increase the amount of energy that you have during the day. When you have energy, you feel like getting stuff done.