Well, I wanted to do it for the game
That should be the secondary goal.
Read the whole thing, lol. You can make it for the game, but if it sounds bad no one will want to play your game for fear of ear rupture.
So as the musician, it comes down to 1 primary goal: make it sound good.
Is it wrong to use references? To have a base, or is it wrong to recycle?
I'm not sure what you mean in this case.
If you mean to reference other artists; no, of course not. I have some person opinions on that I'll mention at the end*, but broadly speaking, no.
If you mean to
sample an artist (as in use a short snippet of their song to help you create your song), this becomes a legal gray area. Musicians have been sampling other artists for years, but the legal precedent around it is vague and not clear. I'd avoid it just to be safe.
If you mean to re-use a melody you wrote, no of course not. It's called
leit motif which is the act of taking a melody and transforming it throughout your soundtrack to fit various scenarios. Leit motif can be used in various ways: such as giving specific characters their own themes, or to give the whole story a connecting tissue, or however you want! Get creative with it!
Leit Motif, in my opinion, has a challenging up front cost, but makes the rest of the soundtrack easier to write. It takes some noodling to find a good melody that can be transformed across multiple moods and tempos. That's the hard part. But once you find it...well, you just copy-paste that bad boy across all your songs now, greatly speeding up the process.
I recommend you check my portfolio.
3 of the 5 spotlighted songs utilize and transform a base melody.
the first song, Sunday Shuffle, has the acoustic guitar perform the main Fidel melody:
A---|B---|D-C#-|B-B-|(etc)
This little pattern gets transformed in into a slightly more bouncy pattern in Finally Friday, but the accented notes are still A, B, D, C#, B
And again you can hear it in Her Imagination where the melody is more bubbly and hyperactive. It's a bit harder to make out because of how much it's transformed, but those same notes are still the accented notes of the melody.
*So about referencing other artists work to inspire your own; it's easy to fall into the trap of comparing or even trying to be just like a specific artist which is going to lead you down a road of unending dissatisfaction.
Be careful with how much influence other artists have on your sound. It's a balancing act.
I highly recommend listening to a lot of music, and a lot of music from every genre at that. However, you should also make sure you are discovering your own sound through your own experimentation, both failure and success.