I feel like I can't write any good melodies
Here's one of the best things my composition teacher ever taught me to do...
Sing melodies... Your voice is your most creative instrument because you don't have to think about it. So one of the best ways to "sketch" a melody, or to get it out of your head, is to sing/vocalize it.
Don't tell me you can't make up a little catchy melody with your voice. Anyone can do that... play a beat and just start making silly melodies over the beat until you get something that seems kinda catchy.
THE HARD PART...
Now that you have the melody in your voice/head, the hard part is to get it down on the keyboard or into your computer.
This is the part that most people skip straight to, which makes no sense if you haven't been playing keyboard for years. Otherwise you just "hunt and peck" for the right notes, hitting wrong ones all the time, and before you know it your melodic idea is gone.
So instead, get it in your voice first. Then (and I still do this) record it with your iphone or whatever. Then listen back to the recording on your iphone and try to get it on the keyboard, or map it out in your program (reason, cubase, whatever)...
Doing the above will not only result in better more organic/alive melodies, but your musical ear and your ability to play the keyboard will RAPIDLY improve.
Trying to bring melodies and ideas out of your head into the real world is essentially the main crux behind learning music. It's what every real musician should be striving to do. Can you imagine if you could hook up a device straight to your brain and just record what you could make up in your head? Wouldn't that be nice... unfortunately we have to learn music and learn to interpret what we are hearing in your "inner ear".
Bach used to forbid his students to compose at the piano/keyboard. There was a reason, he didn't want the mechanics of the keyboard (and the physical habits that result from it) interfering with the freedom of the mind to compose a melody. So take a lesson from old bach and create melodies with your voice first. Or better yet, create them in your mind first, then sing them, then record them, then get them down onto the keyboard/computer.
Eventually all these steps will become 1 seamless fluid process...
PEACE