{"id":120,"date":"2020-10-13T10:59:05","date_gmt":"2020-10-13T02:59:05","guid":{"rendered":"http:\/\/bversion.com\/WordPress\/?p=120"},"modified":"2021-03-13T21:38:00","modified_gmt":"2021-03-13T13:38:00","slug":"space-invader","status":"publish","type":"post","link":"https:\/\/bversion.com\/WordPress\/2020\/10\/13\/space-invader\/","title":{"rendered":"Space Invader"},"content":{"rendered":"<div style=\"position:relative;height:0;padding-bottom:117.6%;overflow:hidden;\"><iframe style=\"position:absolute;top:0;left:0;width:100%;height:100%;\" src=\"https:\/\/arcade.makecode.com\/---run?id=_9az680bgWYFY\" allowfullscreen=\"allowfullscreen\" sandbox=\"allow-popups allow-forms allow-scripts allow-same-origin\" frameborder=\"0\"><\/iframe><\/div>\n\n\n<style>.wp-block-kadence-spacer.kt-block-spacer-_51c3f7-ee .kt-block-spacer{height:60px;}.wp-block-kadence-spacer.kt-block-spacer-_51c3f7-ee .kt-divider{border-top-width:1px;height:1px;border-top-color:#eee;width:80%;border-top-style:solid;}<\/style>\n<div class=\"wp-block-kadence-spacer aligncenter kt-block-spacer-_51c3f7-ee\"><div class=\"kt-block-spacer kt-block-spacer-halign-center\" style=\"height:60px\"><hr class=\"kt-divider\" style=\"border-top-color:rgba(238, 238, 238, 1);border-top-width:1px;width:80%;border-top-style:solid\"\/><\/div><\/div>\n\n\n\n<p>I created this game in 10 days when I first learnt MakeCode Arcade. This platform is really fun and easy to create a Arcade games you like, I will show you how to make this! <\/p>\n\n\n\n<p>I will buy you lunch if you can score more than 1200.. \ud83d\ude42<\/p>\n\n\n<style>.wp-block-kadence-advancedheading.kt-adv-heading_24d057-db, .wp-block-kadence-advancedheading.kt-adv-heading_24d057-db[data-kb-block=\"kb-adv-heading_24d057-db\"]{font-style:normal;}.wp-block-kadence-advancedheading.kt-adv-heading_24d057-db mark.kt-highlight, .wp-block-kadence-advancedheading.kt-adv-heading_24d057-db[data-kb-block=\"kb-adv-heading_24d057-db\"] mark.kt-highlight{font-style:normal;color:#f76a0c;-webkit-box-decoration-break:clone;box-decoration-break:clone;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.wp-block-kadence-advancedheading.kt-adv-heading_24d057-db img.kb-inline-image, .wp-block-kadence-advancedheading.kt-adv-heading_24d057-db[data-kb-block=\"kb-adv-heading_24d057-db\"] img.kb-inline-image{width:150px;vertical-align:baseline;}<\/style>\n<h2 class=\"kt-adv-heading_24d057-db wp-block-kadence-advancedheading\" data-kb-block=\"kb-adv-heading_24d057-db\">How does the program work?<\/h2>\n\n\n<style>.wp-block-kadence-advancedheading.kt-adv-heading_7dd961-46, .wp-block-kadence-advancedheading.kt-adv-heading_7dd961-46[data-kb-block=\"kb-adv-heading_7dd961-46\"]{font-style:normal;}.wp-block-kadence-advancedheading.kt-adv-heading_7dd961-46 mark.kt-highlight, .wp-block-kadence-advancedheading.kt-adv-heading_7dd961-46[data-kb-block=\"kb-adv-heading_7dd961-46\"] mark.kt-highlight{font-style:normal;color:#f76a0c;-webkit-box-decoration-break:clone;box-decoration-break:clone;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.wp-block-kadence-advancedheading.kt-adv-heading_7dd961-46 img.kb-inline-image, .wp-block-kadence-advancedheading.kt-adv-heading_7dd961-46[data-kb-block=\"kb-adv-heading_7dd961-46\"] img.kb-inline-image{width:150px;vertical-align:baseline;}<\/style>\n<h3 class=\"kt-adv-heading_7dd961-46 wp-block-kadence-advancedheading\" data-kb-block=\"kb-adv-heading_7dd961-46\">Monster Movement<\/h3>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/bversion.com\/WordPress\/wp-content\/uploads\/2021\/03\/image-1.png\" alt=\"This image has an empty alt attribute; its file name is image-1.png\" width=\"465\" height=\"818\"\/><\/figure>\n\n\n\n<p>Here is the monster movement control, I made the monster going down zig-zag. The monster moves to the right border, then go down one line and go back to the left border and go down. Repeat the movement until it touches the player or when it get shot. <\/p>\n\n\n\n<p>I made a variable to check if the monster is killed or not. If the monster is not killed, it will continue the movement. When the monster is killed or hit the player, it will spawn somewhere in line 1 to 3. <\/p>\n\n\n\n<p>I also give a point bonus, when the monster goes more downward, it will give more points to the player.<\/p>\n\n\n<style>.wp-block-kadence-advancedheading.kt-adv-heading_10317f-8a, .wp-block-kadence-advancedheading.kt-adv-heading_10317f-8a[data-kb-block=\"kb-adv-heading_10317f-8a\"]{font-style:normal;}.wp-block-kadence-advancedheading.kt-adv-heading_10317f-8a mark.kt-highlight, .wp-block-kadence-advancedheading.kt-adv-heading_10317f-8a[data-kb-block=\"kb-adv-heading_10317f-8a\"] mark.kt-highlight{font-style:normal;color:#f76a0c;-webkit-box-decoration-break:clone;box-decoration-break:clone;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.wp-block-kadence-advancedheading.kt-adv-heading_10317f-8a img.kb-inline-image, .wp-block-kadence-advancedheading.kt-adv-heading_10317f-8a[data-kb-block=\"kb-adv-heading_10317f-8a\"] img.kb-inline-image{width:150px;vertical-align:baseline;}<\/style>\n<h3 class=\"kt-adv-heading_10317f-8a wp-block-kadence-advancedheading\" data-kb-block=\"kb-adv-heading_10317f-8a\">Levels Manager<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"http:\/\/bversion.com\/WordPress\/wp-content\/uploads\/2021\/03\/image-2.png\" alt=\"This image has an empty alt attribute; its file name is image-2.png\"\/><\/figure>\n\n\n\n<p>I made levels by using different variables , so that monster have different behavior at every level. <\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>For level 2, I make the monster to shoot bullet.<\/li><li>For level 3, I make the monster become hard to hit by making it invisible and appear every step.<\/li><\/ol>\n\n\n<style>.wp-block-kadence-advancedheading.kt-adv-heading_aef0c6-25, .wp-block-kadence-advancedheading.kt-adv-heading_aef0c6-25[data-kb-block=\"kb-adv-heading_aef0c6-25\"]{font-style:normal;}.wp-block-kadence-advancedheading.kt-adv-heading_aef0c6-25 mark.kt-highlight, .wp-block-kadence-advancedheading.kt-adv-heading_aef0c6-25[data-kb-block=\"kb-adv-heading_aef0c6-25\"] mark.kt-highlight{font-style:normal;color:#f76a0c;-webkit-box-decoration-break:clone;box-decoration-break:clone;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.wp-block-kadence-advancedheading.kt-adv-heading_aef0c6-25 img.kb-inline-image, .wp-block-kadence-advancedheading.kt-adv-heading_aef0c6-25[data-kb-block=\"kb-adv-heading_aef0c6-25\"] img.kb-inline-image{width:150px;vertical-align:baseline;}<\/style>\n<h3 class=\"kt-adv-heading_aef0c6-25 wp-block-kadence-advancedheading\" data-kb-block=\"kb-adv-heading_aef0c6-25\">Level Definer<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"http:\/\/bversion.com\/WordPress\/wp-content\/uploads\/2021\/03\/image-6.png\"><img loading=\"lazy\" decoding=\"async\" width=\"516\" height=\"1024\" src=\"http:\/\/bversion.com\/WordPress\/wp-content\/uploads\/2021\/03\/image-6-516x1024.png\" alt=\"\" class=\"wp-image-677\" srcset=\"https:\/\/bversion.com\/WordPress\/wp-content\/uploads\/2021\/03\/image-6-516x1024.png 516w, https:\/\/bversion.com\/WordPress\/wp-content\/uploads\/2021\/03\/image-6-151x300.png 151w, https:\/\/bversion.com\/WordPress\/wp-content\/uploads\/2021\/03\/image-6.png 521w\" sizes=\"auto, (max-width: 516px) 100vw, 516px\" \/><\/a><\/figure>\n\n\n\n<p>For this level definer,  you need to set the variable to the number that you need for each level. For example of level 5,<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>&#8216;Kill_Target&#8217; is the number of monster you have to kill to advance to the next level<\/li><li>&#8216;monster_invisible&#8217; to tell whether the monster will be invisible or not. <\/li><li>Set &#8216;Alien&#8217; to different monster type.<\/li><li>&#8216;monster_type&#8217; is how much score you get from hit the monster.<\/li><li>&#8216;monster_delay_set&#8217; the shorter you set it the faster the monster moves.<\/li><\/ol>\n\n\n\n<p>Before calling the function &#8216;playing&#8217; to start the level manager,  I also have to turn on the monster stay in screen or else it will bug the game and you will never see the monster.<\/p>\n\n\n\n<p>I also reserved a function to change the background for each level, but I am too lazy to create the background and keep them all the same&#8230; XD<\/p>\n\n\n<style>.wp-block-kadence-advancedheading.kt-adv-heading_3f8b88-59, .wp-block-kadence-advancedheading.kt-adv-heading_3f8b88-59[data-kb-block=\"kb-adv-heading_3f8b88-59\"]{font-style:normal;}.wp-block-kadence-advancedheading.kt-adv-heading_3f8b88-59 mark.kt-highlight, .wp-block-kadence-advancedheading.kt-adv-heading_3f8b88-59[data-kb-block=\"kb-adv-heading_3f8b88-59\"] mark.kt-highlight{font-style:normal;color:#f76a0c;-webkit-box-decoration-break:clone;box-decoration-break:clone;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.wp-block-kadence-advancedheading.kt-adv-heading_3f8b88-59 img.kb-inline-image, .wp-block-kadence-advancedheading.kt-adv-heading_3f8b88-59[data-kb-block=\"kb-adv-heading_3f8b88-59\"] img.kb-inline-image{width:150px;vertical-align:baseline;}<\/style>\n<h3 class=\"kt-adv-heading_3f8b88-59 wp-block-kadence-advancedheading\" data-kb-block=\"kb-adv-heading_3f8b88-59\">Point System<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"http:\/\/bversion.com\/WordPress\/wp-content\/uploads\/2021\/03\/image-4.png\" alt=\"This image has an empty alt attribute; its file name is image-4.png\"\/><\/figure>\n\n\n\n<p>When press &#8216;A&#8217; button, the spaceship will shoot a bullet up, i.e. -y is upside. If the bullet hits the monster, it will add points according to the &#8216;monster_type&#8217; I defined in level definer as well as how low the monster go down. Then, make the variable &#8216;killed&#8217; to one so that the function will do the monster reset in the level manager.<\/p>\n\n\n<style>.wp-block-kadence-advancedheading.kt-adv-heading_12e38e-66, .wp-block-kadence-advancedheading.kt-adv-heading_12e38e-66[data-kb-block=\"kb-adv-heading_12e38e-66\"]{font-style:normal;}.wp-block-kadence-advancedheading.kt-adv-heading_12e38e-66 mark.kt-highlight, .wp-block-kadence-advancedheading.kt-adv-heading_12e38e-66[data-kb-block=\"kb-adv-heading_12e38e-66\"] mark.kt-highlight{font-style:normal;color:#f76a0c;-webkit-box-decoration-break:clone;box-decoration-break:clone;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.wp-block-kadence-advancedheading.kt-adv-heading_12e38e-66 img.kb-inline-image, .wp-block-kadence-advancedheading.kt-adv-heading_12e38e-66[data-kb-block=\"kb-adv-heading_12e38e-66\"] img.kb-inline-image{width:150px;vertical-align:baseline;}<\/style>\n<h3 class=\"kt-adv-heading_12e38e-66 wp-block-kadence-advancedheading\" data-kb-block=\"kb-adv-heading_12e38e-66\">Attacked by Monster!<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"http:\/\/bversion.com\/WordPress\/wp-content\/uploads\/2021\/03\/image-5.png\" alt=\"This image has an empty alt attribute; its file name is image-5.png\"\/><\/figure>\n\n\n\n<p>When the monster&#8217;s bullet hit the spaceship, you will minus a life. Then, will destroy the bullet, so that it will not double hit the spaceship.<\/p>\n\n\n\n<p>When the monster hit the spaceship  you will also minus a life and this time the monster will go back to the top at line 1-3. If it is level 8, the monster will go back at once, so that it will not double hit the spaceship. <\/p>\n\n\n\n<p>If you got hit by the monster or shot by it 3 times you will game over.                     <\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/makecode.com\/_E8tX3WDXKRHk\" target=\"_blank\">Click here to see my code~<\/a><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Space Invader Remark - MakeCode Arcade\" width=\"604\" height=\"340\" src=\"https:\/\/www.youtube.com\/embed\/DDkgX_2fuVw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><figcaption>My game play but below 1200&#8230; XD<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>I created this game in 10 days when I first learnt MakeCode Arcade. This platform is really fun and easy to create a Arcade games you like, I will show you how to make this! I will buy you lunch if you can score more than 1200.. \ud83d\ude42 How does the program work? Monster Movement &hellip; <a href=\"https:\/\/bversion.com\/WordPress\/2020\/10\/13\/space-invader\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Space Invader<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":688,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"cybocfi_hide_featured_image":"yes","footnotes":""},"categories":[12,7],"tags":[],"class_list":["post-120","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-features","category-makecode_scratch"],"_links":{"self":[{"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/posts\/120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/comments?post=120"}],"version-history":[{"count":15,"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/posts\/120\/revisions"}],"predecessor-version":[{"id":785,"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/posts\/120\/revisions\/785"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/media\/688"}],"wp:attachment":[{"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/media?parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/categories?post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/tags?post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}