{"action":"created","comment":{"url":"https://api.github.com/repos/wdi-hk-9/frag/pulls/comments/42088665","id":42088665,"diff_hunk":"@@ -0,0 +1,157 @@\n+var utils = (function () {\n+\n+var\n+  FONT_MENU = \"20px 'Orbitron' sans-serif\",\n+  shipConfig = [\n+    // medium fire, medium sized ammo, medium range, medium damage, gray ship (0)\n+    {\n+      spriteIndexArr: [0],\n+      omega: 3,\n+      speed: 3,\n+      firingDelay: 15,\n+      ammoSpec: {\n+        speed: 9, // multiples of 3\n+        size: 30,\n+        life: 40,\n+        damage: 10\n+      },\n+      text: \"Vindicator: A balanced ship, with decent fire rate, range and damage\"\n+    },\n+    // medium fire, medium sized ammo, medium range, medium damage, green ship (1)\n+    {\n+      spriteIndexArr: [1],\n+      omega: 3,\n+      speed: 3,\n+      firingDelay: 15,\n+      ammoSpec: {\n+        speed: 9, // multiples of 3\n+        size: 30,\n+        life: 40,\n+        damage: 10\n+      },\n+      text: \"Phasor: A balanced ship, with decent fire rate, range and damage\"\n+    },\n+    // fast fire, big ammo, very short range, high damage red ship (2)\n+    {\n+      spriteIndexArr: [2],\n+      omega: 3,\n+      speed: 3,\n+      firingDelay: 2, // no of frames before next shot can be fired\n+      ammoSpec: {\n+        speed: 6, // multiples of 3\n+        size: 70, // ammo size in px\n+        life: 20, // ammo life in frames\n+        damage: 15 // damage dealt\n+      },\n+      text: \"Warbird: Rapid fire and high damage but extremely short range\"\n+    },\n+    // slow fire, big ammo, long range, high damage, purple ship (3)\n+    {\n+      spriteIndexArr: [3],\n+      omega: 3,\n+      speed: 3,\n+      firingDelay: 30,\n+      ammoSpec: {\n+        speed: 9, // multiples of 3\n+        size: 70,\n+        life: 80,\n+        damage: 15\n+      },\n+      text: \"Explorer: Long ranged, high damage weapon but slow rate of fire\"\n+    },\n+    // fast fire, small ammo, long range, low damage, yellow ship (4)\n+    {\n+      spriteIndexArr: [4],\n+      omega: 3,\n+      speed: 3,\n+      firingDelay: 5, // no of frames before next shot can be fired\n+      ammoSpec: {\n+        speed: 6, // multiples of 3\n+        size: 20, // ammo size in px\n+        life: 120, // ammo life in frames\n+        damage: 3 // damage dealt\n+      },\n+      text: \"Stinger: Rapid fire, long ranged, light damage dealer\"\n+    }\n+  ],\n+  currentMenuDisplay = \"PLAYER 1\",\n+  playerOneChoice = null,\n+  playerTwoChoice = null;\n+\n+\n+function bindKeys(playerOne, playerTwo) {\n+  // bind keys for playerOne\n+  $(document).on(\n+    'keydown',\n+    function(e) {\n+      if (e.keyCode === 87) playerOne.MOVE_FORWARD = true; // w","path":"js/utils.js","position":87,"original_position":87,"commit_id":"b643a12905f61f4b6c2f136416a2d48e74b4aba3","original_commit_id":"340c9a547554a5e461dd271f46ebc5352a5a25c0","user":{"login":"ianienchoo","id":9160467,"avatar_url":"https://avatars.githubusercontent.com/u/9160467?v=3","gravatar_id":"","url":"https://api.github.com/users/ianienchoo","html_url":"https://github.com/ianienchoo","followers_url":"https://api.github.com/users/ianienchoo/followers","following_url":"https://api.github.com/users/ianienchoo/following{/other_user}","gists_url":"https://api.github.com/users/ianienchoo/gists{/gist_id}","starred_url":"https://api.github.com/users/ianienchoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianienchoo/subscriptions","organizations_url":"https://api.github.com/users/ianienchoo/orgs","repos_url":"https://api.github.com/users/ianienchoo/repos","events_url":"https://api.github.com/users/ianienchoo/events{/privacy}","received_events_url":"https://api.github.com/users/ianienchoo/received_events","type":"User","site_admin":false},"body":"all replaced as suggested","created_at":"2015-10-15T06:55:20Z","updated_at":"2015-10-15T06:55:20Z","html_url":"https://github.com/wdi-hk-9/frag/pull/3#discussion_r42088665","pull_request_url":"https://api.github.com/repos/wdi-hk-9/frag/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/wdi-hk-9/frag/pulls/comments/42088665"},"html":{"href":"https://github.com/wdi-hk-9/frag/pull/3#discussion_r42088665"},"pull_request":{"href":"https://api.github.com/repos/wdi-hk-9/frag/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/wdi-hk-9/frag/pulls/3","id":47740902,"html_url":"https://github.com/wdi-hk-9/frag/pull/3","diff_url":"https://github.com/wdi-hk-9/frag/pull/3.diff","patch_url":"https://github.com/wdi-hk-9/frag/pull/3.patch","issue_url":"https://api.github.com/repos/wdi-hk-9/frag/issues/3","number":3,"state":"open","locked":false,"title":"Completed game","user":{"login":"ianienchoo","id":9160467,"avatar_url":"https://avatars.githubusercontent.com/u/9160467?v=3","gravatar_id":"","url":"https://api.github.com/users/ianienchoo","html_url":"https://github.com/ianienchoo","followers_url":"https://api.github.com/users/ianienchoo/followers","following_url":"https://api.github.com/users/ianienchoo/following{/other_user}","gists_url":"https://api.github.com/users/ianienchoo/gists{/gist_id}","starred_url":"https://api.github.com/users/ianienchoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianienchoo/subscriptions","organizations_url":"https://api.github.com/users/ianienchoo/orgs","repos_url":"https://api.github.com/users/ianienchoo/repos","events_url":"https://api.github.com/users/ianienchoo/events{/privacy}","received_events_url":"https://api.github.com/users/ianienchoo/received_events","type":"User","site_admin":false},"body":"Game objects refactored to use \"new\" keyword syntax, rather than the functional paradigm for object creation (re: JavaScript: The Good Parts).","created_at":"2015-10-15T03:32:24Z","updated_at":"2015-10-15T06:55:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"77595d4d03762761b4f79ac62bcc74d27e7d3768","assignee":{"login":"f3r","id":970858,"avatar_url":"https://avatars.githubusercontent.com/u/970858?v=3","gravatar_id":"","url":"https://api.github.com/users/f3r","html_url":"https://github.com/f3r","followers_url":"https://api.github.com/users/f3r/followers","following_url":"https://api.github.com/users/f3r/following{/other_user}","gists_url":"https://api.github.com/users/f3r/gists{/gist_id}","starred_url":"https://api.github.com/users/f3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f3r/subscriptions","organizations_url":"https://api.github.com/users/f3r/orgs","repos_url":"https://api.github.com/users/f3r/repos","events_url":"https://api.github.com/users/f3r/events{/privacy}","received_events_url":"https://api.github.com/users/f3r/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/wdi-hk-9/frag/pulls/3/commits","review_comments_url":"https://api.github.com/repos/wdi-hk-9/frag/pulls/3/comments","review_comment_url":"https://api.github.com/repos/wdi-hk-9/frag/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wdi-hk-9/frag/issues/3/comments","statuses_url":"https://api.github.com/repos/wdi-hk-9/frag/statuses/b643a12905f61f4b6c2f136416a2d48e74b4aba3","head":{"label":"ianienchoo:add-sprites","ref":"add-sprites","sha":"b643a12905f61f4b6c2f136416a2d48e74b4aba3","user":{"login":"ianienchoo","id":9160467,"avatar_url":"https://avatars.githubusercontent.com/u/9160467?v=3","gravatar_id":"","url":"https://api.github.com/users/ianienchoo","html_url":"https://github.com/ianienchoo","followers_url":"https://api.github.com/users/ianienchoo/followers","following_url":"https://api.github.com/users/ianienchoo/following{/other_user}","gists_url":"https://api.github.com/users/ianienchoo/gists{/gist_id}","starred_url":"https://api.github.com/users/ianienchoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianienchoo/subscriptions","organizations_url":"https://api.github.com/users/ianienchoo/orgs","repos_url":"https://api.github.com/users/ianienchoo/repos","events_url":"https://api.github.com/users/ianienchoo/events{/privacy}","received_events_url":"https://api.github.com/users/ianienchoo/received_events","type":"User","site_admin":false},"repo":{"id":44082686,"name":"frag","full_name":"ianienchoo/frag","owner":{"login":"ianienchoo","id":9160467,"avatar_url":"https://avatars.githubusercontent.com/u/9160467?v=3","gravatar_id":"","url":"https://api.github.com/users/ianienchoo","html_url":"https://github.com/ianienchoo","followers_url":"https://api.github.com/users/ianienchoo/followers","following_url":"https://api.github.com/users/ianienchoo/following{/other_user}","gists_url":"https://api.github.com/users/ianienchoo/gists{/gist_id}","starred_url":"https://api.github.com/users/ianienchoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianienchoo/subscriptions","organizations_url":"https://api.github.com/users/ianienchoo/orgs","repos_url":"https://api.github.com/users/ianienchoo/repos","events_url":"https://api.github.com/users/ianienchoo/events{/privacy}","received_events_url":"https://api.github.com/users/ianienchoo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ianienchoo/frag","description":"","fork":true,"url":"https://api.github.com/repos/ianienchoo/frag","forks_url":"https://api.github.com/repos/ianienchoo/frag/forks","keys_url":"https://api.github.com/repos/ianienchoo/frag/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ianienchoo/frag/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ianienchoo/frag/teams","hooks_url":"https://api.github.com/repos/ianienchoo/frag/hooks","issue_events_url":"https://api.github.com/repos/ianienchoo/frag/issues/events{/number}","events_url":"https://api.github.com/repos/ianienchoo/frag/events","assignees_url":"https://api.github.com/repos/ianienchoo/frag/assignees{/user}","branches_url":"https://api.github.com/repos/ianienchoo/frag/branches{/branch}","tags_url":"https://api.github.com/repos/ianienchoo/frag/tags","blobs_url":"https://api.github.com/repos/ianienchoo/frag/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ianienchoo/frag/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ianienchoo/frag/git/refs{/sha}","trees_url":"https://api.github.com/repos/ianienchoo/frag/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ianienchoo/frag/statuses/{sha}","languages_url":"https://api.github.com/repos/ianienchoo/frag/languages","stargazers_url":"https://api.github.com/repos/ianienchoo/frag/stargazers","contributors_url":"https://api.github.com/repos/ianienchoo/frag/contributors","subscribers_url":"https://api.github.com/repos/ianienchoo/frag/subscribers","subscription_url":"https://api.github.com/repos/ianienchoo/frag/subscription","commits_url":"https://api.github.com/repos/ianienchoo/frag/commits{/sha}","git_commits_url":"https://api.github.com/repos/ianienchoo/frag/git/commits{/sha}","comments_url":"https://api.github.com/repos/ianienchoo/frag/comments{/number}","issue_comment_url":"https://api.github.com/repos/ianienchoo/frag/issues/comments{/number}","contents_url":"https://api.github.com/repos/ianienchoo/frag/contents/{+path}","compare_url":"https://api.github.com/repos/ianienchoo/frag/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ianienchoo/frag/merges","archive_url":"https://api.github.com/repos/ianienchoo/frag/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ianienchoo/frag/downloads","issues_url":"https://api.github.com/repos/ianienchoo/frag/issues{/number}","pulls_url":"https://api.github.com/repos/ianienchoo/frag/pulls{/number}","milestones_url":"https://api.github.com/repos/ianienchoo/frag/milestones{/number}","notifications_url":"https://api.github.com/repos/ianienchoo/frag/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ianienchoo/frag/labels{/name}","releases_url":"https://api.github.com/repos/ianienchoo/frag/releases{/id}","created_at":"2015-10-12T03:44:38Z","updated_at":"2015-10-12T04:20:35Z","pushed_at":"2015-10-15T05:52:02Z","git_url":"git://github.com/ianienchoo/frag.git","ssh_url":"git@github.com:ianienchoo/frag.git","clone_url":"https://github.com/ianienchoo/frag.git","svn_url":"https://github.com/ianienchoo/frag","homepage":"http://wdi-hk-9.github.io/frag/","size":0,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"gh-pages"}},"base":{"label":"wdi-hk-9:gh-pages","ref":"gh-pages","sha":"152a90b241af44ff325cea217874fbd37e9b72fc","user":{"login":"wdi-hk-9","id":14694302,"avatar_url":"https://avatars.githubusercontent.com/u/14694302?v=3","gravatar_id":"","url":"https://api.github.com/users/wdi-hk-9","html_url":"https://github.com/wdi-hk-9","followers_url":"https://api.github.com/users/wdi-hk-9/followers","following_url":"https://api.github.com/users/wdi-hk-9/following{/other_user}","gists_url":"https://api.github.com/users/wdi-hk-9/gists{/gist_id}","starred_url":"https://api.github.com/users/wdi-hk-9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wdi-hk-9/subscriptions","organizations_url":"https://api.github.com/users/wdi-hk-9/orgs","repos_url":"https://api.github.com/users/wdi-hk-9/repos","events_url":"https://api.github.com/users/wdi-hk-9/events{/privacy}","received_events_url":"https://api.github.com/users/wdi-hk-9/received_events","type":"Organization","site_admin":false},"repo":{"id":44081436,"name":"frag","full_name":"wdi-hk-9/frag","owner":{"login":"wdi-hk-9","id":14694302,"avatar_url":"https://avatars.githubusercontent.com/u/14694302?v=3","gravatar_id":"","url":"https://api.github.com/users/wdi-hk-9","html_url":"https://github.com/wdi-hk-9","followers_url":"https://api.github.com/users/wdi-hk-9/followers","following_url":"https://api.github.com/users/wdi-hk-9/following{/other_user}","gists_url":"https://api.github.com/users/wdi-hk-9/gists{/gist_id}","starred_url":"https://api.github.com/users/wdi-hk-9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wdi-hk-9/subscriptions","organizations_url":"https://api.github.com/users/wdi-hk-9/orgs","repos_url":"https://api.github.com/users/wdi-hk-9/repos","events_url":"https://api.github.com/users/wdi-hk-9/events{/privacy}","received_events_url":"https://api.github.com/users/wdi-hk-9/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wdi-hk-9/frag","description":"","fork":false,"url":"https://api.github.com/repos/wdi-hk-9/frag","forks_url":"https://api.github.com/repos/wdi-hk-9/frag/forks","keys_url":"https://api.github.com/repos/wdi-hk-9/frag/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wdi-hk-9/frag/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wdi-hk-9/frag/teams","hooks_url":"https://api.github.com/repos/wdi-hk-9/frag/hooks","issue_events_url":"https://api.github.com/repos/wdi-hk-9/frag/issues/events{/number}","events_url":"https://api.github.com/repos/wdi-hk-9/frag/events","assignees_url":"https://api.github.com/repos/wdi-hk-9/frag/assignees{/user}","branches_url":"https://api.github.com/repos/wdi-hk-9/frag/branches{/branch}","tags_url":"https://api.github.com/repos/wdi-hk-9/frag/tags","blobs_url":"https://api.github.com/repos/wdi-hk-9/frag/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wdi-hk-9/frag/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wdi-hk-9/frag/git/refs{/sha}","trees_url":"https://api.github.com/repos/wdi-hk-9/frag/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wdi-hk-9/frag/statuses/{sha}","languages_url":"https://api.github.com/repos/wdi-hk-9/frag/languages","stargazers_url":"https://api.github.com/repos/wdi-hk-9/frag/stargazers","contributors_url":"https://api.github.com/repos/wdi-hk-9/frag/contributors","subscribers_url":"https://api.github.com/repos/wdi-hk-9/frag/subscribers","subscription_url":"https://api.github.com/repos/wdi-hk-9/frag/subscription","commits_url":"https://api.github.com/repos/wdi-hk-9/frag/commits{/sha}","git_commits_url":"https://api.github.com/repos/wdi-hk-9/frag/git/commits{/sha}","comments_url":"https://api.github.com/repos/wdi-hk-9/frag/comments{/number}","issue_comment_url":"https://api.github.com/repos/wdi-hk-9/frag/issues/comments{/number}","contents_url":"https://api.github.com/repos/wdi-hk-9/frag/contents/{+path}","compare_url":"https://api.github.com/repos/wdi-hk-9/frag/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wdi-hk-9/frag/merges","archive_url":"https://api.github.com/repos/wdi-hk-9/frag/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wdi-hk-9/frag/downloads","issues_url":"https://api.github.com/repos/wdi-hk-9/frag/issues{/number}","pulls_url":"https://api.github.com/repos/wdi-hk-9/frag/pulls{/number}","milestones_url":"https://api.github.com/repos/wdi-hk-9/frag/milestones{/number}","notifications_url":"https://api.github.com/repos/wdi-hk-9/frag/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wdi-hk-9/frag/labels{/name}","releases_url":"https://api.github.com/repos/wdi-hk-9/frag/releases{/id}","created_at":"2015-10-12T03:12:32Z","updated_at":"2015-10-12T04:57:27Z","pushed_at":"2015-10-15T05:52:03Z","git_url":"git://github.com/wdi-hk-9/frag.git","ssh_url":"git@github.com:wdi-hk-9/frag.git","clone_url":"https://github.com/wdi-hk-9/frag.git","svn_url":"https://github.com/wdi-hk-9/frag","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"gh-pages"}},"_links":{"self":{"href":"https://api.github.com/repos/wdi-hk-9/frag/pulls/3"},"html":{"href":"https://github.com/wdi-hk-9/frag/pull/3"},"issue":{"href":"https://api.github.com/repos/wdi-hk-9/frag/issues/3"},"comments":{"href":"https://api.github.com/repos/wdi-hk-9/frag/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/wdi-hk-9/frag/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/wdi-hk-9/frag/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wdi-hk-9/frag/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/wdi-hk-9/frag/statuses/b643a12905f61f4b6c2f136416a2d48e74b4aba3"}}}}