{"action":"created","comment":{"url":"https://api.github.com/repos/seriyalexandrov/Education-Center/pulls/comments/83114359","pull_request_review_id":3973931,"id":83114359,"diff_hunk":"@@ -0,0 +1,161 @@\n+import javax.imageio.ImageIO;\r\n+import javax.swing.*;\r\n+import java.awt.*;\r\n+import java.awt.event.ActionEvent;\r\n+import java.awt.event.ActionListener;\r\n+import java.awt.event.KeyEvent;\r\n+import java.awt.event.KeyListener;\r\n+import java.io.File;\r\n+\r\n+/**\r\n+ * Created by KrasnikovRoman on 05.04.2016.\r\n+ */\r\n+public class MyPanel extends JPanel implements ActionListener {\r\n+    public static final int WIDTHBUTTON = 120;\r\n+    public static final int HEIGHTBUTTON = 50;\r\n+    public static final int SCALE = 20;\r\n+    private Image backGround, body, head, apple, endOfGame;\r\n+    private Game game;\r\n+    private Timer tmDraw, tmUpdate;\r\n+    private MyPanel panel;\r\n+    JButton exit, newGame;\r\n+    JLabel score;\r\n+\r\n+    MyPanel() {\r\n+        panel = this;\r\n+        try {\r\n+            backGround = ImageIO.read(new File(\"C:\\\\Users\\\\KrasnikovRoman\\\\Desktop\\\\Java\\\\newSnake\\\\img\\\\BackGround.png\"));\r\n+            body = ImageIO.read(new File(\"C:\\\\Users\\\\KrasnikovRoman\\\\Desktop\\\\Java\\\\newSnake\\\\img\\\\BodySnake.png\"));\r\n+            head = ImageIO.read(new File(\"C:\\\\Users\\\\KrasnikovRoman\\\\Desktop\\\\Java\\\\newSnake\\\\img\\\\HeadSnake.png\"));\r\n+            apple = ImageIO.read(new File(\"C:\\\\Users\\\\KrasnikovRoman\\\\Desktop\\\\Java\\\\newSnake\\\\img\\\\Apple.png\"));\r\n+            endOfGame = ImageIO.read(new File(\"C:\\\\Users\\\\KrasnikovRoman\\\\Desktop\\\\Java\\\\newSnake\\\\img\\\\GameOver.png\"));\r\n+        }\r\n+        catch (Exception e) {}\r\n+\r\n+        game = new Game();\r\n+        game.start();\r\n+        tmDraw = new Timer(20, new ActionListener() {\r\n+            @Override\r\n+            public void actionPerformed(ActionEvent e) {\r\n+                repaint();\r\n+            }\r\n+        });\r\n+        tmDraw.start();\r\n+\r\n+        this.addKeyListener(new MyKey());\r\n+        this.setFocusable(true);\r\n+        tmUpdate = new Timer(100, new ActionListener() {\r\n+            @Override\r\n+            public void actionPerformed(ActionEvent e) {\r\n+                if (game.endOfGame == false) {\r\n+                    game.move();\r\n+                }\r\n+                score.setText(\"Счёт: \" + game.score);\r\n+            }\r\n+        });\r\n+        tmUpdate.start();\r","path":"Tasks/Krasnikov-Snake/src/MyPanel.java","position":56,"original_position":56,"commit_id":"4f1565f77eb2f18c08b139aba97d695a0cbac12c","original_commit_id":"4f1565f77eb2f18c08b139aba97d695a0cbac12c","user":{"login":"seriyalexandrov","id":6267106,"avatar_url":"https://avatars.githubusercontent.com/u/6267106?v=3","gravatar_id":"","url":"https://api.github.com/users/seriyalexandrov","html_url":"https://github.com/seriyalexandrov","followers_url":"https://api.github.com/users/seriyalexandrov/followers","following_url":"https://api.github.com/users/seriyalexandrov/following{/other_user}","gists_url":"https://api.github.com/users/seriyalexandrov/gists{/gist_id}","starred_url":"https://api.github.com/users/seriyalexandrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seriyalexandrov/subscriptions","organizations_url":"https://api.github.com/users/seriyalexandrov/orgs","repos_url":"https://api.github.com/users/seriyalexandrov/repos","events_url":"https://api.github.com/users/seriyalexandrov/events{/privacy}","received_events_url":"https://api.github.com/users/seriyalexandrov/received_events","type":"User","site_admin":false},"body":"Запуск таймеров можно в отдельные методы.","created_at":"2016-10-12T22:42:35Z","updated_at":"2016-10-12T22:42:35Z","html_url":"https://github.com/seriyalexandrov/Education-Center/pull/3#discussion_r83114359","pull_request_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/seriyalexandrov/Education-Center/pulls/comments/83114359"},"html":{"href":"https://github.com/seriyalexandrov/Education-Center/pull/3#discussion_r83114359"},"pull_request":{"href":"https://api.github.com/repos/seriyalexandrov/Education-Center/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/seriyalexandrov/Education-Center/pulls/3","id":89103471,"html_url":"https://github.com/seriyalexandrov/Education-Center/pull/3","diff_url":"https://github.com/seriyalexandrov/Education-Center/pull/3.diff","patch_url":"https://github.com/seriyalexandrov/Education-Center/pull/3.patch","issue_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/issues/3","number":3,"state":"open","locked":false,"title":"Krasnikov task","user":{"login":"seriyalexandrov","id":6267106,"avatar_url":"https://avatars.githubusercontent.com/u/6267106?v=3","gravatar_id":"","url":"https://api.github.com/users/seriyalexandrov","html_url":"https://github.com/seriyalexandrov","followers_url":"https://api.github.com/users/seriyalexandrov/followers","following_url":"https://api.github.com/users/seriyalexandrov/following{/other_user}","gists_url":"https://api.github.com/users/seriyalexandrov/gists{/gist_id}","starred_url":"https://api.github.com/users/seriyalexandrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seriyalexandrov/subscriptions","organizations_url":"https://api.github.com/users/seriyalexandrov/orgs","repos_url":"https://api.github.com/users/seriyalexandrov/repos","events_url":"https://api.github.com/users/seriyalexandrov/events{/privacy}","received_events_url":"https://api.github.com/users/seriyalexandrov/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-12T22:10:36Z","updated_at":"2016-10-12T22:58:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"868c930d215a9841e70ae6c0ec947766b28213b3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/pulls/3/commits","review_comments_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/pulls/3/comments","review_comment_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/pulls/comments{/number}","comments_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/issues/3/comments","statuses_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/statuses/4f1565f77eb2f18c08b139aba97d695a0cbac12c","head":{"label":"seriyalexandrov:task/krasnikov","ref":"task/krasnikov","sha":"4f1565f77eb2f18c08b139aba97d695a0cbac12c","user":{"login":"seriyalexandrov","id":6267106,"avatar_url":"https://avatars.githubusercontent.com/u/6267106?v=3","gravatar_id":"","url":"https://api.github.com/users/seriyalexandrov","html_url":"https://github.com/seriyalexandrov","followers_url":"https://api.github.com/users/seriyalexandrov/followers","following_url":"https://api.github.com/users/seriyalexandrov/following{/other_user}","gists_url":"https://api.github.com/users/seriyalexandrov/gists{/gist_id}","starred_url":"https://api.github.com/users/seriyalexandrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seriyalexandrov/subscriptions","organizations_url":"https://api.github.com/users/seriyalexandrov/orgs","repos_url":"https://api.github.com/users/seriyalexandrov/repos","events_url":"https://api.github.com/users/seriyalexandrov/events{/privacy}","received_events_url":"https://api.github.com/users/seriyalexandrov/received_events","type":"User","site_admin":false},"repo":{"id":68522428,"name":"Education-Center","full_name":"seriyalexandrov/Education-Center","owner":{"login":"seriyalexandrov","id":6267106,"avatar_url":"https://avatars.githubusercontent.com/u/6267106?v=3","gravatar_id":"","url":"https://api.github.com/users/seriyalexandrov","html_url":"https://github.com/seriyalexandrov","followers_url":"https://api.github.com/users/seriyalexandrov/followers","following_url":"https://api.github.com/users/seriyalexandrov/following{/other_user}","gists_url":"https://api.github.com/users/seriyalexandrov/gists{/gist_id}","starred_url":"https://api.github.com/users/seriyalexandrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seriyalexandrov/subscriptions","organizations_url":"https://api.github.com/users/seriyalexandrov/orgs","repos_url":"https://api.github.com/users/seriyalexandrov/repos","events_url":"https://api.github.com/users/seriyalexandrov/events{/privacy}","received_events_url":"https://api.github.com/users/seriyalexandrov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/seriyalexandrov/Education-Center","description":"Some stuff for education center","fork":false,"url":"https://api.github.com/repos/seriyalexandrov/Education-Center","forks_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/forks","keys_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/teams","hooks_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/hooks","issue_events_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/issues/events{/number}","events_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/events","assignees_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/assignees{/user}","branches_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/branches{/branch}","tags_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/tags","blobs_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/git/refs{/sha}","trees_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/statuses/{sha}","languages_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/languages","stargazers_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/stargazers","contributors_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/contributors","subscribers_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/subscribers","subscription_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/subscription","commits_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/commits{/sha}","git_commits_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/git/commits{/sha}","comments_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/comments{/number}","issue_comment_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/issues/comments{/number}","contents_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/contents/{+path}","compare_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/merges","archive_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/downloads","issues_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/issues{/number}","pulls_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/pulls{/number}","milestones_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/milestones{/number}","notifications_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/labels{/name}","releases_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/releases{/id}","deployments_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/deployments","created_at":"2016-09-18T13:12:34Z","updated_at":"2016-09-18T13:12:34Z","pushed_at":"2016-10-12T22:10:36Z","git_url":"git://github.com/seriyalexandrov/Education-Center.git","ssh_url":"git@github.com:seriyalexandrov/Education-Center.git","clone_url":"https://github.com/seriyalexandrov/Education-Center.git","svn_url":"https://github.com/seriyalexandrov/Education-Center","homepage":null,"size":805,"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":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"seriyalexandrov:master","ref":"master","sha":"3390e5e9d2c9a5db62fb8e1e12efb12236eb91d7","user":{"login":"seriyalexandrov","id":6267106,"avatar_url":"https://avatars.githubusercontent.com/u/6267106?v=3","gravatar_id":"","url":"https://api.github.com/users/seriyalexandrov","html_url":"https://github.com/seriyalexandrov","followers_url":"https://api.github.com/users/seriyalexandrov/followers","following_url":"https://api.github.com/users/seriyalexandrov/following{/other_user}","gists_url":"https://api.github.com/users/seriyalexandrov/gists{/gist_id}","starred_url":"https://api.github.com/users/seriyalexandrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seriyalexandrov/subscriptions","organizations_url":"https://api.github.com/users/seriyalexandrov/orgs","repos_url":"https://api.github.com/users/seriyalexandrov/repos","events_url":"https://api.github.com/users/seriyalexandrov/events{/privacy}","received_events_url":"https://api.github.com/users/seriyalexandrov/received_events","type":"User","site_admin":false},"repo":{"id":68522428,"name":"Education-Center","full_name":"seriyalexandrov/Education-Center","owner":{"login":"seriyalexandrov","id":6267106,"avatar_url":"https://avatars.githubusercontent.com/u/6267106?v=3","gravatar_id":"","url":"https://api.github.com/users/seriyalexandrov","html_url":"https://github.com/seriyalexandrov","followers_url":"https://api.github.com/users/seriyalexandrov/followers","following_url":"https://api.github.com/users/seriyalexandrov/following{/other_user}","gists_url":"https://api.github.com/users/seriyalexandrov/gists{/gist_id}","starred_url":"https://api.github.com/users/seriyalexandrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seriyalexandrov/subscriptions","organizations_url":"https://api.github.com/users/seriyalexandrov/orgs","repos_url":"https://api.github.com/users/seriyalexandrov/repos","events_url":"https://api.github.com/users/seriyalexandrov/events{/privacy}","received_events_url":"https://api.github.com/users/seriyalexandrov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/seriyalexandrov/Education-Center","description":"Some stuff for education center","fork":false,"url":"https://api.github.com/repos/seriyalexandrov/Education-Center","forks_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/forks","keys_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/teams","hooks_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/hooks","issue_events_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/issues/events{/number}","events_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/events","assignees_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/assignees{/user}","branches_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/branches{/branch}","tags_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/tags","blobs_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/git/refs{/sha}","trees_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/statuses/{sha}","languages_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/languages","stargazers_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/stargazers","contributors_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/contributors","subscribers_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/subscribers","subscription_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/subscription","commits_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/commits{/sha}","git_commits_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/git/commits{/sha}","comments_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/comments{/number}","issue_comment_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/issues/comments{/number}","contents_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/contents/{+path}","compare_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/merges","archive_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/downloads","issues_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/issues{/number}","pulls_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/pulls{/number}","milestones_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/milestones{/number}","notifications_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/labels{/name}","releases_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/releases{/id}","deployments_url":"https://api.github.com/repos/seriyalexandrov/Education-Center/deployments","created_at":"2016-09-18T13:12:34Z","updated_at":"2016-09-18T13:12:34Z","pushed_at":"2016-10-12T22:10:36Z","git_url":"git://github.com/seriyalexandrov/Education-Center.git","ssh_url":"git@github.com:seriyalexandrov/Education-Center.git","clone_url":"https://github.com/seriyalexandrov/Education-Center.git","svn_url":"https://github.com/seriyalexandrov/Education-Center","homepage":null,"size":805,"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":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/seriyalexandrov/Education-Center/pulls/3"},"html":{"href":"https://github.com/seriyalexandrov/Education-Center/pull/3"},"issue":{"href":"https://api.github.com/repos/seriyalexandrov/Education-Center/issues/3"},"comments":{"href":"https://api.github.com/repos/seriyalexandrov/Education-Center/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/seriyalexandrov/Education-Center/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/seriyalexandrov/Education-Center/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/seriyalexandrov/Education-Center/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/seriyalexandrov/Education-Center/statuses/4f1565f77eb2f18c08b139aba97d695a0cbac12c"}}}}
{"actor":{"display_login":"seriyalexandrov"}}