Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-2/cuujooceevii61
This commit is contained in:
@@ -14,3 +14,5 @@ nav:
|
|||||||
- Taskflow en wireflow: "brainstorm/task flow"
|
- Taskflow en wireflow: "brainstorm/task flow"
|
||||||
- Storyboard: "brainstorm/storyboard"
|
- Storyboard: "brainstorm/storyboard"
|
||||||
- to-do list: "brainstorm/to-do list"
|
- to-do list: "brainstorm/to-do list"
|
||||||
|
- 📚 Documentatie:
|
||||||
|
- Presentatie: documentatie/presentatie.md
|
0
docs/documentatie/presentatie.md
Normal file
0
docs/documentatie/presentatie.md
Normal file
@@ -178,7 +178,7 @@ function draw() {
|
|||||||
|
|
||||||
bullets.forEach(myBullet => {
|
bullets.forEach(myBullet => {
|
||||||
//zolang mybullet bestaat blijft hij drawen en updaten
|
//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();
|
myBullet.draw();
|
||||||
|
|
||||||
if (isOffScreen == true) {
|
if (isOffScreen == true) {
|
||||||
|
@@ -49,8 +49,9 @@ class bullet {
|
|||||||
shot = false;
|
shot = false;
|
||||||
}
|
}
|
||||||
let isOffScreen = this.projectile.x < 0 || this.projectile.x > width || this.projectile.y < 0 || this.projectile.y > height;
|
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};
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user