Skip to content

Please update your browser

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


Welcome to a fun challenge add-on called Fitness Coach! The challenge is to code the sprite to appear to have a pulse and talk about how the fitness gadget tracks its heart rate!

This video will help you plan how to code the sprite, then you’ll try it on your own.

One way to make the sprite look like it has a heart rate is to apply the “fisheye” effect to it. To do that, from the “looks” menu, add a “change effect” block. If you change the dropdown to “fisheye” and click the block, the sprite will have a funny fisheye effect. To reverse the effect, add another “change effect” block with the opposite number in the value space – meaning add a negative sign. To make it look more like a pulse, keep repeating the increase and decrease. You may also want to add “wait” blocks from the “control” menu to change the pace of the pulse.

Add some “say” blocks to describe how your fitness gadget tracks a user’s heart rate. In this example, the sprite introduces the heart rate feature, shows off the heartbeat effect, then states its heart rate. Tinker with the values in each block to customize your program. When you are finished, tell your program when to make this code run. Using “broadcast” and “receive” blocks will help make it easier to read and reuse code.

From the “events” menu, drag a “broadcast and wait” block to at least one place on the block stack from the starter code. Put it in each spot where you want the sprite to appear to have a pulse and talk about heart rate. From the dropdown, select “new message,” type “fitness coach,” and click OK! “Broadcast and wait” tells the program to wait until the code that receives the message is done running before the program runs more code.

“Broadcast” would let the rest of the code happen while the sprite is pulsating.

Finally, from the “events” menu, place a “when I receive” block on top of the code giving the sprite a pulse. From the dropdown, select “fitness coach.”

Test the code by clicking the flag. The sprite should look like it has a pulse and comment on it when the program reaches the “fitness coach” broadcast block.

Here’s the game plan: Code the Fitness Coach add-on by describing your gadget’s heart rate feature and demonstrating how it tracks a user’s heart rate. To make this work, add “broadcast” and “when I receive” blocks to your code. Test your code often until you like the way it works. Have fun coding your program.

Choisir une extension
Programmer le lutin pour qu'il danse.
Changement de scène
Fais passer l'androïde sur différentes scènes pour voir comment le gadget réagit.
Ajoute des effets météorologiques pour montrer la solidité du gadget.
Décision d'achat
Demande à l'acheteur d'acheter l'objet.
Public admirateur
Ajoute au projet d'autres lutins qui interagiront avec l'athlète.
Entraîneur sportif
Code le lutin pour lui ajouter un pouls et pour le faire parler de son rythme cardiaque.
arrow_backward Retour
Suivant arrow_forward
  1. Découvre les différents badges que tu peux gagner.
  2. Sélectionne les fonctionnalités qui t’intéressent !