{"id":43309,"date":"2023-09-14T14:24:34","date_gmt":"2023-09-14T14:24:34","guid":{"rendered":"https:\/\/mp.moonpreneur.com\/blog\/?p=43309"},"modified":"2024-09-25T04:46:07","modified_gmt":"2024-09-25T04:46:07","slug":"creating-game-in-10-minutes-with-scratch","status":"publish","type":"post","link":"https:\/\/mp.moonpreneur.com\/blog\/creating-game-in-10-minutes-with-scratch\/","title":{"rendered":"Creating a Game in 10 Minutes with Scratch! | Quick Game Development Tutorial"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"43309\" class=\"elementor elementor-43309\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<div class=\"elementor-inner\">\n\t\t\t\t<div class=\"elementor-section-wrap\">\n\t\t\t\t\t\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-02860dd elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"02860dd\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-0e242d5\" data-id=\"0e242d5\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-44b271c elementor-widget elementor-widget-text-editor\" data-id=\"44b271c\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p><span style=\"font-weight: 400;\">If you want to try your hands at making <a href=\"https:\/\/mp.moonpreneur.com\/blog\/tic-tac-toe-game-in-scratch\/\">games,<\/a> we have got you covered. We&#8217;ll be attempting to make a game in ten minutes with Scratch. So let&#8217;s get right into it.\u00a0<\/span><\/p><p><span style=\"font-weight: 400;\">First, we need to go to Scratch, click Start, and then click Create. Quickly rename it to 10 Minutes Game and then delete the scratch cat. Draw something like a square with some eyes and a little smile. The small one doesn&#8217;t look perfect, but it&#8217;s fine.<\/span><\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b8fb419 elementor-widget elementor-widget-video\" data-id=\"b8fb419\" data-element_type=\"widget\" data-settings=\"{&quot;youtube_url&quot;:&quot;https:\\\/\\\/youtu.be\\\/5963F94WJkk?si=9rhw3Oc3it_zDHOd&quot;,&quot;video_type&quot;:&quot;youtube&quot;,&quot;controls&quot;:&quot;yes&quot;}\" data-widget_type=\"video.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-wrapper elementor-open-inline\">\n\t\t\t<div class=\"elementor-video\"><\/div>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-77e6e0f elementor-widget elementor-widget-text-editor\" data-id=\"77e6e0f\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p><span style=\"font-weight: 400;\">Now, we will change the size to 30, duplicate it, and make an enemy. So we&#8217;ll make the Enemy red. Flip this and make it mad.\u00a0<\/span><\/p><p><span style=\"font-weight: 400;\">We need a weapon now, and it will be simple, just like that. We&#8217;ve got a functioning weapon, and let&#8217;s scale it down to 50; it&#8217;s pretty good. And for the weapon to work, we have to put it over here. Now we&#8217;re going to duplicate this and create the bullet, and it will be red, so let&#8217;s delete that. Now, let&#8217;s quickly make the player move.<\/span><\/p><p><span style=\"font-weight: 400;\">One click, and then we will change X and Y. Now we have two key presses: one key right arrow, and one key left arrow, which is for the X and Y, respectively. We can duplicate the same thing but change it to up and down. And just like that, we&#8217;ve got a simple player movement.<\/span><\/p><p><span style=\"font-weight: 400;\">Now, we have to bring this weapon to the player&#8217;s position. So, it will go to Sprite1, and guess what? It&#8217;s going to be a mouse pointer. Please don&#8217;t make it near; make it to the side.\u00a0<\/span><span style=\"font-weight: 400;\">Now we have to code the enemies. On clicking, we will hide because we don&#8217;t need the original Sprite. So, every second, we can create a clone of ourselves. When we start as a clone, we need to glide for 2 seconds to a random position.<\/span><\/p><p><span style=\"font-weight: 400;\">We have to show, and first, let&#8217;s go to X -250 and then Y random 180 to -180, and this would be one-for-one side of the screen, so we have to duplicate it. Go to X 250, and now let&#8217;s code it. So we&#8217;re going to put these two in here. Go to Equals. Equals is 1; pick random 1 to 2. <\/span><span style=\"font-weight: 400;\">After this, we&#8217;re just going to delete this. But I&#8217;m just going to do 1.5 seconds. It&#8217;s time to start as a clone pointing toward the mouse pointer and go to Sprite1 because it&#8217;s the same. So we&#8217;ll go to Sprite1. And these two, we&#8217;ll bring them to the front, and let&#8217;s make a score variable.<\/span><\/p><p><span style=\"font-weight: 400;\">Okay, if Forever is touching the edge or an enemy, delete this clone. And now, back to the Enemy. So when we start as a clone forever after touching Sprite4, we should delete this clone and then change the score by one, and we&#8217;ll set the score to zero at the beginning.<\/span><\/p><p><span style=\"font-weight: 400;\">Okay, it looks like it&#8217;s not working. I just remembered that we need to start this. So when we select, we&#8217;re just going to hide forever. If the mouse is down, we will create a clone of ourselves. <\/span><span style=\"font-weight: 400;\">But there has to be a slight delay. So we have to wait 0.1 seconds. Now let&#8217;s see what happens. Okay, it&#8217;s still not working because we forgot to move it. So repeat until touching the edge or touching the Enemy. Move 10 steps, and then delete this clone after this.<\/span><\/p><p><span style=\"font-weight: 400;\">Okay, so it&#8217;s not working exactly as we imagined. If we point toward Sprite3, we have yet to learn why it&#8217;s not working. It&#8217;s like going in the opposite direction. Point towards is again the mouse-pointer. Our mouse pointer is over there, but it&#8217;s going another way for no reason. Then, &#8220;point in direction 90,&#8221; and let&#8217;s see if that makes a difference. <\/span><span style=\"font-weight: 400;\">No, it&#8217;s still the same &#8220;point in direction 90&#8221;. Sprite3. Let&#8217;s see if that makes a difference. It&#8217;s working. Let&#8217;s go.<\/span><\/p><p><span style=\"font-weight: 400;\">Okay, we have our game here, and we&#8217;re just spamming and killing all the enemies. But we can&#8217;t die. So let&#8217;s make a quick game over screen. Put this in the middle, and then click forever. When clicked, we&#8217;re going to hide. And when we receive message 1, we&#8217;re going to show. And let&#8217;s do this to detect if it&#8217;s touching the Enemy.<\/span><\/p><p><span style=\"font-weight: 400;\">Okay, it&#8217;s working. It&#8217;s working. Oh, we died. Okay, we died again. And let&#8217;s go. We&#8217;ve got a working game in under ten minutes. Of course, it could be better, but as you can see, it was only ten minutes. So, we had to make some adjustments. <\/span><span style=\"font-weight: 400;\"><a href=\"https:\/\/mp.moonpreneur.com\/blog\/scratch-hacks-for-kids\/\">Scratch<\/a> is a great tool for anyone who wants to learn how to program, and making games is a fun way to practice your skills.<\/span><\/p><p><span style=\"font-weight: 400;\">Moonpreneur is on a mission to disrupt traditional education and future-proof the next generation with holistic learning solutions. Its <\/span><a href=\"https:\/\/moonpreneur.com\/home\/book-a-free-trial\/\"><span style=\"font-weight: 400;\">Innovator Program<\/span><\/a><span style=\"font-weight: 400;\"> is building tomorrow&#8217;s workforce by training students in AI\/ML, <\/span><a href=\"https:\/\/moonpreneur.com\/innovator-program\/robotics\/\"><span style=\"font-weight: 400;\">Robotics<\/span><\/a><span style=\"font-weight: 400;\">, Coding, IoT, and Apps, enabling entrepreneurship through experiential learning.<\/span><\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>If you want to try your hands at making games, we have got you covered. We&#8217;ll be attempting to make a game in ten minutes with Scratch. So let&#8217;s get right into it.\u00a0 First, we need to go to Scratch, click Start, and then click Create. Quickly rename it to 10 Minutes Game and then [&hellip;]<\/p>\n","protected":false},"author":116,"featured_media":43348,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false},"categories":[937,971],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/mp.moonpreneur.com\/blog\/wp-json\/wp\/v2\/posts\/43309"}],"collection":[{"href":"https:\/\/mp.moonpreneur.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mp.moonpreneur.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mp.moonpreneur.com\/blog\/wp-json\/wp\/v2\/users\/116"}],"replies":[{"embeddable":true,"href":"https:\/\/mp.moonpreneur.com\/blog\/wp-json\/wp\/v2\/comments?post=43309"}],"version-history":[{"count":0,"href":"https:\/\/mp.moonpreneur.com\/blog\/wp-json\/wp\/v2\/posts\/43309\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mp.moonpreneur.com\/blog\/wp-json\/wp\/v2\/media\/43348"}],"wp:attachment":[{"href":"https:\/\/mp.moonpreneur.com\/blog\/wp-json\/wp\/v2\/media?parent=43309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mp.moonpreneur.com\/blog\/wp-json\/wp\/v2\/categories?post=43309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mp.moonpreneur.com\/blog\/wp-json\/wp\/v2\/tags?post=43309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}