{"action":"created","comment":{"url":"https://api.github.com/repos/varblob/catch/pulls/comments/69377658","id":69377658,"diff_hunk":"@@ -0,0 +1,249 @@\n+/*global\n+  $\n+  Audio\n+*/\n+\n+(function () {\n+  // ================== globals ==================\n+  // keycodes for left and right\n+  var LEFT = 37;\n+  var RIGHT = 39;\n+\n+  // size of each grid square\n+  var GRID_SIZE = 12;\n+  // grid height and width\n+  var GRID_WIDTH = 50;\n+  var GRID_HEIGHT = 40;\n+\n+  // initial game settings\n+  // how fast the game update loop runs\n+  var START_TICK = 10;\n+  // how many update calls per drop move / collision\n+  var START_DROPS_SPEED = 10;\n+  // how many update calls per pad movement\n+  var START_MOVE_SPEED = 5;\n+  // how widet he pad is to start\n+  var START_PAD_WIDTH = 4;\n+  // how many update calls per createDrop\n+  var START_DROP_CREATE_TIME = 99;\n+\n+  // the jquery game element\n+  var $game = null;\n+  // the pad that catches the drops\n+  var $pad = null;\n+  // the jquery score element\n+  var $score = null;\n+  // all the jquery drop elements\n+  var $drops = [];\n+\n+  // all the game state\n+  var game = null;\n+\n+  // the sound of catching\n+  var catchSound = null;\n+\n+  // ================== utils ==================\n+\n+  // play an Audio object restarting if sound currently playing\n+  // todo overlapping sounds we must create new Audio instances\n+  var playSound = function (sound) {\n+    // if a sound is currently playing restart from beginning\n+    if (!sound.paused) {\n+      sound.currentTime = 0;\n+    } else {\n+      sound.play();\n+    }\n+  };\n+\n+  // ================== view helpers ==================\n+  // these are all helpers to get and set model info from a jquery element\n+  // the conversion to grid is also handled here","path":"assets/js/main.js","position":60,"original_position":60,"commit_id":"4146922ab8006242b8021a4195756d7b76b1c213","original_commit_id":"4146922ab8006242b8021a4195756d7b76b1c213","user":{"login":"varblob","id":1903054,"avatar_url":"https://avatars.githubusercontent.com/u/1903054?v=3","gravatar_id":"","url":"https://api.github.com/users/varblob","html_url":"https://github.com/varblob","followers_url":"https://api.github.com/users/varblob/followers","following_url":"https://api.github.com/users/varblob/following{/other_user}","gists_url":"https://api.github.com/users/varblob/gists{/gist_id}","starred_url":"https://api.github.com/users/varblob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varblob/subscriptions","organizations_url":"https://api.github.com/users/varblob/orgs","repos_url":"https://api.github.com/users/varblob/repos","events_url":"https://api.github.com/users/varblob/events{/privacy}","received_events_url":"https://api.github.com/users/varblob/received_events","type":"User","site_admin":false},"body":"This is an area where the students will probably do it different / struggle.  I can do another version where the GRID and view logic is scattered throughout the code.  If we can encourage them to do this it does make it much easier to code.  ","created_at":"2016-07-02T12:48:25Z","updated_at":"2016-07-02T12:48:25Z","html_url":"https://github.com/varblob/catch/pull/1#discussion_r69377658","pull_request_url":"https://api.github.com/repos/varblob/catch/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/varblob/catch/pulls/comments/69377658"},"html":{"href":"https://github.com/varblob/catch/pull/1#discussion_r69377658"},"pull_request":{"href":"https://api.github.com/repos/varblob/catch/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/varblob/catch/pulls/1","id":76064053,"html_url":"https://github.com/varblob/catch/pull/1","diff_url":"https://github.com/varblob/catch/pull/1.diff","patch_url":"https://github.com/varblob/catch/pull/1.patch","issue_url":"https://api.github.com/repos/varblob/catch/issues/1","number":1,"state":"open","locked":false,"title":"V1","user":{"login":"varblob","id":1903054,"avatar_url":"https://avatars.githubusercontent.com/u/1903054?v=3","gravatar_id":"","url":"https://api.github.com/users/varblob","html_url":"https://github.com/varblob","followers_url":"https://api.github.com/users/varblob/followers","following_url":"https://api.github.com/users/varblob/following{/other_user}","gists_url":"https://api.github.com/users/varblob/gists{/gist_id}","starred_url":"https://api.github.com/users/varblob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varblob/subscriptions","organizations_url":"https://api.github.com/users/varblob/orgs","repos_url":"https://api.github.com/users/varblob/repos","events_url":"https://api.github.com/users/varblob/events{/privacy}","received_events_url":"https://api.github.com/users/varblob/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-02T12:30:35Z","updated_at":"2016-07-02T12:48:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a500a4c3533a53fd1062ebb329e92511cb8bb88","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/varblob/catch/pulls/1/commits","review_comments_url":"https://api.github.com/repos/varblob/catch/pulls/1/comments","review_comment_url":"https://api.github.com/repos/varblob/catch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/varblob/catch/issues/1/comments","statuses_url":"https://api.github.com/repos/varblob/catch/statuses/4146922ab8006242b8021a4195756d7b76b1c213","head":{"label":"varblob:v1","ref":"v1","sha":"4146922ab8006242b8021a4195756d7b76b1c213","user":{"login":"varblob","id":1903054,"avatar_url":"https://avatars.githubusercontent.com/u/1903054?v=3","gravatar_id":"","url":"https://api.github.com/users/varblob","html_url":"https://github.com/varblob","followers_url":"https://api.github.com/users/varblob/followers","following_url":"https://api.github.com/users/varblob/following{/other_user}","gists_url":"https://api.github.com/users/varblob/gists{/gist_id}","starred_url":"https://api.github.com/users/varblob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varblob/subscriptions","organizations_url":"https://api.github.com/users/varblob/orgs","repos_url":"https://api.github.com/users/varblob/repos","events_url":"https://api.github.com/users/varblob/events{/privacy}","received_events_url":"https://api.github.com/users/varblob/received_events","type":"User","site_admin":false},"repo":{"id":62353095,"name":"catch","full_name":"varblob/catch","owner":{"login":"varblob","id":1903054,"avatar_url":"https://avatars.githubusercontent.com/u/1903054?v=3","gravatar_id":"","url":"https://api.github.com/users/varblob","html_url":"https://github.com/varblob","followers_url":"https://api.github.com/users/varblob/followers","following_url":"https://api.github.com/users/varblob/following{/other_user}","gists_url":"https://api.github.com/users/varblob/gists{/gist_id}","starred_url":"https://api.github.com/users/varblob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varblob/subscriptions","organizations_url":"https://api.github.com/users/varblob/orgs","repos_url":"https://api.github.com/users/varblob/repos","events_url":"https://api.github.com/users/varblob/events{/privacy}","received_events_url":"https://api.github.com/users/varblob/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/varblob/catch","description":null,"fork":false,"url":"https://api.github.com/repos/varblob/catch","forks_url":"https://api.github.com/repos/varblob/catch/forks","keys_url":"https://api.github.com/repos/varblob/catch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/varblob/catch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/varblob/catch/teams","hooks_url":"https://api.github.com/repos/varblob/catch/hooks","issue_events_url":"https://api.github.com/repos/varblob/catch/issues/events{/number}","events_url":"https://api.github.com/repos/varblob/catch/events","assignees_url":"https://api.github.com/repos/varblob/catch/assignees{/user}","branches_url":"https://api.github.com/repos/varblob/catch/branches{/branch}","tags_url":"https://api.github.com/repos/varblob/catch/tags","blobs_url":"https://api.github.com/repos/varblob/catch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/varblob/catch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/varblob/catch/git/refs{/sha}","trees_url":"https://api.github.com/repos/varblob/catch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/varblob/catch/statuses/{sha}","languages_url":"https://api.github.com/repos/varblob/catch/languages","stargazers_url":"https://api.github.com/repos/varblob/catch/stargazers","contributors_url":"https://api.github.com/repos/varblob/catch/contributors","subscribers_url":"https://api.github.com/repos/varblob/catch/subscribers","subscription_url":"https://api.github.com/repos/varblob/catch/subscription","commits_url":"https://api.github.com/repos/varblob/catch/commits{/sha}","git_commits_url":"https://api.github.com/repos/varblob/catch/git/commits{/sha}","comments_url":"https://api.github.com/repos/varblob/catch/comments{/number}","issue_comment_url":"https://api.github.com/repos/varblob/catch/issues/comments{/number}","contents_url":"https://api.github.com/repos/varblob/catch/contents/{+path}","compare_url":"https://api.github.com/repos/varblob/catch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/varblob/catch/merges","archive_url":"https://api.github.com/repos/varblob/catch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/varblob/catch/downloads","issues_url":"https://api.github.com/repos/varblob/catch/issues{/number}","pulls_url":"https://api.github.com/repos/varblob/catch/pulls{/number}","milestones_url":"https://api.github.com/repos/varblob/catch/milestones{/number}","notifications_url":"https://api.github.com/repos/varblob/catch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/varblob/catch/labels{/name}","releases_url":"https://api.github.com/repos/varblob/catch/releases{/id}","deployments_url":"https://api.github.com/repos/varblob/catch/deployments","created_at":"2016-07-01T01:28:33Z","updated_at":"2016-07-01T01:28:33Z","pushed_at":"2016-07-02T12:46:38Z","git_url":"git://github.com/varblob/catch.git","ssh_url":"git@github.com:varblob/catch.git","clone_url":"https://github.com/varblob/catch.git","svn_url":"https://github.com/varblob/catch","homepage":null,"size":31,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"varblob:master","ref":"master","sha":"a794f6d98f7ebd1d7191f9027e699ffebf5dacb2","user":{"login":"varblob","id":1903054,"avatar_url":"https://avatars.githubusercontent.com/u/1903054?v=3","gravatar_id":"","url":"https://api.github.com/users/varblob","html_url":"https://github.com/varblob","followers_url":"https://api.github.com/users/varblob/followers","following_url":"https://api.github.com/users/varblob/following{/other_user}","gists_url":"https://api.github.com/users/varblob/gists{/gist_id}","starred_url":"https://api.github.com/users/varblob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varblob/subscriptions","organizations_url":"https://api.github.com/users/varblob/orgs","repos_url":"https://api.github.com/users/varblob/repos","events_url":"https://api.github.com/users/varblob/events{/privacy}","received_events_url":"https://api.github.com/users/varblob/received_events","type":"User","site_admin":false},"repo":{"id":62353095,"name":"catch","full_name":"varblob/catch","owner":{"login":"varblob","id":1903054,"avatar_url":"https://avatars.githubusercontent.com/u/1903054?v=3","gravatar_id":"","url":"https://api.github.com/users/varblob","html_url":"https://github.com/varblob","followers_url":"https://api.github.com/users/varblob/followers","following_url":"https://api.github.com/users/varblob/following{/other_user}","gists_url":"https://api.github.com/users/varblob/gists{/gist_id}","starred_url":"https://api.github.com/users/varblob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varblob/subscriptions","organizations_url":"https://api.github.com/users/varblob/orgs","repos_url":"https://api.github.com/users/varblob/repos","events_url":"https://api.github.com/users/varblob/events{/privacy}","received_events_url":"https://api.github.com/users/varblob/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/varblob/catch","description":null,"fork":false,"url":"https://api.github.com/repos/varblob/catch","forks_url":"https://api.github.com/repos/varblob/catch/forks","keys_url":"https://api.github.com/repos/varblob/catch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/varblob/catch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/varblob/catch/teams","hooks_url":"https://api.github.com/repos/varblob/catch/hooks","issue_events_url":"https://api.github.com/repos/varblob/catch/issues/events{/number}","events_url":"https://api.github.com/repos/varblob/catch/events","assignees_url":"https://api.github.com/repos/varblob/catch/assignees{/user}","branches_url":"https://api.github.com/repos/varblob/catch/branches{/branch}","tags_url":"https://api.github.com/repos/varblob/catch/tags","blobs_url":"https://api.github.com/repos/varblob/catch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/varblob/catch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/varblob/catch/git/refs{/sha}","trees_url":"https://api.github.com/repos/varblob/catch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/varblob/catch/statuses/{sha}","languages_url":"https://api.github.com/repos/varblob/catch/languages","stargazers_url":"https://api.github.com/repos/varblob/catch/stargazers","contributors_url":"https://api.github.com/repos/varblob/catch/contributors","subscribers_url":"https://api.github.com/repos/varblob/catch/subscribers","subscription_url":"https://api.github.com/repos/varblob/catch/subscription","commits_url":"https://api.github.com/repos/varblob/catch/commits{/sha}","git_commits_url":"https://api.github.com/repos/varblob/catch/git/commits{/sha}","comments_url":"https://api.github.com/repos/varblob/catch/comments{/number}","issue_comment_url":"https://api.github.com/repos/varblob/catch/issues/comments{/number}","contents_url":"https://api.github.com/repos/varblob/catch/contents/{+path}","compare_url":"https://api.github.com/repos/varblob/catch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/varblob/catch/merges","archive_url":"https://api.github.com/repos/varblob/catch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/varblob/catch/downloads","issues_url":"https://api.github.com/repos/varblob/catch/issues{/number}","pulls_url":"https://api.github.com/repos/varblob/catch/pulls{/number}","milestones_url":"https://api.github.com/repos/varblob/catch/milestones{/number}","notifications_url":"https://api.github.com/repos/varblob/catch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/varblob/catch/labels{/name}","releases_url":"https://api.github.com/repos/varblob/catch/releases{/id}","deployments_url":"https://api.github.com/repos/varblob/catch/deployments","created_at":"2016-07-01T01:28:33Z","updated_at":"2016-07-01T01:28:33Z","pushed_at":"2016-07-02T12:46:38Z","git_url":"git://github.com/varblob/catch.git","ssh_url":"git@github.com:varblob/catch.git","clone_url":"https://github.com/varblob/catch.git","svn_url":"https://github.com/varblob/catch","homepage":null,"size":31,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/varblob/catch/pulls/1"},"html":{"href":"https://github.com/varblob/catch/pull/1"},"issue":{"href":"https://api.github.com/repos/varblob/catch/issues/1"},"comments":{"href":"https://api.github.com/repos/varblob/catch/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/varblob/catch/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/varblob/catch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/varblob/catch/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/varblob/catch/statuses/4146922ab8006242b8021a4195756d7b76b1c213"}}}}
{"actor":{"display_login":"varblob"}}