In this video, you will program your sprite to move, bounce off the edges of the stage,and point towards the mouse pointer. Your starter project begins with the sprite,Tera. To make Tera move, select the motion menu, and pull out the “move 10 steps”block. Clicking it will make the sprite move 10 steps. Tinker with the value to make thesprite move a little or a lot. Notice that if the value is negative, the sprite movesin reverse! Right now, the sprite only moves 10 stepsonce when you click the block. But, for this project, Tera should move constantly. Go tothe control menu, and pull out a forever loop. Place it around the “move” block. Now,when you click the block stack, Tera should constantly move until it moves off screen!
Using only the forever loop and the “move” block, Tera is not programmed to either stopor turn around. To make Tera turn around when reaching the end of the stage, place an “ifon edge, bounce” block inside the forever loop. When you test it, the sprite shouldbounce back and forth across the screen. This is a great effect, but Tera also needsto be able to change direction and follow the mouse pointer. Fortunately, there is ablock for that! From the motion menu, pull out the “point toward mouse-pointer” block,and add it to the stack. Now, when you test your program, Tera should always move towardthe mouse pointer, but never move offscreen. Now, it’s your turn.
1. Use the “motion” and “control” blocks to make Tera always move, but nevermove offscreen. 2. Make Tera follow the mouse by using the“point toward mouse-pointer” block.