Skip to content

Please update your browser

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

arrow_back Jouer à ton jeu avec un ami


Right now, only one player can play this game. In this screencast, you’ll remix this game so that a second player can control a chaser using keypress events. This screencast will demonstrate how to do that, then you’ll try it on your own.

First, select a chaser as the sprite for the second player. This sprite is going to do something different from the other chasers, so you need to rename it “player2.”

To do this, click on the property arrow above the sprite. Remember, computer scientists often work together on the same project, so it’s important to program in a way that is easy for other people to read and understand.

You programmed the chaser to bounce around the screen, but now you want it to stop moving on its own and be controlled by a second player. To make that possible, you first need to remove the code that moves this sprite. Don’t delete all of it – be sure to leave in place the if statement that checks if the two sprites are touching.

Next, you need to program events to move this sprite forward, backward, left, and right when a second player presses the arrow keys.

This screencast will fast-foward through the addition of these blocks, but when you create this code, remember that you need to add four events, four “motion” blocks and, if you want the sprite to turn smoothly, add a “repeat until not pressing” block for each event.

Once you finish coding all four events, tinker with the sprite’s speed by changing the value of the “move 10 steps” block. Play around with those values until player 2 moves slowly enough to make the game fair. Don’t worry if it takes a few tries to get this right. A big part of computer science is trying new things, testing them out, then going back to tinker with the code until you’re happy with the result.

Now, it’s your turn. Once you’ve finished programming your game for a second player, ask your neighbor to join the fun!

Choisir une extension
Jouer un son si attrapé
Ajoute un son à ton jeu et programme ton projet pour qu'il joue ce son.
Jouer à ton jeu avec un ami
Programme un lutin qui sera contrôlé par un autre joueur.
Modifier le joueur
Change le costume de ton joueur chaque fois qu'il touche un autre lutin.
Accélérer la poursuite
Augmente la difficulté du jeu en rendant les chasseurs plus rapides.
Record !
Crée une nouvelle variable qui enregistre le record actuel du jeu.
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 à l'écran des extensions et essaies-en une autre !