Bob Nystrom wrote a series of articles at
http://gameprogrammingpatterns.com/ about some ways to structure code specifically in games. I found the site useful myself, so thought I should share it here. He recently released it as a book, but you can still read everything for free on the site if you scroll down a bit. :)