User prompt
There will be 3 available shapes: A Circle, A square and A triangle. By every click the player changes the shape to one of those 3.
User prompt
Fix Bug: 'TypeError: shapes[a].containsPoint is not a function' in this line: 'if (shapes[a] && shapes[a].containsPoint(pos)) {' Line Number: 51
User prompt
Fix Bug: 'TypeError: shapes[a] is undefined' in this line: 'if (shapes[a].containsPoint(pos)) {' Line Number: 51
User prompt
Fix Bug: 'TypeError: shapes[a] is undefined' in this line: 'if (shapes[a].matched) {' Line Number: 32
Initial prompt
Shape Match FRVR
===================================================================
--- original.js
+++ change.js
@@ -27,10 +27,10 @@
scoreTxt.setText(player.score);
scoreTxt.anchor.set(.5, 0);
LK.gui.topCenter.addChild(scoreTxt);
LK.on('tick', function () {
- for (var a = shapes.length; a >= 0; a--) {
- if (shapes[a].matched) {
+ for (var a = shapes.length - 1; a >= 0; a--) {
+ if (shapes[a] && shapes[a].matched) {
shapes[a].destroy();
shapes.splice(a, 1);
player.incrementScore();
scoreTxt.setText(player.score);