I don't think that switch to G major sounds all that bad. If you're really concerned about it, you end with an F in the melody, then you could do a V - I going from F to F# on the V chord, then resolving to I again by resolving the leading tone. Otherwise, I think it's a pretty "video-game"-esque thing to do.
This reminded me Banjo Kazooie for some reason, and I'm not entirely sure why. The tone is kind of the same, though maybe not everywhere in the overworld.
I thought it was a bit odd that some parts of your melody were swung, and some weren't. It wasn't a major thing by any means, but I noticed it while listening. This is pretty nice stuff; well done.