[{"element_type":"image_url","content":"https://upload.wikimedia.org/wikipedia/commons/thumb/2/2e/Utopia.ortelius.jpg/800px-Utopia.ortelius.jpg","metadata":{"alt":"Abraham","caption":"Abraham Ortelius' map of Utopia "}},{"element_type":"text","content":"\n        \u003cp\u003eThis project is my first draft of being able to squeeze an adventure world into the NeoTrinkey. Here's a link to the project \u003ca title=\"Adventure Engine repository\" href=\"https://github.com/mrklingon/Adventure-Engine\" target=\"_blank\"\u003erepository\u003c/a\u003e. The code lets you build a map in a text file that defines a space to navigate. \u003cstrong\u003eNOTE\u003c/strong\u003e: the initial load of the repository had the wrong version of intput.py - the correct version is now in the repository.\u003c/p\u003e\n\u003ch1 class=\"heading-element\"\u003eAdventure-Engine\u003c/h1\u003e\n\u003cp\u003e\u003ca id=\"user-content-adventure-engine\" class=\"anchor\" href=\"https://github.com/mrklingon/Adventure-Engine#adventure-engine\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eNeoTrinkey code for simple adventure gaming\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eintput.py - pass a string \"choices\" to intpt(choices) and return one of the letters to calling routine. eg intpt(\"nsew\") and you'll get back n,s,e,or w. This can be navigation.\u003c/li\u003e\n\u003cli\u003ewise.py - choose a line from a text file. This file will be a linear list of an AxA array. Program will be used for description of current location\u003c/li\u003e\n\u003cli\u003eadvent.py - (code.py when running). Tracks user location in AxA array, calls wise.py to find and print location, then offers chance to move to N,S,E,W direction and retrieves choice from intpt(), calculates new location and prints it.\u003c/li\u003e\n\u003cli\u003eprt.py - allows printing to REPL or via HID as typed output.\u003c/li\u003e\n\u003cli\u003eship.adv - sample map for a 3x3 ship\u003c/li\u003e\n\u003cli\u003emagic.adv - sample map for a 5x5 magical realm. WRAP should be set to True, and radius to 5.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eCode is a framework for having the NeoTrinkey navigate a space - dungeon, forest, spaceship.\u003c/p\u003e\n\u003cp\u003eSet map=[file name] of list of room descriptions\u003cbr\u003eset radius=X where X is the size of the matrix. 3x3 or 5x5 for example\u003cbr\u003eset px and py to starting room. eg. for a 3x3 map px=1 py=1 will set the start in the center of the map\u003cbr\u003eset WRAP = True for the map being a torus, and False for the map having edges you can't go beyond.\u003cbr\u003esample map \"ship.adv\" defines a 3x3 map:\u003c/p\u003e\n\u003cpre class=\"notranslate\"\u003e\u003ccode\u003ecommunications bay|e\ncockpit|wse\ncomputer and navigation bay|w\nsleeping quarters|e\nwardroom\ngalley|w\nstorage|e\nengines|new\npower resources|w\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003e\u003cstrong\u003eNote\u003c/strong\u003e\u003cspan\u003e\u0026nbsp;\u003c/span\u003esome lines end with a \"|\" plus directions that can be followed from the room. If the room ends with \"|e\" for example, you can only leave to the East. If the line ends with no |+direction(s) the default is you can leave NSEW. (for example, the wardroom in this case).\u003c/p\u003e\n\u003cp\u003eThe map below shows the rooms for ship.adv, and the gaps in the walls show which directions you can go. Only the wardroom allows passage in all four directions, NSEW.\u003c/p\u003e\n      ","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/550/original/shipmap.png?1737687716","metadata":{"caption":"Example map"}},{"element_type":"image_url","content":"","metadata":{"alt":"","caption":""}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n        \u003cp\u003eWhen running, you are given \"Current location:\" and then offered the directions you can go. Touching pad #1 toggles between choices, touching pad #2 chooses the current one.\u003cbr\u003eFor example:\u003c/p\u003e\n\u003cpre class=\"notranslate\"\u003e\u003ccode\u003eCurrent location: wardroom\n\nNext action? nsew?\nn!\nCurrent location: cockpit\nNext action? wse\n?\nw!\ns!\nCurrent location: wardroom\n\nNext action? nsew?\nn!\ns!\nCurrent location: engines\nNext action? new\n?\nn!\ne!\nCurrent location: power resources\nNext action? w\n?\nw!\n\u003c/code\u003e\u003c/pre\u003e\n\u003chr\u003e\n\u003cp\u003e\u003cspan\u003e# Magic Adventure Map\u003c/span\u003e\u003c/p\u003e\n\u003cp\u003eHere's another map, that is defined in the repository file \"magic.adv\"\u003c/p\u003e\n      \n\n\n\n\n","metadata":{}},{"element_type":"image_url","content":"https://private-user-images.githubusercontent.com/5720926/406270738-601c501b-368a-430c-a3b1-4908c6cbea0a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzc2ODQyNjksIm5iZiI6MTczNzY4Mzk2OSwicGF0aCI6Ii81NzIwOTI2LzQwNjI3MDczOC02MDFjNTAxYi0zNjhhLTQzMGMtYTNiMS00OTA4YzZjYmVhMGEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDEyNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAxMjRUMDE1OTI5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDAwNTMzYzZjM2ViZDkyZjBhNzYzNjhkNTU3Y2E4YTAxZjFjYjAwMjQ2ZDA5MTQzZjE4OTMzODllZWQ5MWFmZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.TQc4gcMGNebcmZ_CPwJ1Y68dRltRALh0Cb6-51zvLwM","metadata":{"alt":"Fantasy","caption":"Fantasy map for Adventure Engine"}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/551/original/fantasymap.png?1737687779","metadata":{"caption":""}},{"element_type":"text","content":"\n  \n  \n  \n        \u003cp\u003eTo use this map, change map= to\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003cstrong\u003emap=\"magic.adv\"\u003c/strong\u003e,\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003cstrong\u003eradius=5\u003c/strong\u003e\u003cspan\u003e\u0026nbsp;\u003c/span\u003eand\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003cstrong\u003eWRAP=True\u003c/strong\u003e\u003cbr\u003eTurning on WRAP means from some rooms you can go from one edge of the map to the far side. The gaps in the map indicate the directions from each cell that are available.\u003cbr\u003e\u003cstrong\u003enote\u003c/strong\u003e\u003cspan\u003e\u0026nbsp;\u003c/span\u003eThe \"tower\" room can be exited going 'south'... but NOT entered from the south going north.\u003c/p\u003e\n\u003cp\u003eHere's a sample run:\u003c/p\u003e\n\u003cpre class=\"notranslate\"\u003e\u003ccode\u003eCurrent location: Forest south of dungeon\nNext action? ew\n?\ne!\nCurrent location: Road to castle\n\nNext action? nsew?\nn!\ns!\nCurrent location: Bridge over river\nNext action? ns\n?\nn!\ns!\nCurrent location: Road to castle\n\nNext action? nsew?\nn!\ns!\ne!\nw!\nCurrent location: Forest bank\n\nNext action? nsew?\nn!\ns!\nCurrent location: Wilds\nNext action? nwe\n?\nn!\nw!\ne!\nCurrent location: Road to castle\nNext action? wne\n?\nw!\nn!\ne!\nCurrent location: Wizard's Garden\nNext action? wne\n?\nw!\nn!\ne!\nCurrent location: Wizard's hut\n\nNext action? nsew?\nn!\ns!\nCurrent location: Forest\n\nNext action? nsew?\nn!\ns!\ne!\nw!\nCurrent location: Castle tower looming over kingdom\nNext action? wse\n?\nw!\nCurrent location: Castle\nNext action? ews\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eAt present the Adventure Engine lets you define and navigate a mapped space. Next steps involve adding appropriate command codes for game-actions and a dispatcher to handle non-movement choices.\u003c/p\u003e\n      \n\n\n","metadata":{}}]