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
@@ -47,9 +47,12 @@
stage.on('down', function (obj) {
var event = obj.event;
var pos = event.getLocalPosition(self);
for (var a = shapes.length - 1; a >= 0; a--) {
- if (shapes[a] && shapes[a].containsPoint(pos)) {
+ if (shapes[a] && shapes[a].containsPoint({
+ x: pos.x,
+ y: pos.y
+ })) {
shapes[a].match();
}
}
});