diff --git a/docs/.pages b/docs/.pages index ba8b1a5..f7cb296 100644 --- a/docs/.pages +++ b/docs/.pages @@ -13,4 +13,6 @@ nav: - Game idee: "brainstorm/game idee" - Taskflow en wireflow: "brainstorm/task flow" - Storyboard: "brainstorm/storyboard" - - to-do list: "brainstorm/to-do list" \ No newline at end of file + - to-do list: "brainstorm/to-do list" + - 📚 Documentatie: + - Presentatie: documentatie/presentatie.md \ No newline at end of file diff --git a/docs/documentatie/presentatie.md b/docs/documentatie/presentatie.md new file mode 100644 index 0000000..e69de29 diff --git a/web/game.js b/web/game.js index d6bba70..8939190 100644 --- a/web/game.js +++ b/web/game.js @@ -178,7 +178,7 @@ function draw() { bullets.forEach(myBullet => { //zolang mybullet bestaat blijft hij drawen en updaten - ({ hit, shot, isOffScreen } = myBullet.update(playerPosX, playerPosY)); + ({ hit, shot, isOffScreen, originalPos } = myBullet.update(playerPosX, playerPosY)); myBullet.draw(); if (isOffScreen == true) { diff --git a/web/js/basicbullet.js b/web/js/basicbullet.js index b69e6c2..1ba2506 100644 --- a/web/js/basicbullet.js +++ b/web/js/basicbullet.js @@ -49,8 +49,9 @@ class bullet { shot = false; } let isOffScreen = this.projectile.x < 0 || this.projectile.x > width || this.projectile.y < 0 || this.projectile.y > height; + let originalPos = this.projectile.x == this.targetx || this.projectile.y == this.targety; - return { hit, shot, isOffScreen}; + return { hit, shot, isOffScreen, originalPos}; } } \ No newline at end of file