User prompt
Кнопка купить улучшение местности может заставить Пол подарок и ёлку
User prompt
Измени местность на Белый
User prompt
Стоимость пола 1кв² 1$
User prompt
Стоимость пола 1$
User prompt
Стоимость пола 1
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'forEach')' in this line: 'self.terrainUpgrades.forEach(function (upgrade) {' Line Number: 152
User prompt
Кнопка Пол сравнить объект floor
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'forEach')' in this line: 'self.terrainUpgrades.forEach(function (upgrade) {' Line Number: 153
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'forEach')' in this line: 'self.terrainUpgrades.forEach(function (upgrade) {' Line Number: 152
User prompt
Стоимость пола 0$
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'forEach')' in this line: 'self.terrainUpgrades.forEach(function (upgrade) {' Line Number: 153
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'forEach')' in this line: 'self.terrainUpgrades.forEach(function (upgrade) {' Line Number: 152
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'forEach')' in this line: 'self.terrainUpgrades.forEach(function (upgrade) {' Line Number: 151
User prompt
Сделай кнопку которая сравнить Пол под объектами а потом и про сто
User prompt
Сделай дефолтный Белый Пол
User prompt
Сделай чёрный белым
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')' in this line: 'FoxBehavior.prototype.onFoxClicked = function () {' Line Number: 2
===================================================================
--- original.js
+++ change.js
@@ -1,51 +1,9 @@
var foxTimeout;
-FoxBehavior.prototype.onFoxClicked = function () {
- var guards = LK.stage.children.filter(function (child) {
- return child instanceof Guard;
- });
- if (guards.length > 0) {
- var closestGuard = guards.reduce(function (prev, curr) {
- var prevDistance = Math.sqrt(Math.pow(prev.x - this.x, 2) + Math.pow(prev.y - this.y, 2));
- var currDistance = Math.sqrt(Math.pow(curr.x - this.x, 2) + Math.pow(curr.y - this.y, 2));
- return prevDistance < currDistance ? prev : curr;
- });
- closestGuard.catchFox(this);
- } else {
- LK.clearTimeout(foxTimeout);
- this.destroy();
- }
-};
-FoxBehavior.prototype.moveFox = function () {
- this.y += this.speed;
-};
-FoxBehavior.prototype.stealMoney = function () {
- if (LK.getScore() >= 100) {
- LK.setScore(LK.getScore() - 100);
- }
- this.destroy();
-};
-var FoxBehavior = Container.expand(function (speedIncrement) {
- var self = Container.call(this);
- var foxGraphics = self.createAsset('fox', 'Fox Graphics', .5, .5);
- self.speed = 1 + (speedIncrement || 0.5);
- self.interactive = true;
- self.buttonMode = true;
- self.on('down', self.onFoxClicked);
- self.update = self.moveFox;
-});
-var FoxBehavior = Container.expand(function (speedIncrement) {
- var self = Container.call(this);
- var foxGraphics = self.createAsset('fox', 'Fox Graphics', .5, .5);
- self.speed = 1 + (speedIncrement || 0.5);
- self.interactive = true;
- self.buttonMode = true;
- self.on('down', self.onFoxClicked);
- self.update = self.moveFox;
-});
var Floor = Container.expand(function () {
var self = Container.call(this);
var floorGraphics = self.createAsset('floor', 'Floor Graphics', 0, 1);
+ floorGraphics.tint = 0xFFFFFF;
floorGraphics.width = LK.stage.width;
floorGraphics.height = LK.stage.height;
self.y = LK.stage.height - self.height;
self.update = function () {};
@@ -64,16 +22,40 @@
}
};
self.update = function () {};
});
-var FoxBehavior = Container.expand(function (speedIncrement) {
+var Fox = Container.expand(function (speedIncrement) {
var self = Container.call(this);
var foxGraphics = self.createAsset('fox', 'Fox Graphics', .5, .5);
- self.speed = 1 + (speedIncrement || 0.5);
+ self.speed = 1;
self.interactive = true;
self.buttonMode = true;
- self.on('down', self.onFoxClicked);
- self.update = self.moveFox;
+ self.on('down', function () {
+ var guards = LK.stage.children.filter(function (child) {
+ return child instanceof Guard;
+ });
+ if (guards.length > 0) {
+ var closestGuard = guards.reduce(function (prev, curr) {
+ var prevDistance = Math.sqrt(Math.pow(prev.x - self.x, 2) + Math.pow(prev.y - self.y, 2));
+ var currDistance = Math.sqrt(Math.pow(curr.x - self.x, 2) + Math.pow(curr.y - self.y, 2));
+ return prevDistance < currDistance ? prev : curr;
+ });
+ closestGuard.catchFox(self);
+ } else {
+ LK.clearTimeout(foxTimeout);
+ self.destroy();
+ }
+ });
+ self.stealMoney = function () {
+ if (LK.getScore() >= 100) {
+ LK.setScore(LK.getScore() - 100);
+ }
+ self.destroy();
+ };
+ self.update = function () {
+ self.y += self.speed;
+ };
+ Fox.speedIncrement = speedIncrement || 0.5;
});
var GiftDecoration = Container.expand(function () {
var self = Container.call(this);
var giftDecorationGraphics = self.createAsset('giftDecoration', 'Gift Decoration Graphics', .5, .5);
Фабрика Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Лис в новогодний шапке Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Рождественская ёлка Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Стрелочка в верх Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Покупка Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Санта Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Разноцветный подарок Подарок Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.