Skip to content

Please update your browser

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


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.

Choisir une extension
Crée ta propre musique
Ajoute un battement de tambour et un fond sonore à ton jeu.
Ajouter une grotte
Dessine un nouveau lutin Grotte avec des bords noirs et ajoute-le à ton jeu.
Augmenter la difficulté du jeu
Oblige le joueur à appuyer continuellement sur la barre d'espace pour garder le lutin en vol.
Parois dangereuses
Fais exploser le lutin Joueur lorsqu'il touche les murs de la grotte.
Ajouter un niveau
Crée des niveaux de jeu supplémentaires qui deviennent de plus en plus rapides et difficiles à mesure que progresse le joueur.
Plonge !
Fais en sorte que le lutin plonge, ou descende plus vite qu'il ne tombe.
arrow_backward Retour
Suivant arrow_forward
  1. Clique sur l'une des fenêtres pour accéder à la vidéo de cette extension.
  2. Quand tu as fini, reviens à la fenêtre des extensions et essaies-en une autre !