{"action":"created","comment":{"url":"https://api.github.com/repos/ISNABE/sleepy-cobra/pulls/comments/60718839","id":60718839,"diff_hunk":"@@ -1,15 +1,210 @@\n+# coding: utf8\n+\n from kivy.uix.floatlayout import FloatLayout\n+from kivy.graphics import Color, Point\n from MapCanvas import MapCanvas\n \n \n class Level(FloatLayout):\n     def __init__(self, map_file_path, textures, **kwargs):\n         \"\"\"\n         Charge la carte dans un layout.\n+        Charge les données et la matrix de tile et de touch\n         :param map_file_path: Chemin de la carte\n         :param textures: dictionnaire de textures\n         :param kwargs: Argumens du layout\n         \"\"\"\n         super(Level, self).__init__(**kwargs)\n         self.map_canvas = MapCanvas(map_file_path, textures)\n         self.add_widget(self.map_canvas)\n+\n+        # charge les informations de touch et de tile\n+        self.touch_width = int\n+        self.touch_scaling_factor = 6\n+\n+        self.level_size = list\n+        self.tile_size = list\n+\n+        self.xmax = int\n+        self.ymax = int\n+        self.matrix = None\n+\n+        self.color = (1, 1, 1)\n+        self.old_point = list\n+        self.point = list\n+\n+        self.define_level_properties()\n+\n+        # load level victory path\n+        self.player_path = []\n+        self.win_path = []\n+        self.get_win_conditions()\n+\n+    \"\"\"\n+    level properties for initialisation\n+    \"\"\"\n+\n+    def define_level_properties(self):\n+        # defini l'épaisseur de trait de touch\n+        self.touch_width = self.map_canvas.tile_size / self.touch_scaling_factor\n+\n+        # defini la taille reel des tile\n+        self.level_size = [self.map_canvas.window.size[0] - self.map_canvas.vectical_padding * 2,\n+                           self.map_canvas.window.size[1] - self.map_canvas.horizontal_padding * 2]\n+        self.tile_size = [self.level_size[0] / self.map_canvas.map_size[0],\n+                          self.level_size[1] / self.map_canvas.map_size[1]]\n+\n+        # initialise la matrice\n+        self.xmax = self.map_canvas.map_size[0]\n+        self.ymax = self.map_canvas.map_size[1]\n+        self.matrix = [[0 for _ in xrange(self.xmax)] for _ in xrange(self.ymax)]\n+\n+        # rempli la matrice avec les coordonnées\n+        x = self.map_canvas.vectical_padding\n+        y = self.map_canvas.window.size[1] - self.map_canvas.horizontal_padding\n+\n+        for indx in range(self.ymax):\n+            for indy in range(self.xmax):\n+                self.matrix[indy][indx] = [x, y, x + self.tile_size[0], y - self.tile_size[1]]\n+                y -= self.tile_size[1]\n+            x += self.tile_size[0]\n+            y = self.map_canvas.window.size[1]\n+\n+    \"\"\"\n+    Tiles methods\n+    \"\"\"\n+\n+    def get_touch_auth(self, tile_type):\n+        \"\"\"\n+        test the current tile to get authorizations","path":"Level.py","position":79,"original_position":79,"commit_id":"45e81c24964b4d5ed7e4bd7bc781a39b1e638b87","original_commit_id":"45e81c24964b4d5ed7e4bd7bc781a39b1e638b87","user":{"login":"balthov60","id":16670306,"avatar_url":"https://avatars.githubusercontent.com/u/16670306?v=3","gravatar_id":"","url":"https://api.github.com/users/balthov60","html_url":"https://github.com/balthov60","followers_url":"https://api.github.com/users/balthov60/followers","following_url":"https://api.github.com/users/balthov60/following{/other_user}","gists_url":"https://api.github.com/users/balthov60/gists{/gist_id}","starred_url":"https://api.github.com/users/balthov60/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balthov60/subscriptions","organizations_url":"https://api.github.com/users/balthov60/orgs","repos_url":"https://api.github.com/users/balthov60/repos","events_url":"https://api.github.com/users/balthov60/events{/privacy}","received_events_url":"https://api.github.com/users/balthov60/received_events","type":"User","site_admin":false},"body":"?","created_at":"2016-04-22T10:19:22Z","updated_at":"2016-04-22T10:19:22Z","html_url":"https://github.com/ISNABE/sleepy-cobra/pull/10#discussion_r60718839","pull_request_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/ISNABE/sleepy-cobra/pulls/comments/60718839"},"html":{"href":"https://github.com/ISNABE/sleepy-cobra/pull/10#discussion_r60718839"},"pull_request":{"href":"https://api.github.com/repos/ISNABE/sleepy-cobra/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/ISNABE/sleepy-cobra/pulls/10","id":66853109,"html_url":"https://github.com/ISNABE/sleepy-cobra/pull/10","diff_url":"https://github.com/ISNABE/sleepy-cobra/pull/10.diff","patch_url":"https://github.com/ISNABE/sleepy-cobra/pull/10.patch","issue_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/issues/10","number":10,"state":"open","locked":false,"title":"Add detection of tile","user":{"login":"balthov60","id":16670306,"avatar_url":"https://avatars.githubusercontent.com/u/16670306?v=3","gravatar_id":"","url":"https://api.github.com/users/balthov60","html_url":"https://github.com/balthov60","followers_url":"https://api.github.com/users/balthov60/followers","following_url":"https://api.github.com/users/balthov60/following{/other_user}","gists_url":"https://api.github.com/users/balthov60/gists{/gist_id}","starred_url":"https://api.github.com/users/balthov60/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balthov60/subscriptions","organizations_url":"https://api.github.com/users/balthov60/orgs","repos_url":"https://api.github.com/users/balthov60/repos","events_url":"https://api.github.com/users/balthov60/events{/privacy}","received_events_url":"https://api.github.com/users/balthov60/received_events","type":"User","site_admin":false},"body":"add detection of tile, need to implement utilisation and authaurization","created_at":"2016-04-18T13:29:04Z","updated_at":"2016-04-22T10:19:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7f1185c610caa1face9d025d4ee86c2747c462b0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/pulls/10/commits","review_comments_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/pulls/10/comments","review_comment_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/issues/10/comments","statuses_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/statuses/45e81c24964b4d5ed7e4bd7bc781a39b1e638b87","head":{"label":"balthov60:feature/touch","ref":"feature/touch","sha":"45e81c24964b4d5ed7e4bd7bc781a39b1e638b87","user":{"login":"balthov60","id":16670306,"avatar_url":"https://avatars.githubusercontent.com/u/16670306?v=3","gravatar_id":"","url":"https://api.github.com/users/balthov60","html_url":"https://github.com/balthov60","followers_url":"https://api.github.com/users/balthov60/followers","following_url":"https://api.github.com/users/balthov60/following{/other_user}","gists_url":"https://api.github.com/users/balthov60/gists{/gist_id}","starred_url":"https://api.github.com/users/balthov60/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balthov60/subscriptions","organizations_url":"https://api.github.com/users/balthov60/orgs","repos_url":"https://api.github.com/users/balthov60/repos","events_url":"https://api.github.com/users/balthov60/events{/privacy}","received_events_url":"https://api.github.com/users/balthov60/received_events","type":"User","site_admin":false},"repo":{"id":55722398,"name":"sleepy-cobra","full_name":"balthov60/sleepy-cobra","owner":{"login":"balthov60","id":16670306,"avatar_url":"https://avatars.githubusercontent.com/u/16670306?v=3","gravatar_id":"","url":"https://api.github.com/users/balthov60","html_url":"https://github.com/balthov60","followers_url":"https://api.github.com/users/balthov60/followers","following_url":"https://api.github.com/users/balthov60/following{/other_user}","gists_url":"https://api.github.com/users/balthov60/gists{/gist_id}","starred_url":"https://api.github.com/users/balthov60/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balthov60/subscriptions","organizations_url":"https://api.github.com/users/balthov60/orgs","repos_url":"https://api.github.com/users/balthov60/repos","events_url":"https://api.github.com/users/balthov60/events{/privacy}","received_events_url":"https://api.github.com/users/balthov60/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/balthov60/sleepy-cobra","description":"","fork":true,"url":"https://api.github.com/repos/balthov60/sleepy-cobra","forks_url":"https://api.github.com/repos/balthov60/sleepy-cobra/forks","keys_url":"https://api.github.com/repos/balthov60/sleepy-cobra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/balthov60/sleepy-cobra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/balthov60/sleepy-cobra/teams","hooks_url":"https://api.github.com/repos/balthov60/sleepy-cobra/hooks","issue_events_url":"https://api.github.com/repos/balthov60/sleepy-cobra/issues/events{/number}","events_url":"https://api.github.com/repos/balthov60/sleepy-cobra/events","assignees_url":"https://api.github.com/repos/balthov60/sleepy-cobra/assignees{/user}","branches_url":"https://api.github.com/repos/balthov60/sleepy-cobra/branches{/branch}","tags_url":"https://api.github.com/repos/balthov60/sleepy-cobra/tags","blobs_url":"https://api.github.com/repos/balthov60/sleepy-cobra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/balthov60/sleepy-cobra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/balthov60/sleepy-cobra/git/refs{/sha}","trees_url":"https://api.github.com/repos/balthov60/sleepy-cobra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/balthov60/sleepy-cobra/statuses/{sha}","languages_url":"https://api.github.com/repos/balthov60/sleepy-cobra/languages","stargazers_url":"https://api.github.com/repos/balthov60/sleepy-cobra/stargazers","contributors_url":"https://api.github.com/repos/balthov60/sleepy-cobra/contributors","subscribers_url":"https://api.github.com/repos/balthov60/sleepy-cobra/subscribers","subscription_url":"https://api.github.com/repos/balthov60/sleepy-cobra/subscription","commits_url":"https://api.github.com/repos/balthov60/sleepy-cobra/commits{/sha}","git_commits_url":"https://api.github.com/repos/balthov60/sleepy-cobra/git/commits{/sha}","comments_url":"https://api.github.com/repos/balthov60/sleepy-cobra/comments{/number}","issue_comment_url":"https://api.github.com/repos/balthov60/sleepy-cobra/issues/comments{/number}","contents_url":"https://api.github.com/repos/balthov60/sleepy-cobra/contents/{+path}","compare_url":"https://api.github.com/repos/balthov60/sleepy-cobra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/balthov60/sleepy-cobra/merges","archive_url":"https://api.github.com/repos/balthov60/sleepy-cobra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/balthov60/sleepy-cobra/downloads","issues_url":"https://api.github.com/repos/balthov60/sleepy-cobra/issues{/number}","pulls_url":"https://api.github.com/repos/balthov60/sleepy-cobra/pulls{/number}","milestones_url":"https://api.github.com/repos/balthov60/sleepy-cobra/milestones{/number}","notifications_url":"https://api.github.com/repos/balthov60/sleepy-cobra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/balthov60/sleepy-cobra/labels{/name}","releases_url":"https://api.github.com/repos/balthov60/sleepy-cobra/releases{/id}","deployments_url":"https://api.github.com/repos/balthov60/sleepy-cobra/deployments","created_at":"2016-04-07T19:33:07Z","updated_at":"2016-04-07T19:33:08Z","pushed_at":"2016-04-20T09:38:01Z","git_url":"git://github.com/balthov60/sleepy-cobra.git","ssh_url":"git@github.com:balthov60/sleepy-cobra.git","clone_url":"https://github.com/balthov60/sleepy-cobra.git","svn_url":"https://github.com/balthov60/sleepy-cobra","homepage":null,"size":26048,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ISNABE:master","ref":"master","sha":"3e1fa606a606fe856ffe8ad204ec44f205a3ef9a","user":{"login":"ISNABE","id":16670927,"avatar_url":"https://avatars.githubusercontent.com/u/16670927?v=3","gravatar_id":"","url":"https://api.github.com/users/ISNABE","html_url":"https://github.com/ISNABE","followers_url":"https://api.github.com/users/ISNABE/followers","following_url":"https://api.github.com/users/ISNABE/following{/other_user}","gists_url":"https://api.github.com/users/ISNABE/gists{/gist_id}","starred_url":"https://api.github.com/users/ISNABE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ISNABE/subscriptions","organizations_url":"https://api.github.com/users/ISNABE/orgs","repos_url":"https://api.github.com/users/ISNABE/repos","events_url":"https://api.github.com/users/ISNABE/events{/privacy}","received_events_url":"https://api.github.com/users/ISNABE/received_events","type":"Organization","site_admin":false},"repo":{"id":51030914,"name":"sleepy-cobra","full_name":"ISNABE/sleepy-cobra","owner":{"login":"ISNABE","id":16670927,"avatar_url":"https://avatars.githubusercontent.com/u/16670927?v=3","gravatar_id":"","url":"https://api.github.com/users/ISNABE","html_url":"https://github.com/ISNABE","followers_url":"https://api.github.com/users/ISNABE/followers","following_url":"https://api.github.com/users/ISNABE/following{/other_user}","gists_url":"https://api.github.com/users/ISNABE/gists{/gist_id}","starred_url":"https://api.github.com/users/ISNABE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ISNABE/subscriptions","organizations_url":"https://api.github.com/users/ISNABE/orgs","repos_url":"https://api.github.com/users/ISNABE/repos","events_url":"https://api.github.com/users/ISNABE/events{/privacy}","received_events_url":"https://api.github.com/users/ISNABE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ISNABE/sleepy-cobra","description":"","fork":false,"url":"https://api.github.com/repos/ISNABE/sleepy-cobra","forks_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/forks","keys_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/teams","hooks_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/hooks","issue_events_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/issues/events{/number}","events_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/events","assignees_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/assignees{/user}","branches_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/branches{/branch}","tags_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/tags","blobs_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/git/refs{/sha}","trees_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/statuses/{sha}","languages_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/languages","stargazers_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/stargazers","contributors_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/contributors","subscribers_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/subscribers","subscription_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/subscription","commits_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/commits{/sha}","git_commits_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/git/commits{/sha}","comments_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/comments{/number}","issue_comment_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/issues/comments{/number}","contents_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/contents/{+path}","compare_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/merges","archive_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/downloads","issues_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/issues{/number}","pulls_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/pulls{/number}","milestones_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/milestones{/number}","notifications_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/labels{/name}","releases_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/releases{/id}","deployments_url":"https://api.github.com/repos/ISNABE/sleepy-cobra/deployments","created_at":"2016-02-03T21:12:03Z","updated_at":"2016-04-07T19:05:10Z","pushed_at":"2016-04-20T09:38:02Z","git_url":"git://github.com/ISNABE/sleepy-cobra.git","ssh_url":"git@github.com:ISNABE/sleepy-cobra.git","clone_url":"https://github.com/ISNABE/sleepy-cobra.git","svn_url":"https://github.com/ISNABE/sleepy-cobra","homepage":null,"size":29273,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ISNABE/sleepy-cobra/pulls/10"},"html":{"href":"https://github.com/ISNABE/sleepy-cobra/pull/10"},"issue":{"href":"https://api.github.com/repos/ISNABE/sleepy-cobra/issues/10"},"comments":{"href":"https://api.github.com/repos/ISNABE/sleepy-cobra/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/ISNABE/sleepy-cobra/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/ISNABE/sleepy-cobra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ISNABE/sleepy-cobra/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/ISNABE/sleepy-cobra/statuses/45e81c24964b4d5ed7e4bd7bc781a39b1e638b87"}}}}