Motivation is something that we need to figure out for ourselves. For those of us who are hobby game-developers, this has to be an intrinsic motivation: we need to want to create for the sake of creating what we want to create.
I understand that this can be difficult, especially when time is limited. As someone with several hobbies, I'm lucky to have temporal separation of activity-availability. My neighbors don't want me playing music after about 8:00pm, so when that time rolls around, I know that it's time to stop drumming and do something else. Sometimes that's coding, sometimes it's hanging out with friends or playing a game or writing or knitting or whatever.
When it comes to choosing which hobby to practice, it's usually a moment-to-moment decision. If I'm playing a game and I get struck with an idea for my game, I'll drop everything and start coding. If I really just want to relax and watch TV or something, I'll stop coding and knit while I watch something. Whatever it is, I know that I have to take advantage of motivation when it comes, because my time is tight and I've a lot of hobbies that want my attention.
Finally, when coding, I find that once the groundwork has been laid I can spend less time coding to see a tangible result. Tonight, for example, I spent about 10 minutes coding a new, albeit small, feature, maybe 10 more minutes cleaning up code to make it fit a bit nicer and remove duplicate code, and it's something that I was able to test, tweak, and get working well within a half-hour. That felt nice. Being able to see and use the changes that you make, the features you implement, makes motivating yourself to continue easier. That's one of the problems with going through a big reference book: you often don't see the results right away, and it's easy to feel like you're spending all of this energy spinning your wheels but you're not getting anywhere.
To fix that, whenever I'm going through a book or tutorial or what-have-you, trying to implement something new or some new way of doing something, I always implement and iterate. If I can't see what I'm doing, what the code is doing, then I'm just copying. I need to understand. Sometimes, in doing this, I come up with better ideas (or ideas that work better for my needs) and hey, I've actually learned something. Sometimes, I end up using a piece of tutorial code as a sort of library (like this little piece of functionality that I recently adopted), but in implementing it, I've expanded on what, before, was a much simpler or less-functional piece of code, and hopefully I've picked up on programming practices, techniques, or something-else that I can use in future projects.
This is just what works for me, and what keeps me typing away when I could probably be doing other things (or doing other things, I suppose, when I could be typing).