{"action":"created","comment":{"url":"https://api.github.com/repos/dalderliesten/Scrumbledore/pulls/comments/38944500","id":38944500,"diff_hunk":"@@ -147,7 +148,83 @@ public void handle(ActionEvent arg0) {\n     bottomItems.getChildren().addAll(startStopButton, settingsButton, exitButton);\n     contentHandler.setBottom(bottomItems);\n \n-    // Displaying the user interface.\n-    gameStage.show();\n+    // Calling the dynamic handling for the GUI.\n+    spawnDynamic(gameStage, gamePainter);\n+  }\n+\n+  /**\n+   * spawnDynamic takes care of elements which must be updated, such as players and enemies.\n+   * \n+   * @pre method called within the class and valid parameters passed\n+   * @post spawns and handles dynamic elemens of the game\n+   * @param passedStage\n+   *          The stage used by the rest of the GUI\n+   * @param passedScene\n+   *          The scene used by the rest of the GUI\n+   * @param passedPane\n+   *          The layout pane used by the rest of the GUI\n+   * \n+   */\n+  private void spawnDynamic(Stage passedStage, final GraphicsContext gamePainter) {\n+    new AnimationTimer() {\n+      public void handle(long currentNanoTime) {\n+        // Clear canvas\n+        gamePainter.clearRect(0, 0, Constants.GUIX, Constants.GUIY);\n+        // background image clears canvas\n+        // Adding the initial player location to the GUI.\n+        playerSprite = new Image(Constants.PLAYER_SPRITE);\n+        gamePainter.drawImage(playerSprite,\n+            game.getCurrentLevel().getPlayer().getPosition().getX(), game.getCurrentLevel()\n+                .getPlayer().getPosition().getY());\n+\n+        // Placing the platform elements within the level.\n+        for (Platform current : game.getCurrentLevel().getPlatforms()) {\n+          // Painting the current platform image at the desired x and y location given by the\n+          // vector.\n+          gamePainter.drawImage(new Image(Constants.PLATFORM_SPRITE), current.getPosition().getX(),\n+              current.getPosition().getY());\n+        }\n+      }\n+    }.start();\n+\n+    passedStage.show();\n+  }\n+\n+  private void addKeyEventListeners(Scene scene) {\n+    // KeyPress Event handlers.\n+    scene.setOnKeyPressed(new EventHandler<KeyEvent>() {\n+\n+      // Handling the key press.\n+      public void handle(KeyEvent keyPressed) {\n+        String keyPress = keyPressed.getCode().toString();\n+\n+        // Mapping the desired keys to the desired actions.\n+        if (keyPress.equals(\"LEFT\")) {","path":"src/main/java/nl/tudelft/scrumbledore/ScrumbledoreGUI.java","position":152,"original_position":152,"commit_id":"ac0391b6b56ac94a1b51a71509dd86e1ccfbacfc","original_commit_id":"ac0391b6b56ac94a1b51a71509dd86e1ccfbacfc","user":{"login":"NielsWarnars","id":9715363,"avatar_url":"https://avatars.githubusercontent.com/u/9715363?v=3","gravatar_id":"","url":"https://api.github.com/users/NielsWarnars","html_url":"https://github.com/NielsWarnars","followers_url":"https://api.github.com/users/NielsWarnars/followers","following_url":"https://api.github.com/users/NielsWarnars/following{/other_user}","gists_url":"https://api.github.com/users/NielsWarnars/gists{/gist_id}","starred_url":"https://api.github.com/users/NielsWarnars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NielsWarnars/subscriptions","organizations_url":"https://api.github.com/users/NielsWarnars/orgs","repos_url":"https://api.github.com/users/NielsWarnars/repos","events_url":"https://api.github.com/users/NielsWarnars/events{/privacy}","received_events_url":"https://api.github.com/users/NielsWarnars/received_events","type":"User","site_admin":false},"body":"One small thing, couldn't this better be done better by comparing keycodes instead of strings?","created_at":"2015-09-08T16:05:32Z","updated_at":"2015-09-08T16:05:32Z","html_url":"https://github.com/dalderliesten/Scrumbledore/pull/52#discussion_r38944500","pull_request_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/pulls/52","_links":{"self":{"href":"https://api.github.com/repos/dalderliesten/Scrumbledore/pulls/comments/38944500"},"html":{"href":"https://github.com/dalderliesten/Scrumbledore/pull/52#discussion_r38944500"},"pull_request":{"href":"https://api.github.com/repos/dalderliesten/Scrumbledore/pulls/52"}}},"pull_request":{"url":"https://api.github.com/repos/dalderliesten/Scrumbledore/pulls/52","id":44450042,"html_url":"https://github.com/dalderliesten/Scrumbledore/pull/52","diff_url":"https://github.com/dalderliesten/Scrumbledore/pull/52.diff","patch_url":"https://github.com/dalderliesten/Scrumbledore/pull/52.patch","issue_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/issues/52","number":52,"state":"closed","locked":false,"title":"Css development","user":{"login":"jessetilro","id":4137711,"avatar_url":"https://avatars.githubusercontent.com/u/4137711?v=3","gravatar_id":"","url":"https://api.github.com/users/jessetilro","html_url":"https://github.com/jessetilro","followers_url":"https://api.github.com/users/jessetilro/followers","following_url":"https://api.github.com/users/jessetilro/following{/other_user}","gists_url":"https://api.github.com/users/jessetilro/gists{/gist_id}","starred_url":"https://api.github.com/users/jessetilro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessetilro/subscriptions","organizations_url":"https://api.github.com/users/jessetilro/orgs","repos_url":"https://api.github.com/users/jessetilro/repos","events_url":"https://api.github.com/users/jessetilro/events{/privacy}","received_events_url":"https://api.github.com/users/jessetilro/received_events","type":"User","site_admin":false},"body":"Finished core of the GUI and Frame Animation and added basic Key event handling for player controls.","created_at":"2015-09-08T15:57:44Z","updated_at":"2015-09-08T16:05:32Z","closed_at":"2015-09-08T16:04:15Z","merged_at":"2015-09-08T16:04:15Z","merge_commit_sha":"2ead16fc82e3e782f2e5480dcb699c1402bf2f69","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/pulls/52/commits","review_comments_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/pulls/52/comments","review_comment_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/issues/52/comments","statuses_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/statuses/ac0391b6b56ac94a1b51a71509dd86e1ccfbacfc","head":{"label":"dalderliesten:css-development","ref":"css-development","sha":"ac0391b6b56ac94a1b51a71509dd86e1ccfbacfc","user":{"login":"dalderliesten","id":9768494,"avatar_url":"https://avatars.githubusercontent.com/u/9768494?v=3","gravatar_id":"","url":"https://api.github.com/users/dalderliesten","html_url":"https://github.com/dalderliesten","followers_url":"https://api.github.com/users/dalderliesten/followers","following_url":"https://api.github.com/users/dalderliesten/following{/other_user}","gists_url":"https://api.github.com/users/dalderliesten/gists{/gist_id}","starred_url":"https://api.github.com/users/dalderliesten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dalderliesten/subscriptions","organizations_url":"https://api.github.com/users/dalderliesten/orgs","repos_url":"https://api.github.com/users/dalderliesten/repos","events_url":"https://api.github.com/users/dalderliesten/events{/privacy}","received_events_url":"https://api.github.com/users/dalderliesten/received_events","type":"User","site_admin":false},"repo":{"id":41685322,"name":"Scrumbledore","full_name":"dalderliesten/Scrumbledore","owner":{"login":"dalderliesten","id":9768494,"avatar_url":"https://avatars.githubusercontent.com/u/9768494?v=3","gravatar_id":"","url":"https://api.github.com/users/dalderliesten","html_url":"https://github.com/dalderliesten","followers_url":"https://api.github.com/users/dalderliesten/followers","following_url":"https://api.github.com/users/dalderliesten/following{/other_user}","gists_url":"https://api.github.com/users/dalderliesten/gists{/gist_id}","starred_url":"https://api.github.com/users/dalderliesten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dalderliesten/subscriptions","organizations_url":"https://api.github.com/users/dalderliesten/orgs","repos_url":"https://api.github.com/users/dalderliesten/repos","events_url":"https://api.github.com/users/dalderliesten/events{/privacy}","received_events_url":"https://api.github.com/users/dalderliesten/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dalderliesten/Scrumbledore","description":"Repository for project group 12 at the TU Delft.","fork":false,"url":"https://api.github.com/repos/dalderliesten/Scrumbledore","forks_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/forks","keys_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/teams","hooks_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/hooks","issue_events_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/issues/events{/number}","events_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/events","assignees_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/assignees{/user}","branches_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/branches{/branch}","tags_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/tags","blobs_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/git/refs{/sha}","trees_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/statuses/{sha}","languages_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/languages","stargazers_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/stargazers","contributors_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/contributors","subscribers_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/subscribers","subscription_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/subscription","commits_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/commits{/sha}","git_commits_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/git/commits{/sha}","comments_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/comments{/number}","issue_comment_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/issues/comments{/number}","contents_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/contents/{+path}","compare_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/merges","archive_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/downloads","issues_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/issues{/number}","pulls_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/pulls{/number}","milestones_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/milestones{/number}","notifications_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/labels{/name}","releases_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/releases{/id}","created_at":"2015-08-31T15:55:51Z","updated_at":"2015-09-06T20:17:58Z","pushed_at":"2015-09-08T16:04:17Z","git_url":"git://github.com/dalderliesten/Scrumbledore.git","ssh_url":"git@github.com:dalderliesten/Scrumbledore.git","clone_url":"https://github.com/dalderliesten/Scrumbledore.git","svn_url":"https://github.com/dalderliesten/Scrumbledore","homepage":null,"size":1376,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"dalderliesten:release","ref":"release","sha":"e3d998bf254825d51e484bbadcf207a8d48d883b","user":{"login":"dalderliesten","id":9768494,"avatar_url":"https://avatars.githubusercontent.com/u/9768494?v=3","gravatar_id":"","url":"https://api.github.com/users/dalderliesten","html_url":"https://github.com/dalderliesten","followers_url":"https://api.github.com/users/dalderliesten/followers","following_url":"https://api.github.com/users/dalderliesten/following{/other_user}","gists_url":"https://api.github.com/users/dalderliesten/gists{/gist_id}","starred_url":"https://api.github.com/users/dalderliesten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dalderliesten/subscriptions","organizations_url":"https://api.github.com/users/dalderliesten/orgs","repos_url":"https://api.github.com/users/dalderliesten/repos","events_url":"https://api.github.com/users/dalderliesten/events{/privacy}","received_events_url":"https://api.github.com/users/dalderliesten/received_events","type":"User","site_admin":false},"repo":{"id":41685322,"name":"Scrumbledore","full_name":"dalderliesten/Scrumbledore","owner":{"login":"dalderliesten","id":9768494,"avatar_url":"https://avatars.githubusercontent.com/u/9768494?v=3","gravatar_id":"","url":"https://api.github.com/users/dalderliesten","html_url":"https://github.com/dalderliesten","followers_url":"https://api.github.com/users/dalderliesten/followers","following_url":"https://api.github.com/users/dalderliesten/following{/other_user}","gists_url":"https://api.github.com/users/dalderliesten/gists{/gist_id}","starred_url":"https://api.github.com/users/dalderliesten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dalderliesten/subscriptions","organizations_url":"https://api.github.com/users/dalderliesten/orgs","repos_url":"https://api.github.com/users/dalderliesten/repos","events_url":"https://api.github.com/users/dalderliesten/events{/privacy}","received_events_url":"https://api.github.com/users/dalderliesten/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dalderliesten/Scrumbledore","description":"Repository for project group 12 at the TU Delft.","fork":false,"url":"https://api.github.com/repos/dalderliesten/Scrumbledore","forks_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/forks","keys_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/teams","hooks_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/hooks","issue_events_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/issues/events{/number}","events_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/events","assignees_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/assignees{/user}","branches_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/branches{/branch}","tags_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/tags","blobs_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/git/refs{/sha}","trees_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/statuses/{sha}","languages_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/languages","stargazers_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/stargazers","contributors_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/contributors","subscribers_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/subscribers","subscription_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/subscription","commits_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/commits{/sha}","git_commits_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/git/commits{/sha}","comments_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/comments{/number}","issue_comment_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/issues/comments{/number}","contents_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/contents/{+path}","compare_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/merges","archive_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/downloads","issues_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/issues{/number}","pulls_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/pulls{/number}","milestones_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/milestones{/number}","notifications_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/labels{/name}","releases_url":"https://api.github.com/repos/dalderliesten/Scrumbledore/releases{/id}","created_at":"2015-08-31T15:55:51Z","updated_at":"2015-09-06T20:17:58Z","pushed_at":"2015-09-08T16:04:17Z","git_url":"git://github.com/dalderliesten/Scrumbledore.git","ssh_url":"git@github.com:dalderliesten/Scrumbledore.git","clone_url":"https://github.com/dalderliesten/Scrumbledore.git","svn_url":"https://github.com/dalderliesten/Scrumbledore","homepage":null,"size":1376,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dalderliesten/Scrumbledore/pulls/52"},"html":{"href":"https://github.com/dalderliesten/Scrumbledore/pull/52"},"issue":{"href":"https://api.github.com/repos/dalderliesten/Scrumbledore/issues/52"},"comments":{"href":"https://api.github.com/repos/dalderliesten/Scrumbledore/issues/52/comments"},"review_comments":{"href":"https://api.github.com/repos/dalderliesten/Scrumbledore/pulls/52/comments"},"review_comment":{"href":"https://api.github.com/repos/dalderliesten/Scrumbledore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dalderliesten/Scrumbledore/pulls/52/commits"},"statuses":{"href":"https://api.github.com/repos/dalderliesten/Scrumbledore/statuses/ac0391b6b56ac94a1b51a71509dd86e1ccfbacfc"}}}}