{"id":137,"date":"2021-05-10T00:35:16","date_gmt":"2021-05-10T00:35:16","guid":{"rendered":"https:\/\/msc-ai.knipmeyer.co.uk\/?p=137"},"modified":"2021-05-10T00:36:23","modified_gmt":"2021-05-10T00:36:23","slug":"spawning-cubes-and-hero-health","status":"publish","type":"post","link":"http:\/\/msc-ai.knipmeyer.co.uk\/index.php\/2021\/05\/10\/spawning-cubes-and-hero-health\/","title":{"rendered":"Spawning cubes and Hero Health"},"content":{"rendered":"\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=\"ICE-4732 - AI &amp; Game Design - Dragon game - Spawn and health\" width=\"584\" height=\"329\" src=\"https:\/\/www.youtube.com\/embed\/kv_95t8n5I4?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><\/figure>\n\n\n\n<p class=\"has-text-align-center\">Our hero now has health (albeit as a text value) and random spawning Gelatinous Cube&#8217;s!<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"370\" height=\"378\" src=\"https:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-41.png\" alt=\"\" class=\"wp-image-138\" srcset=\"http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-41.png 370w, http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-41-294x300.png 294w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><figcaption>Gelantious Cube monsters<\/figcaption><\/figure>\n\n\n\n<p>The Gelantious Cube cannot be attacked with normal weapons, it just consumes them. The only way to defat a gelantious cube is that it will smear our hero, reducing his health ! As the cubes are randomly spwaning the are a dangerous collective ! The cubes, unlike the monsters, do not follow a path, they move randomly square to square, so our hero stands a chance of avoiding them by quick movements !<\/p>\n\n\n\n<p>Snippets of the relevant cube creation, movement and consume are given below, as is the food and drink routines to increase health, please note this is almost pseudo code as they are not within their procedures.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>;; if we encounter a cube, we cannot defeat it, only reduce our health by 5  \nif any? cubes-here\n  &#91; set health health - 5\n    ask cubes-here &#91; die ] ]\n;;\n;;\n;; cubes moving on a random-path\nto move-cube ;; observer procedure for cube\n  ask cubes\n  &#91; ;if cube-eaten?\n    choose-heading\n    fd 1\n  ]\nend\n;; cube spawn routine, the coundown value reduces or increases the number of cubes being generated\nto make-cube ;;\n  ifelse next-cube-in = 0\n  &#91; set next-cube-in 3 ]\n  &#91; let cube-patch one-of patches with &#91;treasures-grid? and\n                                                not any? bonuses-here and\n                                                not any? treasures-here]\n    if cube-patch != nobody\n    &#91; ask cube-patch\n      &#91; sprout-cubes 1\n        &#91; set shape \"square\"\n          set heading 0\n          set color one-of base-colors\n          set value (random 10 + 1) * 100\n          set cube-countdown random 200 + 50 ] ]\n      set next-cube-in 10 + random 1 ] ]\nend\n;;\n;; food and drink\n  ;; food\n  if any? foods-here\n  &#91; set health health + 9 \n    ask foods-here &#91; die ]\n  ]\n  ;; drink\n  if any? drinks-here\n  &#91; set health health + 5\n    ask drinks-here &#91; die ]\n  ]\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Our hero now has health (albeit as a text value) and random spawning Gelatinous Cube&#8217;s! The Gelantious Cube cannot be attacked with normal weapons, it just consumes them. The only way to defat a gelantious cube is that it will &hellip; <a href=\"http:\/\/msc-ai.knipmeyer.co.uk\/index.php\/2021\/05\/10\/spawning-cubes-and-hero-health\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-137","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/msc-ai.knipmeyer.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/msc-ai.knipmeyer.co.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/msc-ai.knipmeyer.co.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/msc-ai.knipmeyer.co.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/msc-ai.knipmeyer.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=137"}],"version-history":[{"count":3,"href":"http:\/\/msc-ai.knipmeyer.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/137\/revisions"}],"predecessor-version":[{"id":141,"href":"http:\/\/msc-ai.knipmeyer.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/137\/revisions\/141"}],"wp:attachment":[{"href":"http:\/\/msc-ai.knipmeyer.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/msc-ai.knipmeyer.co.uk\/index.php\/wp-json\/wp\/v2\/categories?post=137"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/msc-ai.knipmeyer.co.uk\/index.php\/wp-json\/wp\/v2\/tags?post=137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}