The developer of a nicely reviewed metroidvania called A Robot Named Fight! has released the source code, hoping that others can learn from it.
Currently though, it's not fully open source as they have it under their own license but they made it clear they're considering putting it under something like the GPL if they can. It also uses the Unity game engine, so it still relies on a proprietary game engine but it's still a good step and nice to see more developers consider open source.
"A Robot Named Fight is a Metroidvania roguelike focused on exploration and item collection. Take on the role of a lone robot tasked with stopping the entity known as the Megabeast. Explore procedurally-generated labyrinths, uncover randomized power-ups and artifacts, find secrets, and blast meaty creatures in this deliciously gory Metroidvania."
- Explore a procedurally-generated labyrinth with more than 4 billion unique runs.
- Prove your worth with true permadeath.
- Take on over 60 menacing enemies solo or with a friend via local co-op.
- Adapt to a different item set every run with more than 80 unique items
- Complete achievements to unlock new content.
- Play using your favorite controller.
- Enjoy an unreasonable amount of meat!