From 96326646145a6d8e14ccafa33b50fe2c3d336967 Mon Sep 17 00:00:00 2001 From: sam Date: Tue, 9 Jan 2024 14:05:45 +0100 Subject: [PATCH 1/5] Added documentation about switching "pages" in p5 --- teamdocumentatie/switchcanvas.js | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 teamdocumentatie/switchcanvas.js diff --git a/teamdocumentatie/switchcanvas.js b/teamdocumentatie/switchcanvas.js new file mode 100644 index 0000000..80b3f31 --- /dev/null +++ b/teamdocumentatie/switchcanvas.js @@ -0,0 +1,38 @@ +let canvasSwitch = true; + +function setup(){ + createCanvas(400, 400); + } + +function draw(){ + //draw a backgroun every frame + background(220) + //switch canvas when spacebar is pressed + if (canvasSwitch == false){ + canvas1(); + } + + if (canvasSwitch == true){ + canvas2(); + } + +} + +function keyPressed(){ + if (keyCode === 32){ // 32 is the keyCode for the space bar + //if canvasSwitch is true, set it to false, vice versa + canvasSwitch = !canvasSwitch; + } +} + +//draw a yellow circle on canvas 1 +function canvas1(){ + fill(255, 255, 0) + circle (200, 200, 50); +} + +//draw a red circle on canvas 2 +function canvas2(){ + fill(255, 0, 0) + circle (300, 200, 50); +} \ No newline at end of file From 503cfbaa2c1112bba4415752c688b4c1f43f21d2 Mon Sep 17 00:00:00 2001 From: sam Date: Tue, 9 Jan 2024 14:09:45 +0100 Subject: [PATCH 2/5] Added documentation --- docs/documentatie/Documentatie game.md | 44 +++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/docs/documentatie/Documentatie game.md b/docs/documentatie/Documentatie game.md index fbd2fe8..353695f 100644 --- a/docs/documentatie/Documentatie game.md +++ b/docs/documentatie/Documentatie game.md @@ -1 +1,43 @@ -### \ No newline at end of file +### Van canvas switchen +```js +//Geschreven door Sam +//Is mischien een beetje een scuffed manier maar het werkt en het geeft een beetje de richting waar je op kan gaan +let canvasSwitch = true; + +function setup(){ + createCanvas(400, 400); + } + +function draw(){ + //draw a background every frame + background(220) + //switch canvas when spacebar is pressed + if (canvasSwitch == false){ + canvas1(); + } + + if (canvasSwitch == true){ + canvas2(); + } + +} + +function keyPressed(){ + if (keyCode === 32){ // 32 is the keyCode for the space bar + //if canvasSwitch is true, set it to false, vice versa + canvasSwitch = !canvasSwitch; + } +} + +//draw a yellow circle on canvas 1 +function canvas1(){ + fill(255, 255, 0) + circle (200, 200, 50); +} + +//draw a red circle on canvas 2 +function canvas2(){ + fill(255, 0, 0) + circle (300, 200, 50); +} +``` \ No newline at end of file From cf05b42891bdecbc4273248364f98ce35ba47968 Mon Sep 17 00:00:00 2001 From: sam Date: Wed, 10 Jan 2024 15:29:18 +0100 Subject: [PATCH 3/5] Added feedback from sprint review --- docs/documentatie/Feedback.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/documentatie/Feedback.md b/docs/documentatie/Feedback.md index e9bd4e4..1b5f3e2 100644 --- a/docs/documentatie/Feedback.md +++ b/docs/documentatie/Feedback.md @@ -69,4 +69,12 @@ We hebben nieuwe ideeën en inzichten over hoe we het spel kunnen maken. Nieuwe ### Conclusie De game moet duidelijker zijn wanneer je het begint met spelen en wat makkelijker zijn aan het begin. De UI moet ook wat duidelijker worden met wat je moet doen. Verder moet er ook wat meer progressie in komen. We hebben ook een aantal positieve dingen gehoord: *geinig spel* en het *lijkt echt op een arcade game*. We hebben ook met de user tests een aantal bugs gevonden die we gaan patchen zoals dat de bullet speed per computer anders is. We hebben al nieuwe user stories aangemaakt over de feedback zodat we ons spel kunnen verbeteren, beivoorbeeld over de UI en dat de game moet meeschalen aan het scherm. +### Feedback van presentatie +### Tips +* Game meer laten zien +* duidelijker maken wat boss is +### tops +* duidelijk presentatie +* beginnen met spel +* goede taakverdeling From 02ea0618e34a78437199ff05fca1f9a8e886c78c Mon Sep 17 00:00:00 2001 From: sam Date: Wed, 10 Jan 2024 15:40:37 +0100 Subject: [PATCH 4/5] Code cleanup --- web/game.js | 63 ------------------------------------------------ web/js/Menu.js | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 63 deletions(-) create mode 100644 web/js/Menu.js diff --git a/web/game.js b/web/game.js index 9a5f78a..371aa88 100644 --- a/web/game.js +++ b/web/game.js @@ -570,69 +570,6 @@ function spawnRandomBullet() { } } - -function homescreen() { - textAlign(CENTER); - button(255, 255, 255, width / 2 - 90, height / 2, 200, 40, "Start Game") - button(255, 255, 255, width / 2 - 90, height / 2 + 50, 200, 40, "Scores") - - push() - stroke(255, 255, 255) - strokeWeight(5) - fill(0, 255, 0, 0) - rect(100, 150, 300, 400) - pop() - //highscores rectangle - push() - textSize(50) - fill(255, 255, 255) - text("Highscores", 250, 200) - pop() - - push() - fill(255, 255, 255) - textSize(25) - textAlign(CENTER) - // if (requesteddata.length > 0) { - // text("1. " + requesteddata[0].Naam + ": " + requesteddata[0].Score, 250, 250) - // } - for (let i = 0; i < requesteddata.length; i++) { - text(i + 1 + ". " + requesteddata[i].Naam + ": " + requesteddata[i].Score, 250, 250 + (i * 30)) - } - pop() - - push() - stroke(255, 255, 255) - strokeWeight(5) - fill(0, 255, 0, 0) - rect(860, 150, 300, 400) - pop() - - push() - textSize(50) - fill(255, 255, 255) - text("Controls", 1000, 200) - pop() -} - - - -function button(r, g, b, buttonX, buttonY, buttonWidth, buttonHeight, buttonText) { - push() - fill(0, 0, 50) - rect(buttonX, buttonY, buttonWidth, buttonHeight) - textSize(25) - fill(r, g, b) - text(buttonText, buttonX + 100, buttonY + 30) - textAlign(CENTER); - // if (mouseX > buttonX - 90 && mouseX < width / 2 + 110 && mouseY > height / 2 && mouseY < buttonY + 40) { - // if (mouseIsPressed) { - // homescreenOn = false; - // } - // } - pop() -} - function game() { if (!(lives == 0)) { // draw player diff --git a/web/js/Menu.js b/web/js/Menu.js new file mode 100644 index 0000000..c119c21 --- /dev/null +++ b/web/js/Menu.js @@ -0,0 +1,65 @@ +function scoremenu(){ + + + +} + +function homescreen() { + textAlign(CENTER); + button(255, 255, 255, width / 2 - 90, height / 2, 200, 40, "Start Game") + button(255, 255, 255, width / 2 - 90, height / 2 + 50, 200, 40, "Scores") + + push() + stroke(255, 255, 255) + strokeWeight(5) + fill(0, 255, 0, 0) + rect(100, 150, 300, 400) + pop() + //highscores rectangle + push() + textSize(50) + fill(255, 255, 255) + text("Highscores", 250, 200) + pop() + + push() + fill(255, 255, 255) + textSize(25) + textAlign(CENTER) + // if (requesteddata.length > 0) { + // text("1. " + requesteddata[0].Naam + ": " + requesteddata[0].Score, 250, 250) + // } + for (let i = 0; i < requesteddata.length; i++) { + text(i + 1 + ". " + requesteddata[i].Naam + ": " + requesteddata[i].Score, 250, 250 + (i * 30)) + } + pop() + + push() + stroke(255, 255, 255) + strokeWeight(5) + fill(0, 255, 0, 0) + rect(860, 150, 300, 400) + pop() + + push() + textSize(50) + fill(255, 255, 255) + text("Controls", 1000, 200) + pop() +} + +function button(r, g, b, buttonX, buttonY, buttonWidth, buttonHeight, buttonText) { + push() + fill(0, 0, 50) + rect(buttonX, buttonY, buttonWidth, buttonHeight) + textSize(25) + fill(r, g, b) + text(buttonText, buttonX + 100, buttonY + 30) + textAlign(CENTER); + // if (mouseX > buttonX - 90 && mouseX < width / 2 + 110 && mouseY > height / 2 && mouseY < buttonY + 40) { + // if (mouseIsPressed) { + // homescreenOn = false; + // } + // } + pop() +} \ No newline at end of file From 3cb67403a2b77d9a710423faad768a1da99b4509 Mon Sep 17 00:00:00 2001 From: sam Date: Wed, 10 Jan 2024 15:41:10 +0100 Subject: [PATCH 5/5] Added script --- web/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/web/index.html b/web/index.html index 3934d4d..3fa42b7 100644 --- a/web/index.html +++ b/web/index.html @@ -10,6 +10,7 @@ +