Right now, only one player can play this game. In this screencast, you’ll remix this gameso that a second player can control a chaser using keypress events. This screencast willdemonstrate 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 dosomething 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 scientistsoften work together on the same project, so it’s important to program in a way thatis easy for other people to read and understand.
You programmed the chaser to bounce around the screen, but now you want it to stop movingon its own and be controlled by a second player. To make that possible, you first need to removethe code that moves this sprite. Don’t delete all of it – be sure to leave in placethe if statement that checks if the two sprites are touching.
Next, you need to program events to move this sprite forward, backward, left, and rightwhen a second player presses the arrow keys.
This screencast will fast-foward through the addition of these blocks, but when you createthis code, remember that you need to add four events, four “motion” blocks and, if youwant 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 thevalue of the “move 10 steps” block. Play around with those values until player 2 movesslowly enough to make the game fair. Don’t worry if it takes a few tries to get thisright. A big part of computer science is trying new things, testing them out, then going backto 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!
Riproduci suono se preso
Aggiungi un suono al tuo gioco e programma il progetto a riprodurre quel suono.
Gioca con un amico
Programma uno sprite affinché sia controllato da un altro sprite.
Cambia il giocatore
Cambia il costume del giocatore quando tocca un altro sprite.
Accelera la caccia
Rendi più difficile il gioco velocizzando l'inseguimento.
Crea una nuova variabile che memorizzi l'attuale punteggio più alto.