You now have Cassy dancing in one place, but people and characters usually move aroundwhen they dance. In this screencast, you will make Cassy move around the stage using the“glide” block. Just like last time, you’ll watch the steps first, then jump in and trythem yourself. Click on the motion menu to see all the blocksthat can be used to change Cassy's position on the stage. For this dance, use the “glide1 second” block. In this example, watch what happens when youdrag the “glide” block into the script editor. If you move Cassy somewhere on thescreen, then click the glide block, Cassy will go back to the position she was in whenthe block was first dragged out.
When the code is not running, you can see that the “glide” block in the script buildersays "glide 1 second to X: <read the number> and y: <read the number>." Those X and Y valuesrepresent Cassy's position on the stage. If you move Cassy, you'll see that the X andY values change to reflect Cassy's new position on the stage.
To make Cassy move back and forth as she dances, put her in one spot on the stage, then dragout the “glide” block for that position into your script editor. Next, move Cassyto a second position on the stage, and drag out another “glide” block.
Try these two stage positions by clicking one “glide” block and watching Cassy moveto the new spot, then clicking the other “glide” block to see her move slowly to the secondspot. You can even reduce the value in the "seconds" field to make her move faster.
Once you are happy with Cassy's movement, place these two blocks inside the foreverloop, with some “next costume” blocks in between. Now, Cassy both dances and moves!
Finally, click on the events menu and adda “when flag clicked” block to the top of the block stack. Doing this will make yourproject start when the flag is clicked. Now, it's your turn. Drag Cassy to a positionon the screen where you want her to dance, then drag out the "glide 1 second” block,which will contain the X and Y coordinates. Move Cassy to a new position, then add another"glide one second" block. Add both blocks to your code stack and see if you like herdance. Remember, you can always try different values in the white value fields until youcreate a dance you like.