title
Block Breaker - Invent with Scratch 2.0 Screencast
description
Free online course in Scratch: https://www.udemy.com/scratch-game-programming/?couponCode=GET_SCRATCHING
Many more games in the free Scratch Programming Playground book! https://inventwithscratch.com/book
Run this game program in your browser at http://scratch.mit.edu/projects/11719281/
With MIT's Scratch 2.0 programming environment, Al demonstrates a pong-like block buster game (also called Arkanoid or Breakout)
More Scratch screencast tutorials can be found at http://inventwithscratch.com
detail
{'title': 'Block Breaker - Invent with Scratch 2.0 Screencast', 'heatmap': [{'end': 232.014, 'start': 196.277, 'weight': 0.86}, {'end': 372.332, 'start': 347.575, 'weight': 0.814}, {'end': 474.765, 'start': 446.817, 'weight': 0.729}, {'end': 572.867, 'start': 548.103, 'weight': 0.911}, {'end': 983.376, 'start': 961.198, 'weight': 0.706}], 'summary': "Learn to create a block-breaking game using scratch, including paddle movement, ball bouncing, and message broadcasting for ball-paddle interaction. additionally, explore features such as game over insult messaging and sprite broadcasting with a 'you win' message at a score of 12.", 'chapters': [{'end': 448.717, 'segs': [{'end': 37.164, 'src': 'embed', 'start': 7.472, 'weight': 0, 'content': [{'end': 10.313, 'text': 'Hello! Welcome to the Invent with Scratch screencast.', 'start': 7.472, 'duration': 2.841}, {'end': 14.415, 'text': "I'm Al Swigert, and in this screencast, we're going to make a block-breaking game.", 'start': 10.593, 'duration': 3.822}, {'end': 20.697, 'text': 'So I can move the paddle around with the mouse, and keep trying to.', 'start': 15.915, 'duration': 4.782}, {'end': 22.858, 'text': 'Oh Oh.', 'start': 20.697, 'duration': 2.161}, {'end': 24.639, 'text': "Oh wow, that's harsh.", 'start': 23.478, 'duration': 1.161}, {'end': 29.321, 'text': "Anyway, let's start up the Scratch editor by clicking on the Create button.", 'start': 25.739, 'duration': 3.582}, {'end': 34.443, 'text': "And we won't need this cat sprite, so I can go ahead and right-click on it and select Delete.", 'start': 30.041, 'duration': 4.402}, {'end': 37.164, 'text': "And instead we're going to paint a new sprite.", 'start': 35.123, 'duration': 2.041}], 'summary': 'Al swigert guides creating a block-breaking game using scratch editor.', 'duration': 29.692, 'max_score': 7.472, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/5KvQVKp8N5o/pics/5KvQVKp8N5o7472.jpg'}, {'end': 181.192, 'src': 'embed', 'start': 152.021, 'weight': 1, 'content': [{'end': 155.383, 'text': 'We need to set it so that the paddle is always down here at the bottom.', 'start': 152.021, 'duration': 3.362}, {'end': 160.58, 'text': "We'll say around the y coordinate of negative 140.", 'start': 155.424, 'duration': 5.156}, {'end': 164.322, 'text': 'So grab the setY block, move that in.', 'start': 160.58, 'duration': 3.742}, {'end': 167.724, 'text': "We'll change that number to negative 140.", 'start': 165.043, 'duration': 2.681}, {'end': 173.468, 'text': 'So this code will point the sprite towards the mouse pointer and then move in that direction.', 'start': 167.724, 'duration': 5.744}, {'end': 181.192, 'text': 'But also, the Y coordinate always gets reset back to negative 140.', 'start': 174.228, 'duration': 6.964}], 'summary': 'Set paddle at y coordinate -140 to follow mouse pointer.', 'duration': 29.171, 'max_score': 152.021, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/5KvQVKp8N5o/pics/5KvQVKp8N5o152021.jpg'}, {'end': 232.014, 'src': 'heatmap', 'start': 196.277, 'weight': 0.86, 'content': [{'end': 203.242, 'text': "So I'll grab this go to xy block and put that right underneath when the green flag is clicked, but outside of the forever loop.", 'start': 196.277, 'duration': 6.965}, {'end': 207.005, 'text': "And we'll say it always starts off at 1.30.", 'start': 203.682, 'duration': 3.323}, {'end': 212.549, 'text': "Next we'll need a ball, so I'll close this and click on the choose sprite from library.", 'start': 207.005, 'duration': 5.544}, {'end': 218.313, 'text': 'So we can go to the things category and find that tennis ball.', 'start': 213.489, 'duration': 4.824}, {'end': 219.834, 'text': 'Here we go, this looks good.', 'start': 218.613, 'duration': 1.221}, {'end': 232.014, 'text': "So the tennis ball code, basically we'll just have it start bouncing around the walls of the stage.", 'start': 224.468, 'duration': 7.546}], 'summary': 'Creating a code to make a tennis ball start bouncing around the stage.', 'duration': 35.737, 'max_score': 196.277, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/5KvQVKp8N5o/pics/5KvQVKp8N5o196277.jpg'}, {'end': 298.174, 'src': 'embed', 'start': 262.93, 'weight': 3, 'content': [{'end': 266.356, 'text': "It's doing that because it's just facing left and then right.", 'start': 262.93, 'duration': 3.426}, {'end': 276.617, 'text': "So we should have this tennis ball start off, first we'll have it start off at the origin of x0 and y0.", 'start': 270.014, 'duration': 6.603}, {'end': 281.499, 'text': "And then we'll also have it start off pointing in a certain direction.", 'start': 276.637, 'duration': 4.862}, {'end': 284.901, 'text': 'So grab the point and direction block and change this to 135.', 'start': 281.559, 'duration': 3.342}, {'end': 286.282, 'text': "That's pretty good.", 'start': 284.901, 'duration': 1.381}, {'end': 298.174, 'text': 'So the ball starts off pointing in that down right direction and now it just bounces around the walls of the screen.', 'start': 291.633, 'duration': 6.541}], 'summary': 'The tennis ball starts at (x0, y0) and points at 135 degrees, bouncing around the screen.', 'duration': 35.244, 'max_score': 262.93, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/5KvQVKp8N5o/pics/5KvQVKp8N5o262930.jpg'}, {'end': 388.256, 'src': 'heatmap', 'start': 347.575, 'weight': 2, 'content': [{'end': 353.021, 'text': "I'll click on the black triangle and we'll say new message and we'll call this message bounce.", 'start': 347.575, 'duration': 5.446}, {'end': 358.748, 'text': 'And so broadcasting messages can cause other sprites to start doing things.', 'start': 354.844, 'duration': 3.904}, {'end': 360.11, 'text': "So I'll show you what I mean.", 'start': 359.169, 'duration': 0.941}, {'end': 361.632, 'text': 'Click on the tennis balls code.', 'start': 360.23, 'duration': 1.402}, {'end': 365.791, 'text': 'And then grab this when I receive bounce.', 'start': 363.53, 'duration': 2.261}, {'end': 372.332, 'text': 'So this code will, underneath this block, will execute whenever this sprite receives the bounce message.', 'start': 366.671, 'duration': 5.661}, {'end': 377.634, 'text': 'So if any other sprite broadcasts the bounce message, the code under here will be executed.', 'start': 372.512, 'duration': 5.122}, {'end': 381.575, 'text': 'What we want this to do is change the direction of this sprite.', 'start': 378.314, 'duration': 3.261}, {'end': 383.275, 'text': "So we'll do a little bit of math here.", 'start': 381.755, 'duration': 1.52}, {'end': 388.256, 'text': 'The new direction of the sprite should be 180 minus the current direction.', 'start': 384.335, 'duration': 3.921}], 'summary': 'Demonstrating how to change sprite direction in response to a broadcasted message.', 'duration': 40.681, 'max_score': 347.575, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/5KvQVKp8N5o/pics/5KvQVKp8N5o347575.jpg'}], 'start': 7.472, 'title': 'Creating a block-breaking game with scratch', 'summary': 'Provides a tutorial on creating a block-breaking game using scratch, encompassing paddle movement, ball bouncing, and message broadcasting for ball-paddle interaction.', 'chapters': [{'end': 448.717, 'start': 7.472, 'title': 'Block-breaking game with scratch', 'summary': 'Introduces a tutorial on creating a block-breaking game using scratch, covering paddle movement, ball bouncing, and message broadcasting for ball-paddle interaction.', 'duration': 441.245, 'highlights': ['The tutorial covers creating a block-breaking game using Scratch, including paddle movement and ball bouncing.', 'The paddle is programmed to follow the mouse cursor, maintaining a fixed y-coordinate at -140 and a rotation style to appear right side up.', 'The tennis ball sprite is programmed to bounce around the stage walls and its direction is set to 135 degrees.', "The paddle sprite is coded to broadcast a 'bounce' message to the tennis ball when they touch, causing the ball to change direction based on the current angle of movement."]}], 'duration': 441.245, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/5KvQVKp8N5o/pics/5KvQVKp8N5o7472.jpg', 'highlights': ['The tutorial covers creating a block-breaking game using Scratch, including paddle movement and ball bouncing.', 'The paddle is programmed to follow the mouse cursor, maintaining a fixed y-coordinate at -140 and a rotation style to appear right side up.', "The paddle sprite is coded to broadcast a 'bounce' message to the tennis ball when they touch, causing the ball to change direction based on the current angle of movement.", 'The tennis ball sprite is programmed to bounce around the stage walls and its direction is set to 135 degrees.']}, {'end': 1118.326, 'segs': [{'end': 516.899, 'src': 'embed', 'start': 475.625, 'weight': 2, 'content': [{'end': 480.727, 'text': "We'll choose a nice angry red font that says game over.", 'start': 475.625, 'duration': 5.102}, {'end': 489.951, 'text': 'You lose, loser.', 'start': 488.51, 'duration': 1.441}, {'end': 495.434, 'text': 'Loser McLoserpants.', 'start': 493.533, 'duration': 1.901}, {'end': 499.777, 'text': "That's pretty good.", 'start': 499.136, 'duration': 0.641}, {'end': 503.539, 'text': "I'll just make that a little bit bigger.", 'start': 501.958, 'duration': 1.581}, {'end': 509.583, 'text': 'Get it right in their face.', 'start': 508.022, 'duration': 1.561}, {'end': 516.899, 'text': 'So this text is a sprite, just like the paddle and just like the tennis ball, and we can add code to it.', 'start': 512.116, 'duration': 4.783}], 'summary': 'Designing a game over message with a larger red font for impact.', 'duration': 41.274, 'max_score': 475.625, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/5KvQVKp8N5o/pics/5KvQVKp8N5o475625.jpg'}, {'end': 572.867, 'src': 'heatmap', 'start': 548.103, 'weight': 0.911, 'content': [{'end': 557.009, 'text': "And if Y position is less than negative 140, we'll have it broadcast a game over message.", 'start': 548.103, 'duration': 8.906}, {'end': 560.471, 'text': 'So new message, game over.', 'start': 557.769, 'duration': 2.702}, {'end': 567.582, 'text': "So our game over sprite, I'll just rename it that, game over sprite.", 'start': 562.557, 'duration': 5.025}, {'end': 572.867, 'text': 'Our game over sprite will need to do two things.', 'start': 570.865, 'duration': 2.002}], 'summary': 'If y position < -140, broadcast game over message; game over sprite needs to do two things.', 'duration': 24.764, 'max_score': 548.103, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/5KvQVKp8N5o/pics/5KvQVKp8N5o548103.jpg'}, {'end': 767.538, 'src': 'embed', 'start': 712.439, 'weight': 1, 'content': [{'end': 714.92, 'text': 'Go to the data section to get that score variable.', 'start': 712.439, 'duration': 2.481}, {'end': 719.11, 'text': 'And so wait until the score is equal to 12.', 'start': 716.348, 'duration': 2.762}, {'end': 721.291, 'text': 'And once that happens, we know that the player has won.', 'start': 719.11, 'duration': 2.181}, {'end': 725.433, 'text': "So we'll go to the purple look section and then have the sprite show itself.", 'start': 721.651, 'duration': 3.782}, {'end': 731.497, 'text': "And then since the player has won, we'll go ahead and stop the program with this stop all block.", 'start': 726.294, 'duration': 5.203}, {'end': 733.878, 'text': "So now let's start creating those blocks.", 'start': 732.177, 'duration': 1.701}, {'end': 736.54, 'text': 'Go ahead and click on choose sprite from library.', 'start': 734.199, 'duration': 2.341}, {'end': 740.682, 'text': "I'm going to go to the things category.", 'start': 736.56, 'duration': 4.122}, {'end': 744.324, 'text': 'And this button three sprite looks pretty blocky.', 'start': 740.842, 'duration': 3.482}, {'end': 745.065, 'text': 'We can use that.', 'start': 744.364, 'duration': 0.701}, {'end': 753.138, 'text': "That's a little big, so we'll shrink that down some.", 'start': 750.969, 'duration': 2.169}, {'end': 765.176, 'text': "So all these blocks do are just sit around until the tennis ball hits them, at which point they'll disappear and then add one point to the score.", 'start': 756.69, 'duration': 8.486}, {'end': 767.538, 'text': "So that's pretty simple to program.", 'start': 765.956, 'duration': 1.582}], 'summary': 'Program to display sprite when score reaches 12 and stop program. use button three sprite from library and shrink it down.', 'duration': 55.099, 'max_score': 712.439, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/5KvQVKp8N5o/pics/5KvQVKp8N5o712439.jpg'}, {'end': 988.201, 'src': 'heatmap', 'start': 961.198, 'weight': 0.706, 'content': [{'end': 966.059, 'text': 'Go ahead and add that to our debugging code also, so that resets itself back to normal.', 'start': 961.198, 'duration': 4.861}, {'end': 974.362, 'text': 'And then grab that point and direction code and add that to the start also, and also to the debugging part.', 'start': 967.76, 'duration': 6.602}, {'end': 983.376, 'text': 'So now you can see that looks way fancier than just disappearing.', 'start': 979.232, 'duration': 4.144}, {'end': 988.201, 'text': 'I can press the space key to make it reappear and be set back to normal.', 'start': 984.717, 'duration': 3.484}], 'summary': 'Enhanced debugging code adds point and direction code, improving display and functionality.', 'duration': 27.003, 'max_score': 961.198, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/5KvQVKp8N5o/pics/5KvQVKp8N5o961198.jpg'}, {'end': 1113.811, 'src': 'embed', 'start': 1086.104, 'weight': 0, 'content': [{'end': 1091.965, 'text': 'We also added some text that hides itself at the very beginning of the game and then later shows itself when a certain condition happens.', 'start': 1086.104, 'duration': 5.861}, {'end': 1096.287, 'text': "For the game over, it's when it receives the game over broadcast.", 'start': 1092.105, 'duration': 4.182}, {'end': 1101.048, 'text': "And for you win, it'll wait until the score is equal to 12 before it shows itself.", 'start': 1096.347, 'duration': 4.701}, {'end': 1109.05, 'text': 'We also learned that we can easily duplicate sprites so that we can have tons of the exact same sprite with the exact same code.', 'start': 1101.828, 'duration': 7.222}, {'end': 1113.811, 'text': "It's a lot like duplicating the code blocks, except we're also duplicating the sprite itself.", 'start': 1109.51, 'duration': 4.301}], 'summary': 'Game development includes hiding text, using broadcasts, and duplicating sprites with identical code.', 'duration': 27.707, 'max_score': 1086.104, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/5KvQVKp8N5o/pics/5KvQVKp8N5o1086104.jpg'}], 'start': 450.318, 'title': 'Game over insult and sprite broadcasting', 'summary': "Discusses adding a game over feature with insult message when the ball gets past the paddle, along with creating a game with sprite broadcasting and duplication, including a 'you win' message when the score reaches 12.", 'chapters': [{'end': 516.899, 'start': 450.318, 'title': 'Game over insult', 'summary': "Discusses adding a game over feature when the ball gets past the paddle, along with insulting the player by displaying a 'game over' message with an insult in an angry red font, reinforcing it as a sprite and explaining the addition of code to it.", 'duration': 66.581, 'highlights': ['The chapter discusses adding a game over feature when the ball gets past the paddle, reinforcing it as a sprite and explaining the addition of code to it.', "Adding a 'game over' message with an insult in an angry red font to display to the player.", 'Explaining the process of creating a new sprite by painting a new one and setting the text tool to choose a nice angry red font for the insult.']}, {'end': 1118.326, 'start': 517.078, 'title': 'Creating a game with sprite broadcasting and duplication', 'summary': "Covers creating a game in which a tennis ball bounces off blocks, with a game over message broadcasted if the ball passes the paddle and a 'you win' message displayed when the score reaches 12, while also demonstrating sprite duplication and message broadcasting.", 'duration': 601.248, 'highlights': ["The chapter covers creating a game in which a tennis ball bounces off blocks, with a game over message broadcasted if the ball passes the paddle and a 'you win' message displayed when the score reaches 12, while also demonstrating sprite duplication and message broadcasting.", 'Creating a game over message that hides itself at the start of the program and displays itself when receiving the game over broadcast, also stopping the program and resetting the score to zero at the start.', "Adding a variable to keep track of the score, displaying 'you win' message when the score reaches 12, and duplicating the block sprite 11 more times to have a total of 12 blocks.", 'Programming the block sprites to disappear and add one point to the score when touched by the tennis ball, and implementing a repeating animation when the block disappears, including color change, ghost effect, size change, and rotation.', 'Utilizing if blocks and sensing category to check if the block sprites are being touched by the tennis ball, and adding a space key pressed event to re-show the block for editing purposes.']}], 'duration': 668.008, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/5KvQVKp8N5o/pics/5KvQVKp8N5o450318.jpg', 'highlights': ["Creating a game with sprite broadcasting and duplication, including a 'you win' message when the score reaches 12", 'Programming the block sprites to disappear and add one point to the score when touched by the tennis ball', "Adding a 'game over' message with an insult in an angry red font to display to the player", 'Explaining the process of creating a new sprite by painting a new one and setting the text tool to choose a nice angry red font for the insult', "Adding a variable to keep track of the score, displaying 'you win' message when the score reaches 12"]}], 'highlights': ["Creating a game with sprite broadcasting and duplication, including a 'you win' message when the score reaches 12", 'The tutorial covers creating a block-breaking game using Scratch, including paddle movement and ball bouncing', 'The paddle is programmed to follow the mouse cursor, maintaining a fixed y-coordinate at -140 and a rotation style to appear right side up', 'Programming the block sprites to disappear and add one point to the score when touched by the tennis ball', "The paddle sprite is coded to broadcast a 'bounce' message to the tennis ball when they touch, causing the ball to change direction based on the current angle of movement"]}