![]() ![]() The logic we want to implement here is “if the ball is touching the paddle, then bounce.” Step 7: add code to bounce the ball off the paddle. The ball should be bouncing around the stage, and you should be able to move the paddle side-to-side with the mouse. ![]() Click on it if it’s not.Ĭlick the green flag icon above the stage to set everything in motion. It will appear on the stage and in the Sprites area next to the ball. Click the “Choose a Sprite” icon and select the green ”Paddle” sprite. Now let’s place another sprite for the player to use to hit the ball - the paddle. Multiple scripts can each wear the block and all activate at the same time, running in their own separate processes. S cripts (a stack of blocks, like those pictured above) that wear this block “listen” for the start event and will activate when they hear it. When the green flag icon above the stage (the Go button) is clicked, it sends a start event in your project. The “ When Green Flag Clicked” block, commonly called the “ Start Block,” is a “ Hat Block” that listens for a Start event. The ball should be moving around the stage, bouncing off the edges. ![]() Remember the green flag icon above the stage I mentioned earlier? Can you guess what it does? Click on it, if you haven’t already. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |