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,13 +1,5 @@
var foxTimeout;
-var Floor = Container.expand(function () {
- var self = Container.call(this);
- var floorGraphics = self.createAsset('floor', 'Floor Graphics', 0, 1);
- floorGraphics.width = LK.stage.width;
- floorGraphics.height = LK.stage.height;
- self.y = LK.stage.height - self.height;
- self.update = function () {};
-});
var Guard = Container.expand(function () {
var self = Container.call(this);
self.setLocation('North Pole');
self.guardGraphics = self.createAsset('guard', 'Guard Graphics', .5, .5);
@@ -114,17 +106,13 @@
self.terrainUpgradeCost = self.terrainUpgradeCost || 50;
if (LK.getScore() >= self.terrainUpgradeCost) {
LK.setScore(LK.getScore() - self.terrainUpgradeCost);
var newUpgrade;
- var assetId, assetDescription;
if (Math.random() < 0.5) {
- assetId = 'christmasTree';
- assetDescription = 'Christmas Tree Graphics';
+ newUpgrade = new ChristmasTree();
} else {
- assetId = 'giftDecoration';
- assetDescription = 'Gift Decoration Graphics';
+ newUpgrade = new GiftDecoration();
}
- newUpgrade = new FloorItem(assetId, assetDescription);
newUpgrade.x = Math.random() * 2048;
newUpgrade.y = Math.random() * 2732;
self.terrainUpgrades.push(newUpgrade);
LK.stage.addChild(newUpgrade);
@@ -141,25 +129,30 @@
factory.upgradeCost *= 2;
}
};
var self = Container.call(this);
- var floor = self.addChild(new Floor());
- floor.width = LK.stage.width;
- floor.height = LK.stage.height;
var gifts = [];
var factories = [];
var santa = self.addChild(new Santa());
santa.x = 2048 / 2;
- var floor = self.addChild(new Floor());
- santa.y = floor.y - santa.height / 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 compareGroundButton = self.createAsset('compareGroundButton', 'Compare Ground Button', 0.5, 1);
+ compareGroundButton.x = 2048 / 2;
+ compareGroundButton.y = 2732 - compareGroundButton.height * 1.5;
+ self.addChild(compareGroundButton);
+ compareGroundButton.on('down', function () {
+ self.terrainUpgrades.forEach(function (upgrade) {
+ upgrade.alpha = upgrade.alpha === 1 ? 0.5 : 1;
+ });
+ });
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;
@@ -231,8 +224,21 @@
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(factory);
+ 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();
Фабрика 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.