{"action":"opened","issue":{"url":"https://api.github.com/repos/Phazy1996/Snake-Game/issues/3","repository_url":"https://api.github.com/repos/Phazy1996/Snake-Game","labels_url":"https://api.github.com/repos/Phazy1996/Snake-Game/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/Phazy1996/Snake-Game/issues/3/comments","events_url":"https://api.github.com/repos/Phazy1996/Snake-Game/issues/3/events","html_url":"https://github.com/Phazy1996/Snake-Game/issues/3","id":178337225,"number":3,"title":"Overzicht dmv functions","user":{"login":"erwinhenraat","id":1262745,"avatar_url":"https://avatars.githubusercontent.com/u/1262745?v=3","gravatar_id":"","url":"https://api.github.com/users/erwinhenraat","html_url":"https://github.com/erwinhenraat","followers_url":"https://api.github.com/users/erwinhenraat/followers","following_url":"https://api.github.com/users/erwinhenraat/following{/other_user}","gists_url":"https://api.github.com/users/erwinhenraat/gists{/gist_id}","starred_url":"https://api.github.com/users/erwinhenraat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erwinhenraat/subscriptions","organizations_url":"https://api.github.com/users/erwinhenraat/orgs","repos_url":"https://api.github.com/users/erwinhenraat/repos","events_url":"https://api.github.com/users/erwinhenraat/events{/privacy}","received_events_url":"https://api.github.com/users/erwinhenraat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-21T12:49:21Z","updated_at":"2016-09-21T12:49:21Z","closed_at":null,"body":"Je hebt feedback gekregen van **erwinhenraat**\nop:\n```c\n update: function () {\n            if (cursors.right.isDown && direction != 'left') {\n                new_direction = 'right';\n            } else if (cursors.left.isDown && direction != 'right') {\n                new_direction = 'left';\n            } else if (cursors.up.isDown && direction != 'down') {\n                new_direction = 'up';\n            } else if (cursors.down.isDown && direction != 'up') {\n                new_direction = 'down';\n            }\n \n            speed = Math.min(10, Math.floor(score / 5));\n \n \n            updateDelay++;\n \n            if (updateDelay % (10 - speed) == 0) {\n                var firstCell = snake[snake.length - 1],\n                    lastCell = snake.shift(),\n                    oldLastCellx = lastCell.x,\n                    oldLastCelly = lastCell.y;\n \n                if (new_direction) {\n                    direction = new_direction;\n                    new_direction = null;\n                }\n \n                if (direction == 'right') {\n                    lastCell.x = firstCell.x + 15;\n                    lastCell.y = firstCell.y;\n                } else if (direction == 'left') {\n                    lastCell.x = firstCell.x - 15;\n                    lastCell.y = firstCell.y;\n                } else if (direction == 'up') {\n                    lastCell.x = firstCell.x;\n                    lastCell.y = firstCell.y - 15;\n                } else if (direction == 'down') {\n                    lastCell.x = firstCell.x;\n                    lastCell.y = firstCell.y + 15;\n                }\n                this.appleCollision();\n \n                this.selfCollision(firstCell);\n \n                this.wallCollision(firstCell);\n       \n \n                snake.push(lastCell);\n                firstCell = lastCell;\n            }\n \n            if (addNew) {\n                snake.unshift(game.add.sprite(oldLastCellx, oldLastCelly, 'snake'));\n                addNew = false;\n            }\n \n           \n    }, \n```\n\nURL: https://github.com/Phazy1996/Snake-Game/blob/master/assets/js/game.js\n\nFeedback: Ook weer onduidelijk wat er gebeurt in de update.\nZorg voor helder afgebakende functies en roep die dan aan vanuit je update.\nUpdate dekt nu niet de lading van wat er gebeurt.[](http://www.studiozoetekauw.nl/codereview-in-het-onderwijs/ '#cr:{\"sha\":\"821b0c1122645bd6edf5f65900e76bf1530788b2\",\"path\":\"assets/js/game.js\",\"reviewer\":\"erwinhenraat\"}')"}}
{"actor":{"display_login":"erwinhenraat"}}