{"action":"created","comment":{"url":"https://api.github.com/repos/privat/nit/pulls/comments/36853744","id":36853744,"diff_hunk":"@@ -90,38 +107,114 @@ class Hole\n \t\t\tey > y - dy and ey < y\n \tend\n \n-\tfun hit\n+\t# Draw this hole and content to `display`\n+\tfun draw(display: Display)\n \tdo\n-\t\tif hitted then return\n-\n-\t\tif trap then\n-\t\t\tup = false\n-\t\t\tgame.points -= 5\n-\t\t\tif game.points < 0 then game.points = 0\n-\t\telse\n-\t\t\thitted = true\n-\t\t\tgame.points += 1\n+\t\t# The hole itself\n+\t\tvar img = app.assets.empty\n+\t\tvar dx = 300.0*display_scale\n+\t\tvar dy = 256.0*display_scale\n+\t\timg.scale = display_scale\n+\t\tdisplay.blit(img, x-dx.to_i+display_offset_x, y-dy.to_i+display_offset_y)\n+\n+\t\t# The mole in the hole, or other content\n+\t\tvar content = self.content\n+\t\tif content != null then\n+\t\t\tcontent.draw(display, x, y)\n \t\tend\n \tend\n end\n \n+# Content of a `Hole`\n+class HoleContent\n+\t# Image\n+\tvar img: Image\n+\n+\t# Offset of the horizontal center of the hole\n+\tvar dx: Float\n+\n+\t# Offset of the vertical center of the hole\n+\tvar dy: Float\n+\n+\t# Hit this hole content\n+\tfun hit(game: Game, hole: Hole, event: PointerEvent) do end\n+\n+\t# Draw this content to `display`\n+\tfun draw(display: Display, x, y: Int)\n+\tdo\n+\t\timg.scale = display_scale\n+\t\tdisplay.blit(img,\n+\t\t\tx-dx.to_i+display_offset_x,","path":"examples/mnit_moles/src/moles.nit","position":160,"original_position":160,"commit_id":"4518eadd34bba877ef01433cb9039521db8d9e66","original_commit_id":"4518eadd34bba877ef01433cb9039521db8d9e66","user":{"login":"Morriar","id":583144,"avatar_url":"https://avatars.githubusercontent.com/u/583144?v=3","gravatar_id":"","url":"https://api.github.com/users/Morriar","html_url":"https://github.com/Morriar","followers_url":"https://api.github.com/users/Morriar/followers","following_url":"https://api.github.com/users/Morriar/following{/other_user}","gists_url":"https://api.github.com/users/Morriar/gists{/gist_id}","starred_url":"https://api.github.com/users/Morriar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morriar/subscriptions","organizations_url":"https://api.github.com/users/Morriar/orgs","repos_url":"https://api.github.com/users/Morriar/repos","events_url":"https://api.github.com/users/Morriar/events{/privacy}","received_events_url":"https://api.github.com/users/Morriar/received_events","type":"User","site_admin":false},"body":"I really don't understand:\r\n* why do you insist to put that useless `\\n` before the `do` keyword, which does not improve the code reading\r\n* while you don't like to put spaces around math operators, which in this case really improve code reading?","created_at":"2015-08-12T12:33:05Z","updated_at":"2015-08-12T12:33:05Z","html_url":"https://github.com/privat/nit/pull/1633#discussion_r36853744","pull_request_url":"https://api.github.com/repos/privat/nit/pulls/1633","_links":{"self":{"href":"https://api.github.com/repos/privat/nit/pulls/comments/36853744"},"html":{"href":"https://github.com/privat/nit/pull/1633#discussion_r36853744"},"pull_request":{"href":"https://api.github.com/repos/privat/nit/pulls/1633"}}},"pull_request":{"url":"https://api.github.com/repos/privat/nit/pulls/1633","id":42176008,"html_url":"https://github.com/privat/nit/pull/1633","diff_url":"https://github.com/privat/nit/pull/1633.diff","patch_url":"https://github.com/privat/nit/pull/1633.patch","issue_url":"https://api.github.com/repos/privat/nit/issues/1633","number":1633,"state":"open","locked":false,"title":"Crazy Moles with particle effects, nukes, Bézier curves and cacti disguised as moles","user":{"login":"xymus","id":208057,"avatar_url":"https://avatars.githubusercontent.com/u/208057?v=3","gravatar_id":"","url":"https://api.github.com/users/xymus","html_url":"https://github.com/xymus","followers_url":"https://api.github.com/users/xymus/followers","following_url":"https://api.github.com/users/xymus/following{/other_user}","gists_url":"https://api.github.com/users/xymus/gists{/gist_id}","starred_url":"https://api.github.com/users/xymus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xymus/subscriptions","organizations_url":"https://api.github.com/users/xymus/orgs","repos_url":"https://api.github.com/users/xymus/repos","events_url":"https://api.github.com/users/xymus/events{/privacy}","received_events_url":"https://api.github.com/users/xymus/received_events","type":"User","site_admin":false},"body":"This PR adds new features to the Crazy Moles/Groundhogs game. Pretty graphical effects with particles, Bézier curves and a custom C method to display flash effects. Plus two new traps; the cactus disguised as a mole and the much awaited nuke. This PR also updates the project tools and style, fix a few annoyances and adds a basic script to stress test on Android.\r\n\r\nThe script to test on Android was an experiment with adb monkey for a future integration with Jenkins.\r\n\r\nWhat is not in this PR: sounds, fullscreen on Android and other Android specific features.","created_at":"2015-08-11T20:48:31Z","updated_at":"2015-08-12T12:33:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ae27ab0f2e9260be84132bbe290eaa5522c3b926","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/privat/nit/pulls/1633/commits","review_comments_url":"https://api.github.com/repos/privat/nit/pulls/1633/comments","review_comment_url":"https://api.github.com/repos/privat/nit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/privat/nit/issues/1633/comments","statuses_url":"https://api.github.com/repos/privat/nit/statuses/4518eadd34bba877ef01433cb9039521db8d9e66","head":{"label":"xymus:moles","ref":"moles","sha":"4518eadd34bba877ef01433cb9039521db8d9e66","user":{"login":"xymus","id":208057,"avatar_url":"https://avatars.githubusercontent.com/u/208057?v=3","gravatar_id":"","url":"https://api.github.com/users/xymus","html_url":"https://github.com/xymus","followers_url":"https://api.github.com/users/xymus/followers","following_url":"https://api.github.com/users/xymus/following{/other_user}","gists_url":"https://api.github.com/users/xymus/gists{/gist_id}","starred_url":"https://api.github.com/users/xymus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xymus/subscriptions","organizations_url":"https://api.github.com/users/xymus/orgs","repos_url":"https://api.github.com/users/xymus/repos","events_url":"https://api.github.com/users/xymus/events{/privacy}","received_events_url":"https://api.github.com/users/xymus/received_events","type":"User","site_admin":false},"repo":{"id":1275771,"name":"nit","full_name":"xymus/nit","owner":{"login":"xymus","id":208057,"avatar_url":"https://avatars.githubusercontent.com/u/208057?v=3","gravatar_id":"","url":"https://api.github.com/users/xymus","html_url":"https://github.com/xymus","followers_url":"https://api.github.com/users/xymus/followers","following_url":"https://api.github.com/users/xymus/following{/other_user}","gists_url":"https://api.github.com/users/xymus/gists{/gist_id}","starred_url":"https://api.github.com/users/xymus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xymus/subscriptions","organizations_url":"https://api.github.com/users/xymus/orgs","repos_url":"https://api.github.com/users/xymus/repos","events_url":"https://api.github.com/users/xymus/events{/privacy}","received_events_url":"https://api.github.com/users/xymus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xymus/nit","description":"Nit language","fork":true,"url":"https://api.github.com/repos/xymus/nit","forks_url":"https://api.github.com/repos/xymus/nit/forks","keys_url":"https://api.github.com/repos/xymus/nit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xymus/nit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xymus/nit/teams","hooks_url":"https://api.github.com/repos/xymus/nit/hooks","issue_events_url":"https://api.github.com/repos/xymus/nit/issues/events{/number}","events_url":"https://api.github.com/repos/xymus/nit/events","assignees_url":"https://api.github.com/repos/xymus/nit/assignees{/user}","branches_url":"https://api.github.com/repos/xymus/nit/branches{/branch}","tags_url":"https://api.github.com/repos/xymus/nit/tags","blobs_url":"https://api.github.com/repos/xymus/nit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xymus/nit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xymus/nit/git/refs{/sha}","trees_url":"https://api.github.com/repos/xymus/nit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xymus/nit/statuses/{sha}","languages_url":"https://api.github.com/repos/xymus/nit/languages","stargazers_url":"https://api.github.com/repos/xymus/nit/stargazers","contributors_url":"https://api.github.com/repos/xymus/nit/contributors","subscribers_url":"https://api.github.com/repos/xymus/nit/subscribers","subscription_url":"https://api.github.com/repos/xymus/nit/subscription","commits_url":"https://api.github.com/repos/xymus/nit/commits{/sha}","git_commits_url":"https://api.github.com/repos/xymus/nit/git/commits{/sha}","comments_url":"https://api.github.com/repos/xymus/nit/comments{/number}","issue_comment_url":"https://api.github.com/repos/xymus/nit/issues/comments{/number}","contents_url":"https://api.github.com/repos/xymus/nit/contents/{+path}","compare_url":"https://api.github.com/repos/xymus/nit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xymus/nit/merges","archive_url":"https://api.github.com/repos/xymus/nit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xymus/nit/downloads","issues_url":"https://api.github.com/repos/xymus/nit/issues{/number}","pulls_url":"https://api.github.com/repos/xymus/nit/pulls{/number}","milestones_url":"https://api.github.com/repos/xymus/nit/milestones{/number}","notifications_url":"https://api.github.com/repos/xymus/nit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xymus/nit/labels{/name}","releases_url":"https://api.github.com/repos/xymus/nit/releases{/id}","created_at":"2011-01-20T19:43:31Z","updated_at":"2015-04-06T14:41:09Z","pushed_at":"2015-08-11T23:58:52Z","git_url":"git://github.com/xymus/nit.git","ssh_url":"git@github.com:xymus/nit.git","clone_url":"https://github.com/xymus/nit.git","svn_url":"https://github.com/xymus/nit","homepage":"http://nitlanguage.org","size":70583,"stargazers_count":8,"watchers_count":8,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":8,"default_branch":"master"}},"base":{"label":"privat:master","ref":"master","sha":"8d1bd15855811323555ab31f6150b02f87f87c43","user":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=3","gravatar_id":"","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"repo":{"id":328597,"name":"nit","full_name":"privat/nit","owner":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=3","gravatar_id":"","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/privat/nit","description":"Nit language","fork":false,"url":"https://api.github.com/repos/privat/nit","forks_url":"https://api.github.com/repos/privat/nit/forks","keys_url":"https://api.github.com/repos/privat/nit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/privat/nit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/privat/nit/teams","hooks_url":"https://api.github.com/repos/privat/nit/hooks","issue_events_url":"https://api.github.com/repos/privat/nit/issues/events{/number}","events_url":"https://api.github.com/repos/privat/nit/events","assignees_url":"https://api.github.com/repos/privat/nit/assignees{/user}","branches_url":"https://api.github.com/repos/privat/nit/branches{/branch}","tags_url":"https://api.github.com/repos/privat/nit/tags","blobs_url":"https://api.github.com/repos/privat/nit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/privat/nit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/privat/nit/git/refs{/sha}","trees_url":"https://api.github.com/repos/privat/nit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/privat/nit/statuses/{sha}","languages_url":"https://api.github.com/repos/privat/nit/languages","stargazers_url":"https://api.github.com/repos/privat/nit/stargazers","contributors_url":"https://api.github.com/repos/privat/nit/contributors","subscribers_url":"https://api.github.com/repos/privat/nit/subscribers","subscription_url":"https://api.github.com/repos/privat/nit/subscription","commits_url":"https://api.github.com/repos/privat/nit/commits{/sha}","git_commits_url":"https://api.github.com/repos/privat/nit/git/commits{/sha}","comments_url":"https://api.github.com/repos/privat/nit/comments{/number}","issue_comment_url":"https://api.github.com/repos/privat/nit/issues/comments{/number}","contents_url":"https://api.github.com/repos/privat/nit/contents/{+path}","compare_url":"https://api.github.com/repos/privat/nit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/privat/nit/merges","archive_url":"https://api.github.com/repos/privat/nit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/privat/nit/downloads","issues_url":"https://api.github.com/repos/privat/nit/issues{/number}","pulls_url":"https://api.github.com/repos/privat/nit/pulls{/number}","milestones_url":"https://api.github.com/repos/privat/nit/milestones{/number}","notifications_url":"https://api.github.com/repos/privat/nit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/privat/nit/labels{/name}","releases_url":"https://api.github.com/repos/privat/nit/releases{/id}","created_at":"2009-10-06T15:03:00Z","updated_at":"2015-07-30T17:24:29Z","pushed_at":"2015-08-12T00:53:47Z","git_url":"git://github.com/privat/nit.git","ssh_url":"git@github.com:privat/nit.git","clone_url":"https://github.com/privat/nit.git","svn_url":"https://github.com/privat/nit","homepage":"http://nitlanguage.org","size":93808,"stargazers_count":76,"watchers_count":76,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":125,"forks":44,"open_issues":125,"watchers":76,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/privat/nit/pulls/1633"},"html":{"href":"https://github.com/privat/nit/pull/1633"},"issue":{"href":"https://api.github.com/repos/privat/nit/issues/1633"},"comments":{"href":"https://api.github.com/repos/privat/nit/issues/1633/comments"},"review_comments":{"href":"https://api.github.com/repos/privat/nit/pulls/1633/comments"},"review_comment":{"href":"https://api.github.com/repos/privat/nit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/privat/nit/pulls/1633/commits"},"statuses":{"href":"https://api.github.com/repos/privat/nit/statuses/4518eadd34bba877ef01433cb9039521db8d9e66"}}}}