Avventura in alto mare è un’attività introduttiva pensata per essere utilizzata in una classe, una conferenza, un hackathon o altri eventi. E' un’attività autonoma e non fa parte di nessun Club di Computer Science First, quindi non richiede l’utilizzo di materiali, username o password.
In Narrazione, gli studenti usano l'informatica per raccontare storie interattive divertenti. Il Club Narrazione stimola la creatività incoraggiando i membri del Club a raccontare ogni giorno una storia speciale.
Con programmare la moda, gli studenti imparano come l'informatica e la tecnologia vengono applicate al mondo della moda attraverso la programmazione di progetti a tema come le sfilate, gli strumenti da stilista e da modellista.
In Sport, gli studenti usano l'informatica per simulare sport estremi, per creare la pubblicità di un gadget sportivo e la telecronaca di un evento importante.
Con Programmare i giochi, gli studenti imparano le basi della programmazione dei videogiochi realizzando diversi tipi di gioco, dalle gare ai lanci e ai salti sulle piattaforme.
This add-on will make your game more competitive by adding a score that counts the number of times the athlete misses the ball. To keep score, use a computer science concept called a variable. Variables are places where computers store information, like numbers and phrases. You’ll learn more about them in later activities in this club as well.
First, select the ball sprite. To make the score variable, go to the “data” menu.
Click “Make a Variable,” and type in “score.” If you’ve added a second player, call this variable “score 1,” then create a second variable using the same process, and call it “score 2.” Click “OK” to create the variable, and notice the new blocks that show up telling you the things you can do with your new variable.
Here’s a quick overview: Every time you click the flag, the score variable or variables should reset to zero. Then, every time the ball sprite moves past the athlete and hits the red goal line, the first player’s score variable should go up by one. The same should happen for the second player. So, the lower your score, the better you are at the game!
First, build the scoring conditional. If the ball sprite is touching the red part of the stage, the score should go up. Start with an “if” block. The condition is that the ball sprite must be touching red. From “sensing,” drag out “touching color,” and snap it in as the condition. To select the right color to detect, click the square swatch in the block so that the pointer turns into a hand, then move the hand to the stage, and click the red goal area. Check that the right color is selected!
In “Data,” click the “change by” block. When you do this, the number inside “score” goes up by one. Place this block inside the conditional.
If you click the whole stack now, nothing happens unless you *drag* the ball sprite onto the red goal area. Click again. Success! The score again goes up by one.
To make this work for two players, right-click and duplicate the whole “if” block, then snap the duplicated stack below. In the second conditional, choose the blue “Goal 2” color and the “score 2” variable in the “change by” block.
Whether you’re building this add-on for one sprite or two, the ball sprite should continue checking if a goal is scored, so drag a “forever” loop around the conditional stack. Top off the stack with a “when flag clicked” block, but remember that the score needs to reset to zero at the start of each new game.
Do this by placing a “set to” block right under the event, but not inside the forever loop. If you have a second player, do this for their score as well.
Test and see what happens. You may notice that whenever the ball hits the goal area, the score goes up by more than one. Look at the code to figure out why. As soon as the score increases, the code loops back to the beginning… wait! It goes through so quickly that the ball is still touching the red - so the score increases again!
To fix this, add a “wait” block after the “change by” block inside the “if” block. Two seconds is fine, and it fixes the problem.
Here’s the game plan: Make one or two variables to keep track of the score. Use a “forever” block, an “if” block, a “touching color” block, and a “change by” block to make sure the score increase by 1 each time a goal is scored. Start the script with an event, and reset the score or scores to zero.