{"action":"created","comment":{"url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/pulls/comments/61674418","id":61674418,"diff_hunk":"@@ -0,0 +1,335 @@\n+__author__ = 'Batchu Vishal'\n+import pygame\n+import math\n+import sys\n+\n+from Person import Person\n+from OnBoard import OnBoard\n+from Coin import Coin\n+from Player import Player\n+from Fireball import Fireball\n+from Donkey import Donkey\n+\n+'''\n+This class defines our gameboard.\n+A gameboard contains everthing related to our game on it like our characters, walls, ladders, coins etc\n+The generation of the level also happens in this class.\n+'''\n+\n+\n+class Board:\n+    def __init__(self, width, height, rewards, rng):\n+        self.__width = width\n+        self.__actHeight = height\n+        self.__height = self.__actHeight + 10\n+        self.score = 0\n+        self.rng = rng\n+        self.rewards = rewards\n+        self.gameState = 1\n+        self.cycles = 0  # For the characters animation\n+        self.direction = 0\n+\n+        self.white = (255, 255, 255)\n+\n+        '''\n+        The map is essentially an array of 30x80 in which we store what each block on our map is.\n+        1 represents a wall, 2 for a ladder and 3 for a coin.\n+        '''\n+        self.map = []\n+        # These are the arrays in which we store our instances of different classes\n+        self.Players = self.Enemies = self.Allies = self.Coins = self.Walls = self.Ladders = self.Fireballs = self.Hearts = self.Boards = self.FireballEndpoints = []\n+\n+        # Resets the above groups and initializes the game for us\n+        self.resetGroups()\n+\n+        self.myfont = pygame.font.SysFont(\"comicsansms\", 50)\n+\n+        self.background = pygame.image.load('Assets/background.png')\n+        self.background = pygame.transform.scale(self.background, (width, height))\n+\n+        # Initialize the instance groups which we use to display our instances on the screen\n+        self.fireballGroup = pygame.sprite.RenderPlain(self.Fireballs)\n+        self.playerGroup = pygame.sprite.RenderPlain(self.Players)\n+        self.enemyGroup = pygame.sprite.RenderPlain(self.Enemies)\n+        self.wallGroup = pygame.sprite.RenderPlain(self.Walls)\n+        self.ladderGroup = pygame.sprite.RenderPlain(self.Ladders)\n+        self.coinGroup = pygame.sprite.RenderPlain(self.Coins)\n+        self.allyGroup = pygame.sprite.RenderPlain(self.Allies)\n+        self.fireballEndpointsGroup = pygame.sprite.RenderPlain(self.FireballEndpoints)\n+        self.boardGroup = pygame.sprite.RenderPlain(self.Boards)\n+        self.heartGroup = pygame.sprite.RenderPlain(self.Hearts)\n+\n+    def resetGroups(self):\n+        self.score = 0\n+        self.map = []  # We will create the map again when we reset the game\n+        self.Players = [Player(pygame.image.load('Assets/still.png'), (50, 440), self.rng)]","path":"ple/games/donkeykong/Board.py","position":65,"original_position":65,"commit_id":"23e9e89faf316b78454b57502eb499cd93dd0c06","original_commit_id":"23e9e89faf316b78454b57502eb499cd93dd0c06","user":{"login":"ntasfi","id":627939,"avatar_url":"https://avatars.githubusercontent.com/u/627939?v=3","gravatar_id":"","url":"https://api.github.com/users/ntasfi","html_url":"https://github.com/ntasfi","followers_url":"https://api.github.com/users/ntasfi/followers","following_url":"https://api.github.com/users/ntasfi/following{/other_user}","gists_url":"https://api.github.com/users/ntasfi/gists{/gist_id}","starred_url":"https://api.github.com/users/ntasfi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ntasfi/subscriptions","organizations_url":"https://api.github.com/users/ntasfi/orgs","repos_url":"https://api.github.com/users/ntasfi/repos","events_url":"https://api.github.com/users/ntasfi/events{/privacy}","received_events_url":"https://api.github.com/users/ntasfi/received_events","type":"User","site_admin":false},"body":"performance: might be useful to use image.convert() or image.convert_alpha() depending on if the image uses alpha","created_at":"2016-04-30T20:14:56Z","updated_at":"2016-04-30T20:14:56Z","html_url":"https://github.com/ntasfi/PyGame-Learning-Environment/pull/8#discussion_r61674418","pull_request_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/pulls/comments/61674418"},"html":{"href":"https://github.com/ntasfi/PyGame-Learning-Environment/pull/8#discussion_r61674418"},"pull_request":{"href":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/pulls/8","id":68333512,"html_url":"https://github.com/ntasfi/PyGame-Learning-Environment/pull/8","diff_url":"https://github.com/ntasfi/PyGame-Learning-Environment/pull/8.diff","patch_url":"https://github.com/ntasfi/PyGame-Learning-Environment/pull/8.patch","issue_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/issues/8","number":8,"state":"open","locked":false,"title":"Add donkeykong game","user":{"login":"erilyth","id":9864149,"avatar_url":"https://avatars.githubusercontent.com/u/9864149?v=3","gravatar_id":"","url":"https://api.github.com/users/erilyth","html_url":"https://github.com/erilyth","followers_url":"https://api.github.com/users/erilyth/followers","following_url":"https://api.github.com/users/erilyth/following{/other_user}","gists_url":"https://api.github.com/users/erilyth/gists{/gist_id}","starred_url":"https://api.github.com/users/erilyth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erilyth/subscriptions","organizations_url":"https://api.github.com/users/erilyth/orgs","repos_url":"https://api.github.com/users/erilyth/repos","events_url":"https://api.github.com/users/erilyth/events{/privacy}","received_events_url":"https://api.github.com/users/erilyth/received_events","type":"User","site_admin":false},"body":"Fix issues and add PLE related functions\r\n","created_at":"2016-04-29T07:28:25Z","updated_at":"2016-04-30T20:14:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e6d7bf4fb0597e22d37ac89877e066b1d81a4e0a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/pulls/8/commits","review_comments_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/pulls/8/comments","review_comment_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/issues/8/comments","statuses_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/statuses/23e9e89faf316b78454b57502eb499cd93dd0c06","head":{"label":"erilyth:master","ref":"master","sha":"23e9e89faf316b78454b57502eb499cd93dd0c06","user":{"login":"erilyth","id":9864149,"avatar_url":"https://avatars.githubusercontent.com/u/9864149?v=3","gravatar_id":"","url":"https://api.github.com/users/erilyth","html_url":"https://github.com/erilyth","followers_url":"https://api.github.com/users/erilyth/followers","following_url":"https://api.github.com/users/erilyth/following{/other_user}","gists_url":"https://api.github.com/users/erilyth/gists{/gist_id}","starred_url":"https://api.github.com/users/erilyth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erilyth/subscriptions","organizations_url":"https://api.github.com/users/erilyth/orgs","repos_url":"https://api.github.com/users/erilyth/repos","events_url":"https://api.github.com/users/erilyth/events{/privacy}","received_events_url":"https://api.github.com/users/erilyth/received_events","type":"User","site_admin":false},"repo":{"id":57323681,"name":"PyGame-Learning-Environment","full_name":"erilyth/PyGame-Learning-Environment","owner":{"login":"erilyth","id":9864149,"avatar_url":"https://avatars.githubusercontent.com/u/9864149?v=3","gravatar_id":"","url":"https://api.github.com/users/erilyth","html_url":"https://github.com/erilyth","followers_url":"https://api.github.com/users/erilyth/followers","following_url":"https://api.github.com/users/erilyth/following{/other_user}","gists_url":"https://api.github.com/users/erilyth/gists{/gist_id}","starred_url":"https://api.github.com/users/erilyth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erilyth/subscriptions","organizations_url":"https://api.github.com/users/erilyth/orgs","repos_url":"https://api.github.com/users/erilyth/repos","events_url":"https://api.github.com/users/erilyth/events{/privacy}","received_events_url":"https://api.github.com/users/erilyth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/erilyth/PyGame-Learning-Environment","description":"PyGame Learning Environment (PLE) -- Reinforcement Learning Environment in Python.","fork":true,"url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment","forks_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/forks","keys_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/keys{/key_id}","collaborators_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/teams","hooks_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/hooks","issue_events_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/issues/events{/number}","events_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/events","assignees_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/assignees{/user}","branches_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/branches{/branch}","tags_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/tags","blobs_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/git/refs{/sha}","trees_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/git/trees{/sha}","statuses_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/statuses/{sha}","languages_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/languages","stargazers_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/stargazers","contributors_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/contributors","subscribers_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/subscribers","subscription_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/subscription","commits_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/commits{/sha}","git_commits_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/git/commits{/sha}","comments_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/comments{/number}","issue_comment_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/issues/comments{/number}","contents_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/contents/{+path}","compare_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/compare/{base}...{head}","merges_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/merges","archive_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/downloads","issues_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/issues{/number}","pulls_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/pulls{/number}","milestones_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/milestones{/number}","notifications_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/labels{/name}","releases_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/releases{/id}","deployments_url":"https://api.github.com/repos/erilyth/PyGame-Learning-Environment/deployments","created_at":"2016-04-28T18:09:43Z","updated_at":"2016-04-28T18:09:44Z","pushed_at":"2016-04-30T05:45:00Z","git_url":"git://github.com/erilyth/PyGame-Learning-Environment.git","ssh_url":"git@github.com:erilyth/PyGame-Learning-Environment.git","clone_url":"https://github.com/erilyth/PyGame-Learning-Environment.git","svn_url":"https://github.com/erilyth/PyGame-Learning-Environment","homepage":"","size":4093,"stargazers_count":0,"watchers_count":0,"language":"Python","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":0,"default_branch":"master"}},"base":{"label":"ntasfi:master","ref":"master","sha":"4c0b6abe1966983a13e550899d6a4f50350972ab","user":{"login":"ntasfi","id":627939,"avatar_url":"https://avatars.githubusercontent.com/u/627939?v=3","gravatar_id":"","url":"https://api.github.com/users/ntasfi","html_url":"https://github.com/ntasfi","followers_url":"https://api.github.com/users/ntasfi/followers","following_url":"https://api.github.com/users/ntasfi/following{/other_user}","gists_url":"https://api.github.com/users/ntasfi/gists{/gist_id}","starred_url":"https://api.github.com/users/ntasfi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ntasfi/subscriptions","organizations_url":"https://api.github.com/users/ntasfi/orgs","repos_url":"https://api.github.com/users/ntasfi/repos","events_url":"https://api.github.com/users/ntasfi/events{/privacy}","received_events_url":"https://api.github.com/users/ntasfi/received_events","type":"User","site_admin":false},"repo":{"id":52380933,"name":"PyGame-Learning-Environment","full_name":"ntasfi/PyGame-Learning-Environment","owner":{"login":"ntasfi","id":627939,"avatar_url":"https://avatars.githubusercontent.com/u/627939?v=3","gravatar_id":"","url":"https://api.github.com/users/ntasfi","html_url":"https://github.com/ntasfi","followers_url":"https://api.github.com/users/ntasfi/followers","following_url":"https://api.github.com/users/ntasfi/following{/other_user}","gists_url":"https://api.github.com/users/ntasfi/gists{/gist_id}","starred_url":"https://api.github.com/users/ntasfi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ntasfi/subscriptions","organizations_url":"https://api.github.com/users/ntasfi/orgs","repos_url":"https://api.github.com/users/ntasfi/repos","events_url":"https://api.github.com/users/ntasfi/events{/privacy}","received_events_url":"https://api.github.com/users/ntasfi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ntasfi/PyGame-Learning-Environment","description":"PyGame Learning Environment (PLE) -- Reinforcement Learning Environment in Python.","fork":false,"url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment","forks_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/forks","keys_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/teams","hooks_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/hooks","issue_events_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/issues/events{/number}","events_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/events","assignees_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/assignees{/user}","branches_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/branches{/branch}","tags_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/tags","blobs_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/git/refs{/sha}","trees_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/statuses/{sha}","languages_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/languages","stargazers_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/stargazers","contributors_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/contributors","subscribers_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/subscribers","subscription_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/subscription","commits_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/commits{/sha}","git_commits_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/git/commits{/sha}","comments_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/comments{/number}","issue_comment_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/issues/comments{/number}","contents_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/contents/{+path}","compare_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/merges","archive_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/downloads","issues_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/issues{/number}","pulls_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/pulls{/number}","milestones_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/milestones{/number}","notifications_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/labels{/name}","releases_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/releases{/id}","deployments_url":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/deployments","created_at":"2016-02-23T18:13:39Z","updated_at":"2016-04-30T08:22:01Z","pushed_at":"2016-04-30T05:45:01Z","git_url":"git://github.com/ntasfi/PyGame-Learning-Environment.git","ssh_url":"git@github.com:ntasfi/PyGame-Learning-Environment.git","clone_url":"https://github.com/ntasfi/PyGame-Learning-Environment.git","svn_url":"https://github.com/ntasfi/PyGame-Learning-Environment","homepage":"","size":3365,"stargazers_count":186,"watchers_count":186,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":1,"forks":19,"open_issues":1,"watchers":186,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/pulls/8"},"html":{"href":"https://github.com/ntasfi/PyGame-Learning-Environment/pull/8"},"issue":{"href":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/issues/8"},"comments":{"href":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/ntasfi/PyGame-Learning-Environment/statuses/23e9e89faf316b78454b57502eb499cd93dd0c06"}}}}