{ "patcher" : { "fileversion" : 1, "appversion" : { "major" : 7, "minor" : 0, "revision" : 1, "architecture" : "x86", "modernui" : 1 } , "rect" : [ 593.0, 258.0, 864.0, 601.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" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-74", "linecount" : 4, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 144.75, 436.5, 107.0, 60.0 ], "style" : "", "text" : "The positioning of the crosshairs is controlled by the user" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-72", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 405.0, 380.5, 150.0, 33.0 ], "style" : "", "text" : "We animate the UFO using a random walk" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-70", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 284.5, 135.0, 270.5, 47.0 ], "style" : "", "text" : "Next we define the sprites for a UFO and some crosshairs. The crosshairs have to be drawn on top" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-68", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 30.0, 135.0, 228.0, 47.0 ], "style" : "", "text" : "We start by clearing the screen, deleting all sprites and drawing a cityscape along the bottom edge" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-66", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 181.25, 318.0, 34.0, 22.0 ], "style" : "", "text" : "+ 10" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-65", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 181.25, 288.0, 32.5, 22.0 ], "style" : "", "text" : "* 10" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-64", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 3, "outlettype" : [ "int", "bang", "int" ], "patching_rect" : [ 64.0, 258.0, 67.0, 22.0 ], "style" : "", "text" : "trigger i b i" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-63", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 106.5, 318.0, 41.0, 22.0 ], "style" : "", "text" : "+ 150" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-62", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 106.5, 288.0, 68.0, 22.0 ], "style" : "", "text" : "random 50" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-61", "maxclass" : "newobj", "numinlets" : 3, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 64.0, 348.0, 66.0, 22.0 ], "style" : "", "text" : "pack 0 0 0" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-60", "linecount" : 2, "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 64.0, 380.5, 179.0, 35.0 ], "style" : "", "text" : ";\rlcd paintrect $1 $2 $3 200 0 0 0" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-56", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 64.0, 288.0, 32.5, 22.0 ], "style" : "", "text" : "* 10" } } , { "box" : { "id" : "obj-55", "maxclass" : "button", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "bang" ], "patching_rect" : [ 30.0, 195.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-53", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 3, "outlettype" : [ "bang", "bang", "int" ], "patching_rect" : [ 30.0, 225.0, 53.0, 22.0 ], "style" : "", "text" : "uzi 20 0" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-51", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 330.0, 486.5, 56.0, 22.0 ], "style" : "", "text" : "pack 0 0" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-50", "maxclass" : "newobj", "numinlets" : 3, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 420.0, 450.0, 74.0, 22.0 ], "style" : "", "text" : "drunk 180 4" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-48", "linecount" : 2, "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 330.0, 516.5, 138.0, 35.0 ], "style" : "", "text" : ";\rlcd drawsprite ufo $1 $2" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-47", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "bang" ], "patching_rect" : [ 330.0, 408.5, 58.0, 22.0 ], "style" : "", "text" : "metro 50" } } , { "box" : { "id" : "obj-46", "maxclass" : "toggle", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 330.0, 378.5, 20.0, 20.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-43", "maxclass" : "newobj", "numinlets" : 3, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 330.0, 450.0, 74.0, 22.0 ], "style" : "", "text" : "drunk 180 8" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-42", "linecount" : 2, "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 136.0, 219.5, 123.0, 35.0 ], "style" : "", "text" : ";\rlcd clear, clearsprites" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-40", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 585.0, 90.0, 200.0, 33.0 ], "style" : "", "text" : "You have to enable sprites before you use them" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-38", "maxclass" : "number", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 80.0, 450.0, 50.0, 22.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-37", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 30.0, 486.5, 50.0, 22.0 ], "style" : "", "text" : "pak 0 0" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-36", "maxclass" : "number", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 30.0, 450.0, 50.0, 22.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-32", "linecount" : 2, "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 30.0, 516.5, 176.0, 35.0 ], "style" : "", "text" : ";\rlcd drawsprite crosshairs $1 $2" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-29", "linecount" : 4, "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 285.0, 195.0, 270.0, 62.0 ], "style" : "", "text" : ";\rlcd recordsprite, frameoval 15 5 35 20 0 0 255, paintroundrect 10 10 40 20 12 12 0 0 255, closesprite ufo" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-28", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 660.0, 165.0, 99.0, 22.0 ], "style" : "", "text" : "enablesprites $1" } } , { "box" : { "id" : "obj-25", "maxclass" : "toggle", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 660.0, 132.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-20", "linecount" : 4, "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 285.0, 269.0, 271.0, 62.0 ], "style" : "", "text" : ";\rlcd recordsprite, frameoval 10 10 60 60 255 0 0, linesegment 0 35 70 35, linesegment 35 0 35 70, closesprite crosshairs, frontsprite crosshairs" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-5", "maxclass" : "newobj", "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 585.0, 165.0, 68.0, 22.0 ], "style" : "", "text" : "receive lcd" } } , { "box" : { "enablesprites" : 1, "id" : "obj-1", "maxclass" : "lcd", "numinlets" : 1, "numoutlets" : 4, "outlettype" : [ "list", "list", "int", "" ], "patching_rect" : [ 585.0, 210.0, 200.0, 200.0 ] } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-4", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 30.0, 90.0, 525.0, 33.0 ], "style" : "", "text" : "If you want to use the lcd object to implement a game or animation, you face the problem of moving a number of simpler shapes together as a single entity. These entities are called 'sprites'. " } } , { "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-042. Sprites\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-28", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-25", 0 ] } } , { "patchline" : { "destination" : [ "obj-1", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-28", 0 ] } } , { "patchline" : { "destination" : [ "obj-37", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-36", 0 ] } } , { "patchline" : { "destination" : [ "obj-32", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-37", 0 ] } } , { "patchline" : { "destination" : [ "obj-37", 1 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-38", 0 ] } } , { "patchline" : { "destination" : [ "obj-51", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-43", 0 ] } } , { "patchline" : { "destination" : [ "obj-47", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-46", 0 ] } } , { "patchline" : { "destination" : [ "obj-43", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-47", 0 ] } } , { "patchline" : { "destination" : [ "obj-50", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-47", 0 ] } } , { "patchline" : { "destination" : [ "obj-1", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-5", 0 ] } } , { "patchline" : { "destination" : [ "obj-51", 1 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-50", 0 ] } } , { "patchline" : { "destination" : [ "obj-48", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-51", 0 ] } } , { "patchline" : { "destination" : [ "obj-64", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-53", 2 ] } } , { "patchline" : { "destination" : [ "obj-42", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-55", 0 ] } } , { "patchline" : { "destination" : [ "obj-53", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-55", 0 ] } } , { "patchline" : { "destination" : [ "obj-61", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-56", 0 ] } } , { "patchline" : { "destination" : [ "obj-60", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-61", 0 ] } } , { "patchline" : { "destination" : [ "obj-63", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-62", 0 ] } } , { "patchline" : { "destination" : [ "obj-61", 1 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-63", 0 ] } } , { "patchline" : { "destination" : [ "obj-56", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-64", 0 ] } } , { "patchline" : { "destination" : [ "obj-62", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-64", 1 ] } } , { "patchline" : { "destination" : [ "obj-65", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-64", 2 ] } } , { "patchline" : { "destination" : [ "obj-66", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-65", 0 ] } } , { "patchline" : { "destination" : [ "obj-61", 2 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-66", 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 } }