User prompt
поставь таймер 10 секунд и добавку к таймеру не 60 секунд а 10. баланс 5000
User prompt
давай добавим нового врага - это monstr. У него точно такоеже поведение как и у акул. Но он атакует рыб в два раза чаще. Monstr появляется тогда когда акул спавнится 3 или больше. При появлении monstr исчезают 3 акулы и у monstr здоровья становится столькоже скольку у трех этих акул. Пираньи реагируют на monstr также как и на акул.
User prompt
Сделай стоимость большого корма 20
User prompt
сделай баланс 5000
User prompt
как можно оптимизировать игру что бы на поздних стадиях не сильно тормозило когда огромное количество рыб и корма плавает
User prompt
что-то не то. Автоклик сразу сработал
User prompt
Отлично мне это подходит так и сделай
User prompt
сделай баланс 50
User prompt
на иконку большого корма не работает анимация и звук во время автонажатия
User prompt
ускорь автонажатие в 2 раза
User prompt
Нужно добавить еще и обычное нажатие, а не только в зажиме
User prompt
иконка корма нажимается но нет анимации и звук и еще они перестали нажиматься как раньше, а это нужно тоже оставить.
User prompt
пересмотри весь код и постарайся сделать все иконки с кормом точно такимиже в плане нажатия
User prompt
иконку корма тоже нужно сделать так же
User prompt
Иконки корма должны нажиматься точно также и с сохранением анимации и звука
User prompt
примени теперь этот же метод к иконкам корма
User prompt
можешь при этом сохранить звук создания и анимацию сжимания и разжимания.
User prompt
сделай баланс 5000
User prompt
сделай так чтобы предметы покапались не только нажатием на иконку но и зажимая ее, что бы рука не уставала
User prompt
Please fix the bug: 'Uncaught ReferenceError: tween is not defined' in or related to this line: 'tween(cormIcon, {' Line Number: 762 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
иконка создания рыб работает сама по себе исправь
User prompt
почему-то когда я отпускаю она все равно продолжает нажимать
User prompt
по прежнему иконка создания рыб работает не корректно
User prompt
на иконке рыб почемуто не работает
User prompt
да нет же анимаци и звук должны быть во время зажатия
===================================================================
--- original.js
+++ change.js
@@ -636,9 +636,9 @@
piranhaCostText.x = piranhaIcon.x;
piranhaCostText.y = piranhaIcon.y + 150;
self.addChild(piranhaCostText);
// Add cost display under bigcorm icon
- bigCormCostText = new Text2('$20', {
+ bigCormCostText = new Text2('$15', {
size: 80,
fill: 0x00FF00
});
bigCormCostText.anchor.set(0.5, 0);
@@ -710,10 +710,10 @@
});
}
});
// Create and drop a new bigcorm from the top
- if (balance >= 20) {
- balance -= 20;
+ if (balance >= 15) {
+ balance -= 15;
balanceText.setText('$' + balance);
var bigCorm = new BigCorm();
bigCorm.x = Math.random() * (2048 - 500) + 200; // Random x position within 200 units from both edges
bigCorm.y = 750; // Start from a slightly lower position
@@ -854,8 +854,67 @@
}
}
};
});
+// Monstr class representing a more aggressive shark
+var Monstr = Container.expand(function () {
+ var self = Container.call(this);
+ var monstrGraphics = self.attachAsset('Monstr', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.health = 0; // Health will be set when Monstr is spawned
+ self.speed = Math.random() * 2 + 1; // Random speed for each Monstr
+ self.direction = 1; // Monstr always swim to the right when they appear
+ // Update function to move the Monstr
+ self.update = function () {
+ if (self.x < aquarium.x - aquarium.width / 2 + 100) {
+ self.direction = 1; // Move right
+ monstrGraphics.scaleX = 1; // Ensure Monstr is facing right
+ } else if (self.x > aquarium.x + aquarium.width / 2 - 100) {
+ self.direction = -1; // Move left
+ monstrGraphics.scaleX = -1; // Ensure Monstr is facing left
+ }
+ self.x += self.speed * self.direction;
+ if (self.x < -self.width / 2 || self.x > 2048 + self.width / 2 || self.health <= 0) {
+ self.destroy();
+ game.monstr = null;
+ }
+ // Find the nearest small fish
+ var nearestFish = null;
+ var minDistance = Infinity;
+ var targetFishes = fishes.filter(function (fish) {
+ return true; // Allow Monstr to target both small and big fish
+ });
+ targetFishes.forEach(function (fish) {
+ var distance = Math.sqrt(Math.pow(fish.x - self.x, 2) + Math.pow(fish.y - self.y, 2));
+ if (distance < minDistance) {
+ minDistance = distance;
+ nearestFish = fish;
+ }
+ });
+ if (nearestFish && (self.lastEatTime === undefined || LK.ticks - self.lastEatTime >= 120)) {
+ // Move towards the nearest fish
+ var angle = Math.atan2(nearestFish.y - self.y, nearestFish.x - self.x);
+ self.x += Math.cos(angle) * 4;
+ self.y += Math.sin(angle) * 4;
+ monstrGraphics.scaleX = Math.cos(angle) < 0 ? -1 : 1; // Flip the Monstr based on direction
+ // Check if Monstr intersects with the fish
+ if (self.intersects(nearestFish)) {
+ if (self.lastEatTime === undefined || LK.ticks - self.lastEatTime >= 120) {
+ // Check if 2 seconds have passed
+ var index = fishes.indexOf(nearestFish);
+ if (index !== -1) {
+ nearestFish.destroy(); // Ensure fish is destroyed immediately upon consumption
+ fishes.splice(index, 1);
+ }
+ LK.getSound('emyakula').play(); // Play 'emyakula' sound when Monstr eats a fish
+ self.lastEatTime = LK.ticks; // Update last eat time
+ }
+ }
+ }
+ };
+});
// Pirand class representing a piranha skeleton
var Pirand = Container.expand(function () {
var self = Container.call(this);
var pirandGraphics = self.attachAsset('pirand', {
@@ -1221,13 +1280,33 @@
}, 500);
}
} else if (countdown === 0) {
countdown += 60; // Extend the countdown by 60 seconds
- for (var i = 0; i < akulaCount; i++) {
- var akula = new Akula();
- akula.x = 2048 + akula.width / 2; // Position on the right side of the screen
- akula.y = Math.random() * (2732 - 200) + 100; // Random y position within screen bounds
- game.addChild(akula);
+ if (akulaCount >= 3) {
+ // Remove 3 Akulas and spawn a Monstr
+ var akulasToRemove = 3;
+ var totalHealth = 0;
+ game.children = game.children.filter(function (child) {
+ if (child instanceof Akula && akulasToRemove > 0) {
+ totalHealth += child.health;
+ child.destroy();
+ akulasToRemove--;
+ return false;
+ }
+ return true;
+ });
+ var monstr = new Monstr();
+ monstr.x = 2048 + monstr.width / 2; // Position on the right side of the screen
+ monstr.y = Math.random() * (2732 - 200) + 100; // Random y position within screen bounds
+ monstr.health = totalHealth; // Set Monstr's health to the total health of removed Akulas
+ game.addChild(monstr);
+ } else {
+ for (var i = 0; i < akulaCount; i++) {
+ var akula = new Akula();
+ akula.x = 2048 + akula.width / 2; // Position on the right side of the screen
+ akula.y = Math.random() * (2732 - 200) + 100; // Random y position within screen bounds
+ game.addChild(akula);
+ }
}
akulaCount++; // Increase the number of sharks for the next spawn
// Increase health of all Akula instances based on the number of Akulas spawned
game.children.forEach(function (child) {
прозрачный пузырь воздуха. 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
spawnpuzir
Sound effect
Lop
Sound effect
click
Sound effect
clickkorm
Sound effect
Emy
Sound effect
MonetaSpawn
Sound effect
MonetaUp
Sound effect
Deadfish
Sound effect
rost
Sound effect
akulaspawn
Sound effect
ataka
Sound effect
emyakula
Sound effect
sundukup
Sound effect
Music
Music
music2
Music
udarbonus
Sound effect
udarbonus2
Sound effect
udarbonus3
Sound effect
startbonus
Sound effect
osmincorm
Sound effect