Skip to content

Please update your browser

Your browser version is not supported by this site. CS First may not work properly. Learn more

Transcript

Many games play songs. In this add-on, you’ll create some music to make your game more exciting. First, make a drum beat. Start by clicking the sound menu. Here, you’ll find the “play drum” block.

It plays a drum sound. You can change two values in this block.

The first is the type of drum. Click the drop-down menu, and try a few. When you create your song, you’ll want to test many different sounds until you find the one you want.

The second value changes the drum beat. To explore how the beat works, put the “play drum” block into a forever loop, click it, and tinker with the beat value.

Start at 1… too slow. Try something bigger, like 2.

Whoa, way too slow. Try something smaller, like 0.5 What about 0.1?

Play around with the number of beats to see what happens.

Most popular music uses quarter, half, and whole notes, so a good rule of thumb is to use .25, .5, and 1 as beat values. This will give your song a smooth rhythm.

This example will fast forward through making a drum beat so you can see the basics. But, feel free to explore and create your own!

Now that you have explored how to make a drum beat, it’s time to add another instrument. Using the “play note” block, you can play musical notes. This example will use four blocks, because the drum beat also has four blocks. You can change the notes these blocks play using the drop-down menu. Play around with a few, and find a sound you like.

You can loop this, too, and play it with your drums.

*drum and note sounds* Finally, you can change the instrument being played using the “set instrument to” block.

Computer Science and music have a lot in common: It’s important to explore and tinker until you create something that you enjoy!

to your program: one to play a drum beat, and another to play an instrument.

Scegli un’estensione
Crea la tua musica
Aggiungi un colpo di tamburo e una musica di sottofondo al tuo gioco.
Aggiungi un'altra sezione alla caverna
Progetta un nuovo sprite Caverna con bordi neri e aggiungilo al tuo gioco.
Rendi il gioco più difficile
Premi la barra spaziatrice più e più volte per mantenere lo sprite in volo.
Pareti pericolose
Fai esplodere lo sprite Giocatore quando tocca le pareti della caverna.
Aggiungi un altro livello
Crea dei livelli aggiuntivi del gioco che diventano più veloci e più difficili man mano che il giocatore avanza.
In picchiata!
Fai scendere lo sprite in picchiata o fallo muovere verso il basso più velocemente rispetto a quando cade.
arrow_backward Indietro
Avanti arrow_forward
Istruzioni
  1. Fai clic su qualsiasi casella per andare al video sui componenti aggiuntivi.
  2. Quando hai terminato, torna sulla schermata dei componenti aggiuntivi e prova un altro componente aggiuntivo!