How to Compose a Good Bassline
The key to composing a good baseline is working around the chords. Once you've figured out the chords, write down the root note of each one. The root is always the same as the chord, so in A Major, the root is A. Then, try repeating the notes between chord changes. For example, if your chords change every quarter note, try playing the root notes in sixteenth notes. For something more advanced, add other notes from a chord between chord changes. For instance, if you're changing between C, F, and G, add an E between the first 2 chords to bridge the gap. You can also experiment with the rhythm of your notes to add some flavor to the bass.
Know that before the bassline is written, it is essential to know the chords of a song. Also, the melody is useful to devise the bassline. Until adequate experience is acquired, this should always be the first step! Find the roots of the chord on the bass instruments or write them out on a bass clef with the melody and chords.  Repeat. From this point, a punk bassline is almost automatically made by playing repetitively on these notes. To ensure a more interesting line though, it is first useful to smooth out the bassline. To smooth out the bassline, use scales or small jumps to connect the chords together. Don't be afraid to invert the chords, or change what note in the chord is on the bottom, to make the line smooth. Check the melody. See if it sounds independent of the bassline. Try to use contrary motion, such as when the melody goes up, then the bass goes down and vice versa. At this point, this is a simple bassline. This may do for some, but the more creative will want to embellish. Experiment with rhythms to get a groove going.  Take the other notes in the chord or tones close to the original note and play those once in a while. Be sure to focus on the main note though. Let the bassline complement the other parts. If this has a riff, the bass would love to have its turn with it. Just don't make it a carbon copy of another part, or else the bassline should take the bus home! Find out what chords your guitarist is playing.  Repeat those notes in time with the guitar. Keep experimenting until you are comfortable. Using the notes you were already playing as a base, add different notes to create a melody. Keep experimenting until you find something that sounds good. Take on board constructive criticism from your bandmates. It's very important that you work together and put in equal amounts of effort. 
Know that before the bassline is written, it is essential to know the chords of a song. Find the roots of the chord on the bass instruments or write them out on a bass clef with the melody and chords. Repeat. To smooth out the bassline, use scales or small jumps to connect the chords together. Check the melody. At this point, this is a simple bassline. Experiment with rhythms to get a groove going. Take the other notes in the chord or tones close to the original note and play those once in a while. Let the bassline complement the other parts. Find out what chords your guitarist is playing. Repeat those notes in time with the guitar. Using the notes you were already playing as a base, add different notes to create a melody. Take on board constructive criticism from your bandmates. 