{"action":"created","comment":{"url":"https://api.github.com/repos/ShaneCallanan/lab2/pulls/comments/41246299","id":41246299,"diff_hunk":"@@ -0,0 +1,113 @@\n+function Game()\n+{\n+\tvar player, goal, platform1, platform2;\n+\n+\tcreateCanvas();\n+\tthis.player = new Player(window.innerWidth / 6, window.innerHeight / 10, window.innerWidth / 100);\n+\tthis.goal = new Goal();\n+\tthis.win = false;\n+\tthis.platform1 = new Platform(window.innerWidth / 6, window.innerHeight / 2, 200, 25);\n+\tthis.platform2 = new Platform(window.innerWidth / 2, window.innerHeight / 3 * 2, 200, 25);\n+}\n+\n+\n+Game.prototype.test = function(e)\n+{\n+\tif (e.keyCode == 97)\n+\t\tgame.player.moveLeft();\n+\telse if (e.keyCode == 100)\n+\t\tgame.player.moveRight();\n+\telse if (e.keyCode == 119)\n+\t\tgame.player.moveUp()\n+\telse if (e.keyCode == 115)\n+\t\tgame.player.moveDown()\n+}\n+\n+\n+Game.prototype.gameLoop = function()\n+{\n+\tconsole.log(\"gameLoop\");\n+\twindow.requestAnimationFrame(game.gameLoop);\n+\n+\t// if not colliding with any platform\n+\tif (!game.checkCollision(game.platform1, game.player) && !game.checkCollision(game.platform2, game.player))\n+\t{\n+\t\tgame.player.gravity();\n+\t}\n+\n+\tgame.draw();\n+}\n+\n+\n+function createCanvas()\n+{\n+\tcanvas = document.createElement(\"canvas\");\n+\tctx = canvas.getContext(\"2d\");\n+\n+\tdocument.body.appendChild(canvas);\n+\tcanvas.width = window.innerWidth;\n+\tcanvas.height = window.innerHeight;\n+}\n+\n+\n+Game.prototype.draw = function()\n+{\n+\tctx.clearRect(0, 0, window.innerWidth, window.innerHeight);\n+\tthis.player.draw();\n+\tthis.platform1.draw();\n+\tthis.platform2.draw();\n+\n+\tif (this.win == false)\n+\t{\n+\t\tthis.goal.draw();\n+\n+\t\tif (this.checkCollision(this.player, this.goal))\n+\t\t{\n+\t\t\tconsole.log(\"WIN\");\n+\t\t\tthis.win = true;\n+\t\t}\n+\t}\n+\telse\n+\t{\n+\t\tctx.save();\n+\t\tctx.fillStyle = rgb(25,25,34);\n+\t\tctx.font = 'italic 40pt Calibri';\n+\t\tctx.textBaseline = \"top\";\n+\t\tctx.fillText(\"Level Complete\", 200, 0);\n+\t\tctx.restore();\n+\t}\n+\t\t\n+}\n+\n+\n+Game.prototype.checkCollision = function(a, b)\n+{\n+\tif (a.x + a.width > b.x && a.x < b.x + b.width &&","path":"game.js","position":85,"original_position":85,"commit_id":"dc5af4bd861522cdd2620a8a0460e235a458d57e","original_commit_id":"dc5af4bd861522cdd2620a8a0460e235a458d57e","user":{"login":"Lanc3","id":14903403,"avatar_url":"https://avatars.githubusercontent.com/u/14903403?v=3","gravatar_id":"","url":"https://api.github.com/users/Lanc3","html_url":"https://github.com/Lanc3","followers_url":"https://api.github.com/users/Lanc3/followers","following_url":"https://api.github.com/users/Lanc3/following{/other_user}","gists_url":"https://api.github.com/users/Lanc3/gists{/gist_id}","starred_url":"https://api.github.com/users/Lanc3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lanc3/subscriptions","organizations_url":"https://api.github.com/users/Lanc3/orgs","repos_url":"https://api.github.com/users/Lanc3/repos","events_url":"https://api.github.com/users/Lanc3/events{/privacy}","received_events_url":"https://api.github.com/users/Lanc3/received_events","type":"User","site_admin":false},"body":"comment the code","created_at":"2015-10-06T10:04:05Z","updated_at":"2015-10-06T10:04:05Z","html_url":"https://github.com/ShaneCallanan/lab2/pull/1#discussion_r41246299","pull_request_url":"https://api.github.com/repos/ShaneCallanan/lab2/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/ShaneCallanan/lab2/pulls/comments/41246299"},"html":{"href":"https://github.com/ShaneCallanan/lab2/pull/1#discussion_r41246299"},"pull_request":{"href":"https://api.github.com/repos/ShaneCallanan/lab2/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/ShaneCallanan/lab2/pulls/1","id":46825114,"html_url":"https://github.com/ShaneCallanan/lab2/pull/1","diff_url":"https://github.com/ShaneCallanan/lab2/pull/1.diff","patch_url":"https://github.com/ShaneCallanan/lab2/pull/1.patch","issue_url":"https://api.github.com/repos/ShaneCallanan/lab2/issues/1","number":1,"state":"open","locked":false,"title":"new Commit","user":{"login":"ShaneCallanan","id":14939291,"avatar_url":"https://avatars.githubusercontent.com/u/14939291?v=3","gravatar_id":"","url":"https://api.github.com/users/ShaneCallanan","html_url":"https://github.com/ShaneCallanan","followers_url":"https://api.github.com/users/ShaneCallanan/followers","following_url":"https://api.github.com/users/ShaneCallanan/following{/other_user}","gists_url":"https://api.github.com/users/ShaneCallanan/gists{/gist_id}","starred_url":"https://api.github.com/users/ShaneCallanan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShaneCallanan/subscriptions","organizations_url":"https://api.github.com/users/ShaneCallanan/orgs","repos_url":"https://api.github.com/users/ShaneCallanan/repos","events_url":"https://api.github.com/users/ShaneCallanan/events{/privacy}","received_events_url":"https://api.github.com/users/ShaneCallanan/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-05T19:51:09Z","updated_at":"2015-10-06T10:04:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3faf9fd404b111035c302af83f3f86f9c6568498","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ShaneCallanan/lab2/pulls/1/commits","review_comments_url":"https://api.github.com/repos/ShaneCallanan/lab2/pulls/1/comments","review_comment_url":"https://api.github.com/repos/ShaneCallanan/lab2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ShaneCallanan/lab2/issues/1/comments","statuses_url":"https://api.github.com/repos/ShaneCallanan/lab2/statuses/dc5af4bd861522cdd2620a8a0460e235a458d57e","head":{"label":"ShaneCallanan:otherBranch","ref":"otherBranch","sha":"dc5af4bd861522cdd2620a8a0460e235a458d57e","user":{"login":"ShaneCallanan","id":14939291,"avatar_url":"https://avatars.githubusercontent.com/u/14939291?v=3","gravatar_id":"","url":"https://api.github.com/users/ShaneCallanan","html_url":"https://github.com/ShaneCallanan","followers_url":"https://api.github.com/users/ShaneCallanan/followers","following_url":"https://api.github.com/users/ShaneCallanan/following{/other_user}","gists_url":"https://api.github.com/users/ShaneCallanan/gists{/gist_id}","starred_url":"https://api.github.com/users/ShaneCallanan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShaneCallanan/subscriptions","organizations_url":"https://api.github.com/users/ShaneCallanan/orgs","repos_url":"https://api.github.com/users/ShaneCallanan/repos","events_url":"https://api.github.com/users/ShaneCallanan/events{/privacy}","received_events_url":"https://api.github.com/users/ShaneCallanan/received_events","type":"User","site_admin":false},"repo":{"id":43709176,"name":"lab2","full_name":"ShaneCallanan/lab2","owner":{"login":"ShaneCallanan","id":14939291,"avatar_url":"https://avatars.githubusercontent.com/u/14939291?v=3","gravatar_id":"","url":"https://api.github.com/users/ShaneCallanan","html_url":"https://github.com/ShaneCallanan","followers_url":"https://api.github.com/users/ShaneCallanan/followers","following_url":"https://api.github.com/users/ShaneCallanan/following{/other_user}","gists_url":"https://api.github.com/users/ShaneCallanan/gists{/gist_id}","starred_url":"https://api.github.com/users/ShaneCallanan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShaneCallanan/subscriptions","organizations_url":"https://api.github.com/users/ShaneCallanan/orgs","repos_url":"https://api.github.com/users/ShaneCallanan/repos","events_url":"https://api.github.com/users/ShaneCallanan/events{/privacy}","received_events_url":"https://api.github.com/users/ShaneCallanan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ShaneCallanan/lab2","description":"Games Devices Lab 2","fork":false,"url":"https://api.github.com/repos/ShaneCallanan/lab2","forks_url":"https://api.github.com/repos/ShaneCallanan/lab2/forks","keys_url":"https://api.github.com/repos/ShaneCallanan/lab2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ShaneCallanan/lab2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ShaneCallanan/lab2/teams","hooks_url":"https://api.github.com/repos/ShaneCallanan/lab2/hooks","issue_events_url":"https://api.github.com/repos/ShaneCallanan/lab2/issues/events{/number}","events_url":"https://api.github.com/repos/ShaneCallanan/lab2/events","assignees_url":"https://api.github.com/repos/ShaneCallanan/lab2/assignees{/user}","branches_url":"https://api.github.com/repos/ShaneCallanan/lab2/branches{/branch}","tags_url":"https://api.github.com/repos/ShaneCallanan/lab2/tags","blobs_url":"https://api.github.com/repos/ShaneCallanan/lab2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ShaneCallanan/lab2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ShaneCallanan/lab2/git/refs{/sha}","trees_url":"https://api.github.com/repos/ShaneCallanan/lab2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ShaneCallanan/lab2/statuses/{sha}","languages_url":"https://api.github.com/repos/ShaneCallanan/lab2/languages","stargazers_url":"https://api.github.com/repos/ShaneCallanan/lab2/stargazers","contributors_url":"https://api.github.com/repos/ShaneCallanan/lab2/contributors","subscribers_url":"https://api.github.com/repos/ShaneCallanan/lab2/subscribers","subscription_url":"https://api.github.com/repos/ShaneCallanan/lab2/subscription","commits_url":"https://api.github.com/repos/ShaneCallanan/lab2/commits{/sha}","git_commits_url":"https://api.github.com/repos/ShaneCallanan/lab2/git/commits{/sha}","comments_url":"https://api.github.com/repos/ShaneCallanan/lab2/comments{/number}","issue_comment_url":"https://api.github.com/repos/ShaneCallanan/lab2/issues/comments{/number}","contents_url":"https://api.github.com/repos/ShaneCallanan/lab2/contents/{+path}","compare_url":"https://api.github.com/repos/ShaneCallanan/lab2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ShaneCallanan/lab2/merges","archive_url":"https://api.github.com/repos/ShaneCallanan/lab2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ShaneCallanan/lab2/downloads","issues_url":"https://api.github.com/repos/ShaneCallanan/lab2/issues{/number}","pulls_url":"https://api.github.com/repos/ShaneCallanan/lab2/pulls{/number}","milestones_url":"https://api.github.com/repos/ShaneCallanan/lab2/milestones{/number}","notifications_url":"https://api.github.com/repos/ShaneCallanan/lab2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ShaneCallanan/lab2/labels{/name}","releases_url":"https://api.github.com/repos/ShaneCallanan/lab2/releases{/id}","created_at":"2015-10-05T19:41:48Z","updated_at":"2015-10-05T19:41:48Z","pushed_at":"2015-10-05T19:51:12Z","git_url":"git://github.com/ShaneCallanan/lab2.git","ssh_url":"git@github.com:ShaneCallanan/lab2.git","clone_url":"https://github.com/ShaneCallanan/lab2.git","svn_url":"https://github.com/ShaneCallanan/lab2","homepage":null,"size":0,"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":"ShaneCallanan:master","ref":"master","sha":"c233e48d45ec4af438b7de95a6456f44d0d5de54","user":{"login":"ShaneCallanan","id":14939291,"avatar_url":"https://avatars.githubusercontent.com/u/14939291?v=3","gravatar_id":"","url":"https://api.github.com/users/ShaneCallanan","html_url":"https://github.com/ShaneCallanan","followers_url":"https://api.github.com/users/ShaneCallanan/followers","following_url":"https://api.github.com/users/ShaneCallanan/following{/other_user}","gists_url":"https://api.github.com/users/ShaneCallanan/gists{/gist_id}","starred_url":"https://api.github.com/users/ShaneCallanan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShaneCallanan/subscriptions","organizations_url":"https://api.github.com/users/ShaneCallanan/orgs","repos_url":"https://api.github.com/users/ShaneCallanan/repos","events_url":"https://api.github.com/users/ShaneCallanan/events{/privacy}","received_events_url":"https://api.github.com/users/ShaneCallanan/received_events","type":"User","site_admin":false},"repo":{"id":43709176,"name":"lab2","full_name":"ShaneCallanan/lab2","owner":{"login":"ShaneCallanan","id":14939291,"avatar_url":"https://avatars.githubusercontent.com/u/14939291?v=3","gravatar_id":"","url":"https://api.github.com/users/ShaneCallanan","html_url":"https://github.com/ShaneCallanan","followers_url":"https://api.github.com/users/ShaneCallanan/followers","following_url":"https://api.github.com/users/ShaneCallanan/following{/other_user}","gists_url":"https://api.github.com/users/ShaneCallanan/gists{/gist_id}","starred_url":"https://api.github.com/users/ShaneCallanan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShaneCallanan/subscriptions","organizations_url":"https://api.github.com/users/ShaneCallanan/orgs","repos_url":"https://api.github.com/users/ShaneCallanan/repos","events_url":"https://api.github.com/users/ShaneCallanan/events{/privacy}","received_events_url":"https://api.github.com/users/ShaneCallanan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ShaneCallanan/lab2","description":"Games Devices Lab 2","fork":false,"url":"https://api.github.com/repos/ShaneCallanan/lab2","forks_url":"https://api.github.com/repos/ShaneCallanan/lab2/forks","keys_url":"https://api.github.com/repos/ShaneCallanan/lab2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ShaneCallanan/lab2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ShaneCallanan/lab2/teams","hooks_url":"https://api.github.com/repos/ShaneCallanan/lab2/hooks","issue_events_url":"https://api.github.com/repos/ShaneCallanan/lab2/issues/events{/number}","events_url":"https://api.github.com/repos/ShaneCallanan/lab2/events","assignees_url":"https://api.github.com/repos/ShaneCallanan/lab2/assignees{/user}","branches_url":"https://api.github.com/repos/ShaneCallanan/lab2/branches{/branch}","tags_url":"https://api.github.com/repos/ShaneCallanan/lab2/tags","blobs_url":"https://api.github.com/repos/ShaneCallanan/lab2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ShaneCallanan/lab2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ShaneCallanan/lab2/git/refs{/sha}","trees_url":"https://api.github.com/repos/ShaneCallanan/lab2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ShaneCallanan/lab2/statuses/{sha}","languages_url":"https://api.github.com/repos/ShaneCallanan/lab2/languages","stargazers_url":"https://api.github.com/repos/ShaneCallanan/lab2/stargazers","contributors_url":"https://api.github.com/repos/ShaneCallanan/lab2/contributors","subscribers_url":"https://api.github.com/repos/ShaneCallanan/lab2/subscribers","subscription_url":"https://api.github.com/repos/ShaneCallanan/lab2/subscription","commits_url":"https://api.github.com/repos/ShaneCallanan/lab2/commits{/sha}","git_commits_url":"https://api.github.com/repos/ShaneCallanan/lab2/git/commits{/sha}","comments_url":"https://api.github.com/repos/ShaneCallanan/lab2/comments{/number}","issue_comment_url":"https://api.github.com/repos/ShaneCallanan/lab2/issues/comments{/number}","contents_url":"https://api.github.com/repos/ShaneCallanan/lab2/contents/{+path}","compare_url":"https://api.github.com/repos/ShaneCallanan/lab2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ShaneCallanan/lab2/merges","archive_url":"https://api.github.com/repos/ShaneCallanan/lab2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ShaneCallanan/lab2/downloads","issues_url":"https://api.github.com/repos/ShaneCallanan/lab2/issues{/number}","pulls_url":"https://api.github.com/repos/ShaneCallanan/lab2/pulls{/number}","milestones_url":"https://api.github.com/repos/ShaneCallanan/lab2/milestones{/number}","notifications_url":"https://api.github.com/repos/ShaneCallanan/lab2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ShaneCallanan/lab2/labels{/name}","releases_url":"https://api.github.com/repos/ShaneCallanan/lab2/releases{/id}","created_at":"2015-10-05T19:41:48Z","updated_at":"2015-10-05T19:41:48Z","pushed_at":"2015-10-05T19:51:12Z","git_url":"git://github.com/ShaneCallanan/lab2.git","ssh_url":"git@github.com:ShaneCallanan/lab2.git","clone_url":"https://github.com/ShaneCallanan/lab2.git","svn_url":"https://github.com/ShaneCallanan/lab2","homepage":null,"size":0,"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/ShaneCallanan/lab2/pulls/1"},"html":{"href":"https://github.com/ShaneCallanan/lab2/pull/1"},"issue":{"href":"https://api.github.com/repos/ShaneCallanan/lab2/issues/1"},"comments":{"href":"https://api.github.com/repos/ShaneCallanan/lab2/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/ShaneCallanan/lab2/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/ShaneCallanan/lab2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ShaneCallanan/lab2/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/ShaneCallanan/lab2/statuses/dc5af4bd861522cdd2620a8a0460e235a458d57e"}}}}