User prompt
Add houses
User prompt
Please fix the bug: 'Uncaught TypeError: phoneGraphics.containsPoint is not a function' in or related to this line: 'return phoneGraphics.containsPoint(point);' Line Number: 57
User prompt
Add phone in my shop
User prompt
Customer come my shop
User prompt
Customer come my shop
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'detail')' in or related to this line: 'if (obj.event.detail === 2) {' Line Number: 161
User prompt
Buy old phone
User prompt
Create a shop
User prompt
Please fix the bug: 'Uncaught TypeError: player.phones[i].containsPoint is not a function' in or related to this line: 'if (player.phones[i].containsPoint(localPos)) {' Line Number: 100
Initial prompt
Phone seller
===================================================================
--- original.js
+++ change.js
@@ -147,8 +147,17 @@
customer.y = Math.random() * 2732;
customers.push(customer);
game.addChild(customer);
}
+// Initialize customers
+var customers = [];
+for (var i = 0; i < 5; i++) {
+ var customer = new Customer();
+ customer.x = Math.random() * 2048;
+ customer.y = Math.random() * 2732;
+ customers.push(customer);
+ game.addChild(customer);
+}
// Initialize shop
var shop = new Shop();
// Display player's money
var moneyTxt = new Text2('Money: $' + player.money, {
@@ -168,8 +177,12 @@
// Update customers' positions
for (var i = 0; i < customers.length; i++) {
customers[i].update();
}
+ // Update customers' positions
+ for (var i = 0; i < customers.length; i++) {
+ customers[i].update();
+ }
};
// Handle touch events to buy, upgrade, or sell phones
game.down = function (x, y, obj) {
var localPos = game.toLocal(obj.global);