{"id":94,"date":"2021-05-06T04:25:09","date_gmt":"2021-05-06T04:25:09","guid":{"rendered":"https:\/\/msc-ai.knipmeyer.co.uk\/?p=94"},"modified":"2021-05-06T04:51:28","modified_gmt":"2021-05-06T04:51:28","slug":"updating-the-maze-designer","status":"publish","type":"post","link":"http:\/\/msc-ai.knipmeyer.co.uk\/index.php\/2021\/05\/06\/updating-the-maze-designer\/","title":{"rendered":"Updating the Maze-Designer"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Starting with the pac-man maze designer, i added new buttons and updated the existing code to use hero, monsters and treasure.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"653\" src=\"https:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-22-1024x653.png\" alt=\"\" class=\"wp-image-95\" srcset=\"http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-22-1024x653.png 1024w, http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-22-300x191.png 300w, http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-22-768x490.png 768w, http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-22-470x300.png 470w, http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-22.png 1502w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>New Buttons Added, Doors, Keys, Food &amp; Drink ; Hero and Monsters changed<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Creating the code for the button calls on the function values supplied in the button i.e.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"610\" src=\"https:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-23.png\" alt=\"\" class=\"wp-image-96\" srcset=\"http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-23.png 806w, http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-23-300x227.png 300w, http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-23-768x581.png 768w, http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-23-396x300.png 396w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><figcaption>Set tool value based on the button<\/figcaption><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>    ;; Green Door\n    if tool = \"Draw Green Door\"\n    &#91; draw-boundary green ]\n    ;; Red Door\n    if tool = \"Draw Red Door\"\n    &#91; draw-boundary red ]\n    if tool = \"Draw Yellow Door\"\n    &#91; draw-boundary yellow ]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Which when applied creates the required doors<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"914\" src=\"https:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-24.png\" alt=\"\" class=\"wp-image-97\" srcset=\"http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-24.png 900w, http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-24-295x300.png 295w, http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-24-768x780.png 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><figcaption>Different coloured doors which will only be accessible when holding the correct keys<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The next step was to create the key. As there was no key graphic, the netlogo shap editor was used to create one.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"957\" src=\"https:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-25-1024x957.png\" alt=\"\" class=\"wp-image-98\" srcset=\"http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-25-1024x957.png 1024w, http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-25-300x280.png 300w, http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-25-768x718.png 768w, http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-25-321x300.png 321w, http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-25.png 1248w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>green key creation<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Then the code to support the  creation and placement <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>breed       &#91; green-keys green-key ]\n;;\n    create-green-keys 1\n    &#91;\n      set color green\n      set shape \"green key\"\n      setxy 10 10\n    ]\n;;\nto place-greenkey\n  ifelse &#91;pcolor] of patch round mouse-xcor mouse-ycor != black\n  &#91; user-message \"You must place the key on a corridor space, not a wall or a gate.\" ]\n  &#91;\n    ask green-keys\n    &#91; setxy (round mouse-xcor) (round mouse-ycor) ]\n  ]\nend\n\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When setting up the new level, the green key is now available to place.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"912\" height=\"906\" src=\"https:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-27.png\" alt=\"\" class=\"wp-image-101\" srcset=\"http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-27.png 912w, http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-27-300x298.png 300w, http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-27-150x150.png 150w, http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-27-768x763.png 768w, http:\/\/msc-ai.knipmeyer.co.uk\/wp-content\/uploads\/2021\/05\/image-27-302x300.png 302w\" sizes=\"auto, (max-width: 912px) 100vw, 912px\" \/><figcaption>doors and keys created<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In the actual game i will now be able to have a register for &#8216;keys&#8217; and when the hero encounters the key, take it and be able to pass the green door.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Starting with the pac-man maze designer, i added new buttons and updated the existing code to use hero, monsters and treasure. Creating the code for the button calls on the function values supplied in the button i.e. Which when applied &hellip; <a href=\"http:\/\/msc-ai.knipmeyer.co.uk\/index.php\/2021\/05\/06\/updating-the-maze-designer\/\">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-94","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\/94","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=94"}],"version-history":[{"count":2,"href":"http:\/\/msc-ai.knipmeyer.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/94\/revisions"}],"predecessor-version":[{"id":102,"href":"http:\/\/msc-ai.knipmeyer.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/94\/revisions\/102"}],"wp:attachment":[{"href":"http:\/\/msc-ai.knipmeyer.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/msc-ai.knipmeyer.co.uk\/index.php\/wp-json\/wp\/v2\/categories?post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/msc-ai.knipmeyer.co.uk\/index.php\/wp-json\/wp\/v2\/tags?post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}