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 Eine neue Figur hinzufügen


To start, click on “choose new sprite from library,” and add a new sprite. This project will use the beach ball for the Summer Sale Blowout, but you can pick any sprite you’d like.

Next, make the beach ball bounce randomly around the screen.

To do that, use a “glide” block from the motion menu to make the sprite move, then place “pick random” blocks in the x and y values of the “glide” block to make the sprite go random places on the screen. The values in the “pick random” blocks create a range of coordinates for the sprite to move to. The computer will choose a random value between these two numbers, and the sprite will move to that spot on the screen. The width of the stage is negative 240 to positive 240, so add those values into the “pick random” block for x. The height of the stage is negative 180 to positive 180, so add those values into the “pick random” block for y. You can also add a “pick random” block for the seconds it takes to glide to different points on the screen, so the sprite moves for a random amount of time. Do what looks best in your project. Try your code by clicking on the block stack. To make this continuously happen, place a forever loop around the “glide” block and add a “when green flag clicked” block on top of this block stack.

Test it out!

Cool. You can also make the beachball do different actions when it touches other things on the stage. This example will code for if the beachball touches the hippo and if the beachball touches the sides of the Window display.

Drag out two “if-then” statements from the control menu. Add two “touching” blocks from the sensing menu into the “if-then” statements. In this example, one is ‘touching hippo,” and the other is “touching “window display.”

You can make the sprite do whatever you want when it touches another sprite or the Window Display.

For this example, when the beach ball touches the hippo, it will turn right 60 degrees.

When the beachball touches the Window Display sprite, it will turn left and change it’s color effect. Add these blocks inside the first “if-then” statement.

Add a “when flag clicked” event to the top of this block stack to test your program.

Nothing happens! This sprite should check the conditional statements continuously, so place a “forever loop” around both “if-then” statements. Now test the code.

Awesome! When the beach ball touches a hippo, it spins! And when it touches the storefront, the beach ball turns and changes colors.

Now when shoppers walk by, they can see the beach ball in action!

Erweiterung auswählen
Einen Farbwechsel programmieren
Eine Figur erstellen, die die Farbe wechselt, wenn sie die Maus berührt.
Eine neue Figur hinzufügen
Eine Figur erstellen, die abhängig von ihrer Umgebung unterschiedliche Handlungen vornimmt.
Eine Überraschung verstecken
Eine versteckte Überraschung in eurem Schaufenster programmieren.
Verrückt spielen
Eure Figur so programmieren, dass sie ausflippt, wenn sie mit dem Mauszeiger berührt wird.
Kunden hinzufügen (Herausforderung)
Eurem Programm Figuren hinzufügen, die sich unterhalten.
Die Figuren über die Bühne schießen lassen (Herausforderung)
Eine Figur über die Bühne schießen lassen.
arrow_backward Zurück
Weiter arrow_forward
Wählt unten eine Erweiterung aus, die ihr programmieren möchtet.