{"action":"opened","number":11212,"pull_request":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/11212","id":89724499,"html_url":"https://github.com/code-dot-org/code-dot-org/pull/11212","diff_url":"https://github.com/code-dot-org/code-dot-org/pull/11212.diff","patch_url":"https://github.com/code-dot-org/code-dot-org/pull/11212.patch","issue_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/11212","number":11212,"state":"open","locked":false,"title":"GameLab: Change collide() and displace() behavior","user":{"login":"islemaster","id":1615761,"avatar_url":"https://avatars.githubusercontent.com/u/1615761?v=3","gravatar_id":"","url":"https://api.github.com/users/islemaster","html_url":"https://github.com/islemaster","followers_url":"https://api.github.com/users/islemaster/followers","following_url":"https://api.github.com/users/islemaster/following{/other_user}","gists_url":"https://api.github.com/users/islemaster/gists{/gist_id}","starred_url":"https://api.github.com/users/islemaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/islemaster/subscriptions","organizations_url":"https://api.github.com/users/islemaster/orgs","repos_url":"https://api.github.com/users/islemaster/repos","events_url":"https://api.github.com/users/islemaster/events{/privacy}","received_events_url":"https://api.github.com/users/islemaster/received_events","type":"User","site_admin":false},"body":"Makes `Sprite.collide()` and `Sprite.displace()` affect the displaced sprite's velocity as an inelastic collision, where before they did not affect the sprite's velocity at all.\r\n\r\nIn case you are not already familiar:\r\n\r\n* `a.collide(b)` causes `a` to treat `b` as immovable, and displace itself out of the collision.  As of this change, `a` also adopts `b`'s velocity along the collision normal.\r\n* `a.displace(b)` is the same thing with roles reversed - `a` treats itself as immovable, and displaces `b` out of the collision.  As of this change, `b` also adopts `a`'s velocity along the collision normal.\r\n\r\n# Examples\r\nThis may be best understood one case at a time:\r\n\r\n## Ex. 1: Box-Box `collide()`\r\nNote: The sprites' x-velocities are displayed in the corners of the play area.\r\n\r\nBefore:\r\n![collide](https://cloud.githubusercontent.com/assets/1615761/19459565/c3fac5da-9488-11e6-8eb2-25eabdd29872.gif)\r\nAfter:\r\n![collide](https://cloud.githubusercontent.com/assets/1615761/19459568/c9ce364a-9488-11e6-90ce-e3b185dfb4c3.gif)\r\n\r\n## Ex. 2: Box-Box `displace()`\r\n![displace](https://cloud.githubusercontent.com/assets/1615761/19459642/4201f41c-9489-11e6-8568-0bf545f4eeb6.gif)\r\n![displace](https://cloud.githubusercontent.com/assets/1615761/19459644/45671038-9489-11e6-92b3-c8c4ed6c172e.gif)\r\n\r\n## Ex. 3: Ball-Ball `collide()`\r\n![collide](https://cloud.githubusercontent.com/assets/1615761/19459587/e97ba572-9488-11e6-9840-5abee1c1aa99.gif)\r\n![collide](https://cloud.githubusercontent.com/assets/1615761/19459591/ecfd39cc-9488-11e6-9ba5-80b2389a44ad.gif)\r\n\r\n## Ex. 4: Ball-Ball `displace()`\r\n![displace](https://cloud.githubusercontent.com/assets/1615761/19459647/51176d74-9489-11e6-9af6-797d8eb18de9.gif)\r\n![displace](https://cloud.githubusercontent.com/assets/1615761/19459649/54f19e42-9489-11e6-8389-2f435350c3b2.gif)\r\n\r\n## Ex. 5: Box-Platform `collide()`\r\n![collide](https://cloud.githubusercontent.com/assets/1615761/19459608/fc5d2d96-9488-11e6-9c36-8075ac073d13.gif)\r\n![collide](https://cloud.githubusercontent.com/assets/1615761/19459611/000d15dc-9489-11e6-838b-6a57ea55dc0a.gif)\r\n\r\n## Ex. 6: Box-Platform `displace()`\r\n![displace](https://cloud.githubusercontent.com/assets/1615761/19459655/638f8f7c-9489-11e6-8ce2-13583cf92094.gif)\r\n![displace](https://cloud.githubusercontent.com/assets/1615761/19459658/67a85256-9489-11e6-89ec-6b4a1cb000f2.gif)\r\n\r\n## Ex. 7: Ball-Platform `collide()`\r\nNote: The ball's x and y velocities are given in the corners of the play area.\r\n![collide](https://cloud.githubusercontent.com/assets/1615761/19459622/19cf4fc6-9489-11e6-80eb-383a547f1f8c.gif)\r\n![collide](https://cloud.githubusercontent.com/assets/1615761/19459625/1e13dd5e-9489-11e6-9721-21a4c4379751.gif)\r\n\r\n## Ex. 8: Ball-Platform `displace()`\r\n![displace](https://cloud.githubusercontent.com/assets/1615761/19459665/7714f4f6-9489-11e6-86c9-9e2428ae8d7f.gif)\r\n![displace](https://cloud.githubusercontent.com/assets/1615761/19459666/79b31a12-9489-11e6-95cb-29fdb7583b98.gif)\r\n\r\n# Testing\r\nI brought over a set of unit tests I wrote for p5.play covering this behavior, but now they run against `GameLabSprite` so we're checking that this change in our monkeypatch stays in place.  I also created and ran the above examples in GameLab to illustrate the change.\r\n\r\n_Note: These changes have been proposed upstream as https://github.com/molleindustria/p5.play/pull/114 but I'm not sure they'll be accepted there.  I'm holding off  on adding them to our local copy of p5.play.js since having this change in our `AABBops` monkeypatch is sufficient to get the functionality._","created_at":"2016-10-17T23:53:56Z","updated_at":"2016-10-17T23:53:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/11212/commits","review_comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/11212/comments","review_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/11212/comments","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/e962aa4916924ef1c48d5b97b55ef79d9c26978b","head":{"label":"code-dot-org:p5play-collide-fixes","ref":"p5play-collide-fixes","sha":"e962aa4916924ef1c48d5b97b55ef79d9c26978b","user":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"name":"code-dot-org","full_name":"code-dot-org/code-dot-org","owner":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","deployments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/deployments","created_at":"2014-09-20T00:46:11Z","updated_at":"2016-10-14T12:51:55Z","pushed_at":"2016-10-17T23:53:56Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":4977240,"stargazers_count":148,"watchers_count":148,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":95,"mirror_url":null,"open_issues_count":66,"forks":95,"open_issues":66,"watchers":148,"default_branch":"staging"}},"base":{"label":"code-dot-org:staging","ref":"staging","sha":"fc6a85a5d1000f7e0f332692a598d4588ce7b612","user":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"name":"code-dot-org","full_name":"code-dot-org/code-dot-org","owner":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","deployments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/deployments","created_at":"2014-09-20T00:46:11Z","updated_at":"2016-10-14T12:51:55Z","pushed_at":"2016-10-17T23:53:56Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":4977240,"stargazers_count":148,"watchers_count":148,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":95,"mirror_url":null,"open_issues_count":66,"forks":95,"open_issues":66,"watchers":148,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/11212"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/11212"},"issue":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/11212"},"comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/11212/comments"},"review_comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/11212/comments"},"review_comment":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/11212/commits"},"statuses":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/e962aa4916924ef1c48d5b97b55ef79d9c26978b"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":3,"additions":522,"deletions":29,"changed_files":2}}
{"actor":{"display_login":"islemaster"}}