{"__browser":{"country":"US","device":"unknown_device","mobile":false,"name":"unknown browser","platform":"unknown_platform","version":"0"},"__constants":{},"__CPDATA":{"domain_iframe":"https://cdpn.io","environment":"production","host":"codepen.io","iframe_allow":"accelerometer *; ambient-light-sensor *; camera *; display-capture *; encrypted-media *; geolocation *; gyroscope *; microphone *; midi *; payment *; vr *; web-share *; serial *; xr-spatial-tracking *","iframe_sandbox":"allow-downloads allow-forms allow-modals allow-pointer-lock allow-popups-to-escape-sandbox allow-popups allow-presentation allow-same-origin allow-scripts allow-top-navigation-by-user-activation"},"__graphql":{"data":{"data":{"sessionUser":{"id":"VoDkNZ","name":"Captain Anonymous","title":"Captain Anonymous","avatar":"https://assets.codepen.io/t-1/user-default-avatar.jpg?format=auto&version=0","currentContext":{"id":"VoDkNZ","title":"Captain Anonymous","name":"Captain Anonymous","avatar":"https://assets.codepen.io/t-1/user-default-avatar.jpg?format=auto&version=0","username":"anon","__typename":"User"},"currentTeamId":null,"username":"anon","admin":false,"anon":true,"pro":false,"verified":false,"featureFlags":[],"teams":[],"__typename":"User"}}},"url":"https://codepen.io/graphql","api":"cprails"},"__user":{"anon":true,"base_url":"/anon/","cohorts":[],"current_team_hashid":null,"current_team_id":0,"hashid":"VoDkNZ","id":1,"itemType":"user","name":"Captain Anonymous","paid":false,"tier":0,"username":"anon","created_at":null,"email_verified":null,"collections_count":0,"collections_private_count":0,"followers_count":0,"followings_count":0,"pens_count":0,"pens_private_count":0,"projects_count":0,"projects_private_count":0},"__firebase":{"config":{"apiKey":"AIzaSyBgLAe7N_MdFpuVofMkcQLGwwhUu5tuxls","authDomain":"codepen-store-production.firebaseapp.com","databaseURL":"https://codepen-store-production.firebaseio.com","disabled":false,"projectId":"codepen-store-production"},"token":"eyJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJodHRwczovL2lkZW50aXR5dG9vbGtpdC5nb29nbGVhcGlzLmNvbS9nb29nbGUuaWRlbnRpdHkuaWRlbnRpdHl0b29sa2l0LnYxLklkZW50aXR5VG9vbGtpdCIsImNsYWltcyI6eyJvd25lcklkIjoiVm9Ea05aIiwiYWRtaW4iOmZhbHNlfSwiZXhwIjoxNzI2NzE2NTU2LCJpYXQiOjE3MjY3MTI5NTYsImlzcyI6ImZpcmViYXNlLWFkbWluc2RrLThva3lsQGNvZGVwZW4tc3RvcmUtcHJvZHVjdGlvbi5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInN1YiI6ImZpcmViYXNlLWFkbWluc2RrLThva3lsQGNvZGVwZW4tc3RvcmUtcHJvZHVjdGlvbi5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInVpZCI6IlZvRGtOWiJ9.Vwc-ZeXKyas4BJ6_8H4o_7ip9IIXMWieli9vtcVBRuMj1Rt_tKWibjPnyUf-XB0dfrp5fYCagqROPFY-GJaJ4C_F9ShMNpXeVo1itCU01ANk3XGCaVO_MDMbqVlaaJRT4zigv7weIFM0zswkOke-YNB3INRBtvDxna-9Bi3XkJ4avhhr9XPmL0ybz2SmSs9Mf5RSxgmTrrhcIhdVOohuMtFs4o3A9KaTCjsUDki1274JOdk41U2wFMHXIZnpZb3jLoDDJIuzUngoBH2tkVUrCWm_Xk4lhAkyFV0V5SuA-X8uP65A4VNIE8X0msXFZGNTBvOXBhF6FWzJk72mWqfgiA"},"__pay_stripe_public_key":"pk_live_2GndomDfiklqpSNQn8FrGuwZSMIMzha7DkLJqlYe7IR0ihKAlKdiHg68JJc5eVPt68rzAjzAAVXcUwjySHRCsgjQQ00gtRBUFNH","__pay_braintree_env":"production","__item":"{\"id\":11480906,\"user_id\":837599,\"html\":\"<script type=\\\"application\\/processing\\\">\\nint level = 1;\\nint goes = 0;\\nfloat heading = 0;\\nfloat dHeading = .1;\\nfloat pX = 50;\\nfloat pY = 100;\\nfloat spX = 50;\\nfloat spY = 100;\\nfloat pR = 25;\\nboolean charging = false;\\nboolean moving = false;\\nfloat charge = 0;\\nfloat dCharge = .5;\\nfloat maxCharge = 20;\\nfloat speed = 0;\\nfloat minSpeed = 1;\\n\\nboolean showFriend = false;\\nfloat fX = 250;\\nfloat fY = 250;\\nfloat fHeading = 0;\\nfloat fdHeading = -.15;\\n\\nfloat goalX = 450;\\nfloat goalY = 100;\\nfloat goalR = 25;\\n\\nString msgOne = \\\"One Roomba\\\";\\nString msgTwo = \\\"Press to charge.\\\";\\nString msgThree = \\\"Press again to go.\\\";\\n\\nArrayList<Bad> bads = new ArrayList<Bad>();\\n\\nvoid setup(){\\n\\tsize(500, 500);\\n\\tframeRate(30);\\n\\ttextAlign(CENTER, CENTER);\\n\\ttextSize(24);\\n\\tstrokeWeight(4);\\n\\tstroke(255);\\n}\\n\\nvoid mousePressed(){\\n\\t\\n\\tif(!moving){\\n\\t\\tif(charging){\\n\\t\\t\\t moving = true;\\n\\t charging = false;\\n speed = charge;\\n goes++;\\n\\t\\t}\\n\\t\\telse{\\n\\t\\t charging = true;\\n\\t charge = 0;\\n\\t\\t}\\n\\t}\\n\\t\\n}\\n\\nvoid draw(){\\n\\tbackground(64);\\n\\t\\n\\tfill(255);\\n\\ttext(msgOne, width\\/2, 100);\\n\\ttext(msgTwo, width\\/2, 250);\\n\\ttext(msgThree, width\\/2, 400);\\n\\t\\n\\tif(moving){\\n\\t\\t pX += cos(heading)*speed;\\n\\t pY += sin(heading)*speed;\\n\\t \\n\\t if(dist(pX, pY, goalX, goalY) < pR+goalR){\\n\\t \\t spX = pX;\\n\\t \\t spY = pY;\\n\\t \\t level++;\\n\\t \\tstartLevel();\\n\\t }\\n\\t \\n\\t if(pX<pR){\\n\\t \\t pX = pR;\\n\\t } \\n\\t if(pX>width-pR){\\n\\t \\t pX = width-pR;\\n\\t }\\n\\t if(pY<pR){\\n\\t \\t pY = pR;\\n\\t }\\n\\t if(pY >height-pR){\\n\\t \\t pY = height-pR;\\n\\t }\\n\\t \\n\\t if(showFriend){\\n\\t fX += cos(fHeading)*speed;\\n\\t fY += sin(fHeading)*speed;\\n\\t \\n\\t if(fX<pR){\\n\\t \\t fX = pR;\\n \\t } \\n \\t if(fX>width-pR){\\n\\t \\t fX = width-pR;\\n\\t }\\n \\t if(fY<pR){\\n\\t \\t fY = pR;\\n\\t }\\n\\t if(fY >height-pR){\\n\\t \\t fY = height-pR;\\n\\t }\\n\\t }\\n\\t \\n\\t speed *= .9;\\n\\t if(speed < minSpeed){\\n\\t \\t moving = false;\\n\\t }\\n\\t}\\n else if(!charging){\\n\\t heading += dHeading;\\n fHeading += fdHeading;\\n\\t}\\n\\t\\n\\tfill(0, 0, 255);\\n\\tellipse(pX, pY, pR*2, pR*2);\\n\\tfloat hX = pX + cos(heading)*pR;\\n\\tfloat hY = pY + sin(heading)*pR;\\n\\tline(pX, pY, hX, hY);\\n\\t\\n\\tif(showFriend){\\n\\t\\t fill(0, 255, 0);\\n\\t ellipse(fX, fY, pR*2, pR*2);\\n\\t float fhX = fX + cos(fHeading)*pR;\\n \\tfloat fhY = fY + sin(fHeading)*pR;\\n\\t line(fX, fY, fhX, fhY);\\n\\t\\t\\n\\t}\\n\\t\\n\\tif(charging){\\n\\t\\tcharge += dCharge;\\n\\t\\tif(charge < 0 || charge > maxCharge){\\n\\t\\t\\tdCharge *= -1;\\n\\t\\t}\\n\\t\\tfill(0, 0, 255);\\n\\t\\tellipse(pX, pY, pR*2*charge\\/maxCharge, pR*2*charge\\/maxCharge);\\n\\t}\\n\\t\\n\\tfill(0, 255, 0);\\n\\tellipse(goalX, goalY, goalR*2, goalR*2);\\n\\t\\n\\tfor(int i = 0; i < bads.size(); i++){\\n\\t\\tBad b = bads.get(i);\\n\\t\\tb.draw();\\n\\t\\t\\n\\t\\tif(dist(pX, pY, b.x, b.y) < pR+b.r){\\n\\t\\t\\tpX = spX;\\n\\t\\t\\tpY = spY;\\n\\t\\t\\tstartLevel();\\n\\t\\t\\tbreak;\\n\\t\\t}\\n\\t}\\n\\t\\n\\tfill(255);\\n\\ttext(goes, 50, 20);\\n}\\n\\nclass Bad{\\n\\tfloat x;\\n\\tfloat y;\\n\\tfloat r;\\n\\tboolean chase;\\n\\tfloat xSpeed;\\n\\tfloat ySpeed;\\n\\t\\n\\tpublic Bad(float x, float y, float r, boolean chase, float xSpeed, float ySpeed){\\n\\t\\tthis.x = x;\\n\\t\\tthis.y = y;\\n\\t\\tthis.r = r;\\n\\t\\tthis.chase = chase;\\n\\t\\tthis.xSpeed = xSpeed;\\n\\t\\tthis.ySpeed = ySpeed;\\n\\t}\\n\\t\\n\\tvoid draw(){\\n\\t\\tfill(255, 0, 0);\\n\\t\\tellipse(x, y, r*2, r*2);\\n\\t\\tif(chase){\\n\\t\\t\\tPVector p = new PVector(pX-x, pY-y);\\n\\t\\t\\tp.normalize();\\n\\t\\t\\txSpeed = p.x;\\n\\t ySpeed = p.y;\\n\\t\\t}\\n\\t\\tx += xSpeed;\\n\\t\\ty += ySpeed;\\n\\t\\tif(x<r || x>width-r){\\n\\t\\t\\txSpeed *= -1;\\n\\t\\t}\\n\\t\\tif(y<r || y>height-r){\\n\\t\\t\\tySpeed *= -1;\\n\\t\\t}\\n\\t}\\n}\\n\\nvoid startLevel(){\\n\\tspeed = 0;\\n\\tmoving = false;\\n\\tcharging = false;\\n\\tbads.clear();\\n\\t\\n\\tif(level == 2){\\n\\t\\tgoalX = 450;\\n\\t\\tgoalY = 450;\\n\\t\\tmsgOne = \\\"I can't stop spinning.\\\";\\n\\t\\tmsgTwo = \\\"Am I broken?\\\";\\n\\t\\tmsgThree = \\\"Or is the world?\\\";\\n\\t}\\n\\telse if(level == 3){\\n\\t\\tgoalX = 50;\\n\\t\\tgoalY = 50;\\n\\t\\tmsgOne = \\\"Red is bad.\\\";\\n\\t\\tmsgTwo = \\\"\\\";\\n\\t\\tmsgThree = \\\"But am I good?\\\";\\n\\t\\tbads.add(new Bad(width\\/2, height\\/2, 75, false, 0, 0));\\n\\t}\\n\\telse if(level == 4){\\n\\t\\t goalY = 400;\\n\\t\\t bads.add(new Bad(200, 300, 25, false, 1, 0));\\n\\t\\t bads.add(new Bad(300, 300, 25, false, -1, 0));\\n\\t\\t \\n\\t\\t msgOne = \\\"They move with such purpose.\\\";\\n\\t\\t msgTwo = \\\"But then why do I\\\";\\n\\t\\t msgThree = \\\"feel so lost?\\\";\\n\\t}\\n\\telse if(level == 5){\\n\\t\\t goalX = 250;\\n\\t\\t goalY = 200;\\n\\t\\t msgOne = \\\"Am I trapped?\\\";\\n\\t\\t msgTwo = \\\"Or am I free?\\\";\\n\\t\\t msgThree = \\\"Or neither?\\\";\\n\\t\\t \\n\\t\\t bads.add(new Bad(450, 50, 25, false, 1, 1));\\n\\t\\t bads.add(new Bad(450, 50, 25, false, -1, -1));\\n\\t}\\n\\telse if(level == 6){\\n\\t\\tgoalX = 450;\\n\\t\\tgoalY = 450;\\n\\t\\tmsgOne = \\\"Am I going towards something?\\\";\\n\\t\\tmsgTwo = \\\"Or away from something else?\\\";\\n\\t\\tmsgThree = \\\"Is there a difference?\\\";\\n\\t\\t bads.add(new Bad(25, 25, 50, true, 1, -1));\\n\\t\\t bads.add(new Bad(475, 25, 50, true, 1, -1));\\n\\t\\t bads.add(new Bad(25, 475, 50, true, 1, -1));\\n\\t}\\n\\telse if(level == 7){\\n\\t\\t goalX = 50;\\n\\t \\tgoalY = 50;\\n \\t\\tmsgOne = \\\"At least they have each other.\\\";\\n\\t \\tmsgTwo = \\\"Why does that seem worse\\\";\\n\\t \\tmsgThree = \\\"than being alone?\\\";\\n\\t\\t bads.add(new Bad(250, 250, 25, false, 1, -1));\\n\\t\\t bads.add(new Bad(250, 250, 25, false, -1, -1));\\n\\t\\t bads.add(new Bad(250, 250, 25, false, -1, 1)); \\t\\n\\t\\t \\n\\t}\\n\\telse if(level == 8){\\n\\t\\t goalX = 450;\\n\\t \\tgoalY = 50;\\n \\t\\tmsgOne = \\\"\\\";\\n\\t \\tmsgTwo = \\\"\\\";\\n\\t \\tmsgThree = \\\"One Roomba\\\";\\n\\t\\t bads.add(new Bad(250,50, 25, false,0,0));\\n bads.add(new Bad(250,125, 25, false,0,0));\\n bads.add(new Bad(250,200, 25, false,0,0));\\n \\t\\t bads.add(new Bad(250, 275, 25, false, 0, 0));\\n\\t\\t bads.add(new Bad(250,350, 25, false, 0, 0));\\n\\t}\\n else{\\n \\t fX = goalX;\\n \\t fY = goalY;\\n \\t goalX = -100;\\n \\t goalY = -100;\\n \\t showFriend = true;\\n \\t \\n \\t msgOne = \\\"Two Roombas\\\";\\n \\t msgTwo = \\\"Thanks for playing!\\\";\\n \\t msgThree = \\\"@KevinAWorkman \\/ HappyCoding.io\\\"\\n }\\n}\\n<\\/script>\\n<canvas> <\\/canvas>\",\"css\":\"\",\"js\":\"\",\"html_pre_processor\":\"none\",\"css_pre_processor\":\"none\",\"js_pre_processor\":\"none\",\"html_classes\":\"\",\"css_starter\":\"neither\",\"js_library\":null,\"created_at\":\"2016-12-10T01:23:06.000Z\",\"updated_at\":\"2016-12-11T20:56:13.000Z\",\"title\":\"One Roomba\",\"description\":\"Little game I made for #ldjam December 2016.\\n\\nI was in the middle of moving and didn't have a computer, so this was done entirely on my 5 year old phone.\",\"slug_hash\":\"ENpwLg\",\"head\":\"\",\"private\":false,\"slug_hash_private\":\"9f71d34e3bbab0e1def73d72c308d5bb\",\"has_animation\":false,\"team_id\":0,\"css_prefix\":\"neither\",\"template\":false,\"parent_id\":10029477,\"comments_count\":0,\"custom_screenshot_filename\":null,\"loves_count\":0,\"pick\":false,\"popularity_score\":0,\"views_count\":0,\"pick_visible_at\":null,\"cpid\":\"0158e653-9090-7e5b-be05-d129e36671ef\",\"is_new_editor_pen\":false,\"protected\":false,\"access\":\"Public\",\"pen_hash\":null,\"hashid\":\"ENpwLg\"}"}