User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')' in this line: 'FoxBehavior.prototype.onFoxClicked = function () {' Line Number: 2
User prompt
Белый
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'height')' in this line: 'santa.y = floor.y - santa.height / 2;' Line Number: 148
User prompt
Поставь Пол под дед Морозом
User prompt
Поставь Пол
User prompt
Поставь на все карте Пол
User prompt
Все Полом
User prompt
Поставь Пол под всеми объектами на карте
User prompt
На полу может стоять что угодно
User prompt
Покрась Пол в Белый
User prompt
Содай Пол
User prompt
Поставь локацию Северный полюс
User prompt
Сделав чёрный белым
User prompt
Сделай счётчик белого цвета
User prompt
Fix Bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'upgradeFactory')' in this line: 'self.upgradeFactory = function (factory) {' Line Number: 124
User prompt
Сделай счётик чёрного цвета
User prompt
Fix Bug: 'TypeError: self.upgradeFactory is not a function' in this line: 'self.upgradeFactory();' Line Number: 224
User prompt
Весь чёрный цвет замени на белый
User prompt
Сделай так чтоб фабрики довали 5$ каждые 5 секунд
User prompt
Сделай так что-бы при получение денег на экране возникала полученная сумма
User prompt
Fix Bug: 'TypeError: self.upgradeFactory is not a function' in this line: 'self.upgradeFactory();' Line Number: 209
User prompt
Возьми ассет с движка подарка
User prompt
Возьми ассет с движка
User prompt
Поставь на места старой текстуры фабрики поставь фабрика . PNG файл с телефона возьми
User prompt
Как устоновить ресурсы
var foxTimeout;
var Guard = Container.expand(function () {
var self = Container.call(this);
self.guardGraphics = self.createAsset('guard', 'Guard Graphics', .5, .5);
self.foxesCaught = 0;
self.catchLimit = 10;
self.catchFox = function (fox) {
fox.destroy();
self.foxesCaught++;
if (self.foxesCaught >= self.catchLimit) {
self.destroy();
}
};
self.update = function () {};
});
var Fox = Container.expand(function (speedIncrement) {
var self = Container.call(this);
var foxGraphics = self.createAsset('fox', 'Fox Graphics', .5, .5);
self.speed = 1;
self.interactive = true;
self.buttonMode = true;
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);
self.update = function () {};
});
var ChristmasTree = Container.expand(function () {
var self = Container.call(this);
var treeGraphics = self.createAsset('christmasTree', 'Christmas Tree Graphics', .5, .5);
self.update = function () {};
});
var Gift = Container.expand(function () {
var self = Container.call(this);
var giftGraphics = self.createAsset('gift', 'Gift Graphics', .5, .5);
self.move = function () {};
self.update = function () {};
});
var Santa = Container.expand(function () {
var self = Container.call(this);
var santaGraphics = self.createAsset('santa', 'Santa Graphics', .5, .5);
self.move = function () {};
self.update = function () {};
});
var Factory = Container.expand(function () {
var self = Container.call(this);
var factoryGraphics = self.createAsset('factory', 'Factory Graphics', .5, .5);
self.productionValue = 5;
self.upgradeCost = 1000;
self.produceGift = function () {
LK.setInterval(function () {
LK.setScore(LK.getScore() + self.productionValue);
}, 1000);
};
self.upgradeFactory = function () {
if (LK.getScore() >= self.upgradeCost) {
LK.setScore(LK.getScore() - self.upgradeCost);
self.productionValue *= 2;
self.upgradeCost *= 2;
}
};
self.upgradeFactory = function () {
if (LK.getScore() >= self.upgradeCost) {
LK.setScore(LK.getScore() - self.upgradeCost);
self.productionValue *= 2;
self.upgradeCost *= 2;
}
};
self.terrainUpgrades = [];
self.upgradeTerrain = function () {
self.terrainUpgradeCost = self.terrainUpgradeCost || 50;
if (LK.getScore() >= self.terrainUpgradeCost) {
LK.setScore(LK.getScore() - self.terrainUpgradeCost);
var newUpgrade;
if (Math.random() < 0.5) {
newUpgrade = new ChristmasTree();
} else {
newUpgrade = new GiftDecoration();
}
newUpgrade.x = Math.random() * 2048;
newUpgrade.y = Math.random() * 2732;
self.terrainUpgrades.push(newUpgrade);
LK.stage.addChild(newUpgrade);
self.terrainUpgradeCost *= 2;
}
};
self.update = function () {};
});
var Game = Container.expand(function () {
var self = Container.call(this);
var gifts = [];
var factories = [];
var santa = self.addChild(new Santa());
santa.x = 2048 / 2;
santa.y = 2732 / 2;
var factory = self.addChild(new Factory());
factory.x = 2048 / 4;
factory.y = 2732 / 4;
factories.push(factory);
var scoreTxt = new Text2('0', {
size: 150,
fill: "#ffffff"
});
var purchaseFactoryButton = self.createAsset('purchaseFactoryButton', 'Purchase Factory Button', 0.5, 1);
var purchaseGuardButton = self.createAsset('purchaseGuardButton', 'Purchase Guard Button', 0.5, 1);
purchaseGuardButton.x = 2048 / 2 + purchaseGuardButton.width;
purchaseGuardButton.y = 2732 - purchaseGuardButton.height / 2;
self.addChild(purchaseGuardButton);
purchaseGuardButton.on('down', function () {
var guardCost = 1000;
if (LK.getScore() >= guardCost) {
LK.setScore(LK.getScore() - guardCost);
var newGuard = self.addChild(new Guard());
newGuard.x = Math.random() * 2048;
newGuard.y = Math.random() * 2732;
}
});
var upgradeTerrainButton = self.createAsset('upgradeTerrainButton', 'Upgrade Terrain Button', 0.5, 1);
purchaseFactoryButton.x = 2048 / 2 - purchaseFactoryButton.width;
purchaseFactoryButton.y = 2732 - purchaseFactoryButton.height / 2;
upgradeTerrainButton.x = 2048 / 2 + upgradeTerrainButton.width;
upgradeTerrainButton.y = 2732 - upgradeTerrainButton.height / 2;
self.addChild(purchaseFactoryButton);
self.addChild(upgradeTerrainButton);
purchaseFactoryButton.on('down', function () {
var factoryCost = 100;
if (LK.getScore() >= factoryCost) {
LK.setScore(LK.getScore() - factoryCost);
var newFactory = self.addChild(new Factory());
newFactory.x = 2048 / 4;
newFactory.y = 2732 / 4 * factories.length;
factories.push(newFactory);
newFactory.produceGift();
scoreTxt.setText(LK.getScore());
} else {
var noMoneyTxt = new Text2('No Money', {
size: 100,
fill: "#ff0000"
});
noMoneyTxt.x = LK.stage.width / 2;
noMoneyTxt.y = LK.stage.height / 2;
noMoneyTxt.anchor.set(0.5, 0.5);
LK.gui.addChild(noMoneyTxt);
LK.setTimeout(function () {
noMoneyTxt.destroy();
}, 5000);
}
});
upgradeTerrainButton.on('down', function () {
factory.upgradeTerrain();
scoreTxt.setText(LK.getScore());
});
LK.setScore(5);
scoreTxt.setText(0);
var lastScore = 0;
var foxTimeout;
LK.on('tick', function () {
var currentScore = LK.getScore();
if (currentScore >= lastScore + 100) {
lastScore += 100;
var fox = new Fox(Fox.speedIncrement);
fox.speed += Fox.speedIncrement;
fox.x = Math.random() * 2048;
fox.y = Math.random() * 2732;
self.addChild(fox);
foxTimeout = LK.setTimeout(function () {
fox.stealMoney();
scoreTxt.setText(LK.getScore());
}, 5000);
}
});
scoreTxt.anchor.set(.5, 0);
LK.gui.topCenter.addChild(scoreTxt);
santa.on('down', function (obj) {
console.log('Santa was pressed');
});
factory.on('down', function (obj) {
var upgradeButton = self.createAsset('upgradeButton', 'Upgrade Factory Button', 0.5, 1);
upgradeButton.x = factory.x + factory.getChildAt(0).width / 2 + 20;
upgradeButton.y = factory.y;
self.addChild(upgradeButton);
upgradeButton.on('down', function () {
self.upgradeFactory();
scoreTxt.setText(LK.getScore());
upgradeButton.destroy();
});
factory.produceGift();
scoreTxt.setText(LK.getScore());
});
LK.on('tick', function () {
santa.update();
for (var i = 0; i < factories.length; i++) {
factories[i].update();
}
for (var i = 0; i < gifts.length; i++) {
gifts[i].move();
if (gifts[i].y < -50) {
gifts[i].destroy();
gifts.splice(i, 1);
}
}
});
});
Фабрика 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.