{ "patcher" : { "fileversion" : 1, "appversion" : { "major" : 7, "minor" : 0, "revision" : 1, "architecture" : "x86", "modernui" : 1 } , "rect" : [ 228.0, 129.0, 854.0, 595.0 ], "bgcolor" : [ 0.721569, 0.737255, 0.85098, 1.0 ], "editing_bgcolor" : [ 0.721569, 0.737255, 0.85098, 1.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, "default_fontface" : 0, "default_fontname" : "Arial", "gridonopen" : 1, "gridsize" : [ 15.0, 15.0 ], "gridsnaponopen" : 1, "objectsnaponopen" : 1, "statusbarvisible" : 2, "toolbarvisible" : 1, "lefttoolbarpinned" : 0, "toptoolbarpinned" : 0, "righttoolbarpinned" : 0, "bottomtoolbarpinned" : 0, "toolbars_unpinned_last_save" : 0, "tallnewobj" : 0, "boxanimatetime" : 200, "enablehscroll" : 1, "enablevscroll" : 1, "devicewidth" : 0.0, "description" : "", "digest" : "", "tags" : "", "style" : "", "subpatcher_template" : "IceCubeTray", "boxes" : [ { "box" : { "id" : "obj-46", "maxclass" : "button", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "bang" ], "patching_rect" : [ 390.5, 90.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-44", "linecount" : 4, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 475.0, 285.0, 303.0, 60.0 ], "style" : "", "text" : "Note that we use the cold inlets of int objects to store each of the possible directions. When an int is banged, it sends its value back to the coll object to initiate a move in that direction." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-42", "linecount" : 7, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 580.5, 175.0, 201.0, 100.0 ], "style" : "", "text" : "Each row in the collection contains the location number and name, and the numbers of the locations to the North, East, South and West respectively. If you can't go in a particular direction, the current location number is listed." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-40", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 32.0, 525.0, 248.0, 33.0 ], "style" : "", "text" : "Make sure to view this patch in presentation mode, too." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-37", "linecount" : 5, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 580.5, 90.0, 194.5, 74.0 ], "style" : "", "text" : "When the patch is first loaded, we clear a coll object, store all of the navigation information, then set the user position to the first location, the Study." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-35", "linecount" : 4, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 32.0, 223.0, 248.0, 60.0 ], "style" : "", "text" : "The textbutton objects allow us to create a simple user interface. Send and receive objects keep our patch clean and easy to understand." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-32", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 32.0, 90.0, 254.0, 33.0 ], "style" : "", "text" : "As an example, we will use the Manor House setting from the popular boardgame Clue." } } , { "box" : { "fontsize" : 16.0, "id" : "obj-30", "legacytextcolor" : 1, "maxclass" : "textbutton", "numinlets" : 1, "numoutlets" : 3, "outlettype" : [ "", "", "int" ], "parameter_enable" : 0, "patching_rect" : [ 205.0, 375.0, 75.0, 30.0 ], "presentation" : 1, "presentation_rect" : [ 627.0, 285.0, 75.0, 40.0 ], "style" : "", "text" : "East", "usebgoncolor" : 1, "usetextovercolor" : 1 } } , { "box" : { "fontsize" : 16.0, "id" : "obj-28", "legacytextcolor" : 1, "maxclass" : "textbutton", "numinlets" : 1, "numoutlets" : 3, "outlettype" : [ "", "", "int" ], "parameter_enable" : 0, "patching_rect" : [ 55.0, 375.0, 75.0, 30.0 ], "presentation" : 1, "presentation_rect" : [ 135.0, 285.0, 75.0, 40.0 ], "style" : "", "text" : "West", "usebgoncolor" : 1, "usetextovercolor" : 1 } } , { "box" : { "fontsize" : 16.0, "id" : "obj-27", "legacytextcolor" : 1, "maxclass" : "textbutton", "numinlets" : 1, "numoutlets" : 3, "outlettype" : [ "", "", "int" ], "parameter_enable" : 0, "patching_rect" : [ 130.0, 448.0, 75.0, 30.0 ], "presentation" : 1, "presentation_rect" : [ 385.0, 348.0, 75.0, 45.0 ], "style" : "", "text" : "South", "usebgoncolor" : 1, "usetextovercolor" : 1 } } , { "box" : { "fontsize" : 16.0, "id" : "obj-26", "legacytextcolor" : 1, "maxclass" : "textbutton", "numinlets" : 1, "numoutlets" : 3, "outlettype" : [ "", "", "int" ], "parameter_enable" : 0, "patching_rect" : [ 130.0, 302.0, 75.0, 30.0 ], "presentation" : 1, "presentation_rect" : [ 385.0, 210.0, 75.0, 45.0 ], "style" : "", "text" : "North", "usebgoncolor" : 1, "usetextovercolor" : 1 } } , { "box" : { "fontname" : "Arial", "fontsize" : 30.0, "id" : "obj-25", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 308.0, 525.0, 407.0, 40.0 ], "presentation" : 1, "presentation_rect" : [ 225.0, 285.0, 387.0, 40.0 ], "style" : "", "text" : "You are in the Study" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-23", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 3, "outlettype" : [ "int", "bang", "clear" ], "patching_rect" : [ 313.0, 119.0, 94.0, 22.0 ], "style" : "", "text" : "trigger 1 b clear" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-22", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "bang" ], "patching_rect" : [ 313.0, 90.0, 60.0, 22.0 ], "style" : "", "text" : "loadbang" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-21", "maxclass" : "newobj", "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 617.0, 405.0, 77.0, 22.0 ], "style" : "", "text" : "receive west" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-18", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 55.0, 422.0, 65.0, 22.0 ], "style" : "", "text" : "send west" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-17", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 617.0, 468.0, 58.0, 22.0 ], "style" : "", "text" : "send coll" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-16", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 525.5, 468.0, 58.0, 22.0 ], "style" : "", "text" : "send coll" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-15", "maxclass" : "newobj", "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 525.5, 405.0, 82.0, 22.0 ], "style" : "", "text" : "receive south" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-14", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 130.0, 497.0, 69.0, 22.0 ], "style" : "", "text" : "send south" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-13", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 436.0, 468.0, 58.0, 22.0 ], "style" : "", "text" : "send coll" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-12", "maxclass" : "newobj", "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 313.0, 270.0, 71.0, 22.0 ], "style" : "", "text" : "receive coll" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-11", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 343.0, 468.0, 58.0, 22.0 ], "style" : "", "text" : "send coll" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-10", "maxclass" : "newobj", "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 436.0, 405.0, 75.0, 22.0 ], "style" : "", "text" : "receive east" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-8", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 205.0, 422.0, 63.0, 22.0 ], "style" : "", "text" : "send east" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-1", "maxclass" : "newobj", "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 343.0, 405.0, 80.0, 22.0 ], "style" : "", "text" : "receive north" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-4", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 130.0, 346.5, 67.0, 22.0 ], "style" : "", "text" : "send north" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-95", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 308.0, 500.0, 151.0, 22.0 ], "style" : "", "text" : "prepend set You are in the" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-89", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 617.0, 435.0, 32.5, 22.0 ], "style" : "", "text" : "int" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-88", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 525.5, 435.0, 32.5, 22.0 ], "style" : "", "text" : "int" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-87", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 436.0, 435.0, 32.5, 22.0 ], "style" : "", "text" : "int" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-86", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 343.0, 436.0, 32.5, 22.0 ], "style" : "", "text" : "int" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-38", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 5, "outlettype" : [ "", "int", "int", "int", "int" ], "patching_rect" : [ 343.0, 347.0, 115.0, 22.0 ], "style" : "", "text" : "unpack sym 0 0 0 0" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-9", "linecount" : 6, "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 350.5, 150.0, 199.5, 89.0 ], "style" : "", "text" : "1 Study 1 2 4 1, 2 Hall 2 3 2 1, 3 Lounge 3 3 6 2, 4 Library 1 4 5 4, 5 \"Billiard Room\" 4 6 7 5, 6 \"Dining Room\" 3 6 9 5, 7 Conservatory 5 8 7 7, 8 Ballroom 8 9 8 7, 9 Kitchen 6 9 9 8" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-5", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 4, "outlettype" : [ "", "", "", "" ], "patching_rect" : [ 343.0, 308.0, 59.5, 22.0 ], "saved_object_attributes" : { "embed" : 0 } , "style" : "", "text" : "coll" } } , { "box" : { "bgcolor" : [ 0.396078, 0.596078, 0.796078, 1.0 ], "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-29", "linecount" : 4, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 32.0, 135.0, 220.0, 60.0 ], "style" : "", "text" : "Study Hall Lounge\nLibrary\nBilliard Room Dining Room\nConservatory Ballroom Kitchen", "textcolor" : [ 1.0, 1.0, 1.0, 1.0 ] } } , { "box" : { "bubble" : 1, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-2", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 15.0, 15.0, 315.0, 51.0 ], "style" : "", "text" : "Patch 7-029. Simple Game Navigation\nWilliam J Turkel\nhttp://williamjturkel.net/code/#programming" } } , { "box" : { "angle" : 0.0, "bgcolor" : [ 1.0, 1.0, 1.0, 0.0 ], "border" : 1, "id" : "obj-3", "maxclass" : "panel", "mode" : 0, "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 15.0, 75.0, 810.0, 495.0 ], "proportion" : 0.39, "rounded" : 20, "style" : "" } } ], "lines" : [ { "patchline" : { "destination" : [ "obj-86", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-1", 0 ] } } , { "patchline" : { "destination" : [ "obj-87", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-10", 0 ] } } , { "patchline" : { "destination" : [ "obj-5", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-12", 0 ] } } , { "patchline" : { "destination" : [ "obj-88", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-15", 0 ] } } , { "patchline" : { "destination" : [ "obj-89", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-21", 0 ] } } , { "patchline" : { "destination" : [ "obj-23", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-22", 0 ] } } , { "patchline" : { "destination" : [ "obj-5", 0 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 397.5, 141.0, 562.0, 141.0, 562.0, 255.0, 412.0, 255.0, 412.0, 303.0, 352.5, 303.0 ], "source" : [ "obj-23", 2 ] } } , { "patchline" : { "destination" : [ "obj-5", 0 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 322.5, 255.0, 307.0, 255.0, 307.0, 303.0, 352.5, 303.0 ], "source" : [ "obj-23", 0 ] } } , { "patchline" : { "destination" : [ "obj-9", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-23", 1 ] } } , { "patchline" : { "destination" : [ "obj-4", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-26", 0 ] } } , { "patchline" : { "destination" : [ "obj-14", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-27", 0 ] } } , { "patchline" : { "destination" : [ "obj-18", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-28", 0 ] } } , { "patchline" : { "destination" : [ "obj-8", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-30", 0 ] } } , { "patchline" : { "destination" : [ "obj-86", 1 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 376.5, 396.0, 432.0, 396.0, 432.0, 428.0, 366.0, 428.0 ], "source" : [ "obj-38", 1 ] } } , { "patchline" : { "destination" : [ "obj-87", 1 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 400.5, 388.0, 520.0, 388.0, 520.0, 428.0, 459.0, 428.0 ], "source" : [ "obj-38", 2 ] } } , { "patchline" : { "destination" : [ "obj-88", 1 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 424.5, 381.0, 612.0, 381.0, 612.0, 431.0, 548.5, 431.0 ], "source" : [ "obj-38", 3 ] } } , { "patchline" : { "destination" : [ "obj-89", 1 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 448.5, 375.0, 706.0, 375.0, 706.0, 431.0, 640.0, 431.0 ], "source" : [ "obj-38", 4 ] } } , { "patchline" : { "destination" : [ "obj-95", 0 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 352.5, 390.0, 317.5, 390.0 ], "source" : [ "obj-38", 0 ] } } , { "patchline" : { "destination" : [ "obj-23", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-46", 0 ] } } , { "patchline" : { "destination" : [ "obj-38", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-5", 0 ] } } , { "patchline" : { "destination" : [ "obj-11", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-86", 0 ] } } , { "patchline" : { "destination" : [ "obj-13", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-87", 0 ] } } , { "patchline" : { "destination" : [ "obj-16", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-88", 0 ] } } , { "patchline" : { "destination" : [ "obj-17", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-89", 0 ] } } , { "patchline" : { "destination" : [ "obj-5", 0 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 360.0, 255.0, 394.0, 255.0, 394.0, 300.0, 352.5, 300.0 ], "source" : [ "obj-9", 0 ] } } , { "patchline" : { "destination" : [ "obj-25", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-95", 0 ] } } ], "dependency_cache" : [ ], "embedsnapshot" : 0, "default_bgcolor" : [ 0.207843, 0.215686, 0.278431, 1.0 ], "color" : [ 0.901961, 0.901961, 0.901961, 1.0 ], "elementcolor" : [ 0.376471, 0.407843, 0.619608, 1.0 ], "accentcolor" : [ 0.552941, 0.588235, 0.85098, 1.0 ], "selectioncolor" : [ 0.552941, 0.588235, 0.85098, 1.0 ], "textcolor" : [ 0.090196, 0.07451, 0.07451, 1.0 ], "textcolor_inverse" : [ 0.721569, 0.737255, 0.85098, 1.0 ], "patchlinecolor" : [ 0.207843, 0.215686, 0.278431, 0.9 ], "bgfillcolor_type" : "gradient", "bgfillcolor_color1" : [ 0.376471, 0.407843, 0.619608, 1.0 ], "bgfillcolor_color2" : [ 0.376471, 0.407843, 0.619608, 1.0 ], "bgfillcolor_color" : [ 0.290196, 0.309804, 0.301961, 1.0 ], "bgfillcolor_angle" : 270.0, "bgfillcolor_proportion" : 0.39 } }