User prompt
Fix Bug: 'TypeError: window is undefined' in this line: '} else if (shapes[a].y >= player.y && shapes[a] instanceof window[player.shape.charAt(0).toUpperCase() + player.shape.slice(1)]) {' Line Number: 57
User prompt
Fix the bugs
User prompt
Fix Bug: 'TypeError: window is undefined' in this line: '} else if (shapes[a].y >= player.y && shapes[a] instanceof window[player.shape.charAt(0).toUpperCase() + player.shape.slice(1)]) {' Line Number: 57
User prompt
Once a 'enemy' shape reaches the character shape check if they are the same kind of shape (square, circle, triangle)
User prompt
Make it so a new shape only spawn once the previous one reaches 3/5 of the screen
User prompt
Make it so the enemies are aligned with the player character when spawning from the top of the screen
User prompt
Fix Bug: 'TypeError: shapes[a] is undefined' in this line: 'self.score += 1;' Line Number: 24
User prompt
Fix Bug: 'TypeError: shapes[a] is undefined' in this line: 'self.score += 1;' Line Number: 24
User prompt
Fix Bug: 'TypeError: shapes[a] is undefined' in this line: 'scoreTxt.setText(player.score);' Line Number: 61
User prompt
Fix Bug: 'TypeError: window is undefined' in this line: 'if (shapes[a] && shapes[a] instanceof window[player.shape.charAt(0).toUpperCase() + player.shape.slice(1)]) {' Line Number: 78
User prompt
The bug is still not fixed
User prompt
Fix the bug where the game ends even if your shape is the same as the shape it colides with.
User prompt
Fix Bug: 'TypeError: invalid 'instanceof' operand shapeTypes[shapeTypes.indexOf(...)]' in this line: 'if (shapes[a] instanceof shapeTypes[shapeTypes.indexOf(player.shape.charAt(0).toUpperCase() + player.shape.slice(1))]) {' Line Number: 58
User prompt
Fix Bug: 'TypeError: window is undefined' in this line: 'if (shapes[a] instanceof shapeTypes[shapeTypes.indexOf(window[player.shape.charAt(0).toUpperCase() + player.shape.slice(1)])]) {' Line Number: 58
User prompt
Fix Bug: 'TypeError: window is undefined' in this line: 'if (shapes[a] instanceof window[player.shape.charAt(0).toUpperCase() + player.shape.slice(1)]) {' Line Number: 58
User prompt
Make it so everytime the "enemy" shape colides with our shape if they are the same shape increase the score by 1, else end the game.
User prompt
Make it so the spawn time is slower, a new one spawns only after the previous reached 3/4 of the screen
User prompt
Make it so the "enemy" shapes only spawn from the top of the screen aligned with the character shape
User prompt
Make it so the "enemy" shapes only spawn on the same line as the character "shape" (on the same x axis level)
User prompt
Move the player character on the bottom of the screen, in the middle.
User prompt
Develop the game further
User prompt
It still does not work properly. Now the only shape displayed is the square.
User prompt
Do what said above.
User prompt
Rewrite the change player shape function so it works corectly. The order of the shapes does not matter, just make it cycle corectly.
User prompt
It still only displays 2 shapes instead of 3.
===================================================================
--- original.js
+++ change.js
@@ -54,9 +54,9 @@
shapes[a].y += shapeSpeed;
if (shapes[a].y > 2732) {
shapes[a].destroy();
shapes.splice(a, 1);
- } else if (shapes[a].matched) {
+ } else if (shapes[a] && shapes[a].matched) {
shapes[a].destroy();
shapes.splice(a, 1);
player.incrementScore();
} else if (shapes[a].y > player.y) {