User prompt
her 30 skorda 1 can eklensin
User prompt
balık imlecin 5 cm altından yönlendirilsin
User prompt
balık imlecin 3 cm altından yönlendirilsin
User prompt
kırmızı balık imleç ile beraber hareket etsin
User prompt
son komutu geri al
User prompt
imleç alttayken kırmızı balık hareket ettirilebilsin
User prompt
kırmızı balık imlecin üst kısmında kalsın 1 cm boşluk olsun
User prompt
kırmızı balık imlecin tam altından olmasın
User prompt
her 90 skordan sonra zorluk %10 artsın
User prompt
skor her 30 u geçtiğinde bir can tekrar aktif edilsin
User prompt
oyunun arka planında games daima aktif olsun
User prompt
skor doksandan sonra değişiklik olmasın
User prompt
skor doksana geldiğinde zorluklar %10 artsın
User prompt
büyük balığa takıldığında obstacle sesi aktif edilsin
User prompt
bütün engellere takıldığında obstacle sesi aktif edilsin
User prompt
ödülleri ve küçük balığı topladığında ses efekti devreye girsin
User prompt
son komutu geri al
User prompt
engellere takıldığında devreye ikinci ses girsin
User prompt
ödül ve küçük balıkları topladığında ses efekti aktif edilsin
User prompt
son komutu geri al
User prompt
engellere takıldığında farklı bir ses efekti aktif edilsin
User prompt
küçük balığı yediğinde ses efekti aktif edilsin
User prompt
ödülleri topladığında ses efekti aktif edilsin
User prompt
son komutu geri al
/****
* Classes
****/
var EnemyFish = Container.expand(function () {
var self = Container.call(this);
var fishGraphics = self.attachAsset('enemyFish', {
anchorX: 0.5,
anchorY: 0.5,
rotation: Math.random() * 2 * Math.PI // Add random rotation
});
self.speed = Math.random() * 3 + 2;
self.size = (Math.random() * 1.0 + 1.0) * 1.2;
self.update = function () {
self.y += self.speed;
if (self.y > 2732) {
self.y = -100;
self.x = Math.random() * 2048;
}
};
});
// Class for the first obstacle
var Obstacle1 = Container.expand(function () {
var self = Container.call(this);
var obstacleGraphics = self.attachAsset('obstacle1', {
anchorX: 0.5,
anchorY: 0.5,
rotation: Math.random() * 2 * Math.PI // Add random rotation
});
self.speed = Math.random() * 3 + 2;
self.size = (Math.random() * 4.5 + 4.0) * 1.2;
self.update = function () {
self.y += self.speed;
if (self.y > 2732) {
self.y = -100;
self.x = Math.random() * 2048;
}
};
});
var Obstacle2 = Container.expand(function () {
var self = Container.call(this);
var obstacleGraphics = self.attachAsset('obstacle2', {
anchorX: 0.5,
anchorY: 0.5,
rotation: Math.random() * 2 * Math.PI // Add random rotation
});
self.speed = Math.random() * 3 + 2;
self.size = (Math.random() * 4.5 + 4.0) * 1.2;
self.update = function () {
self.y += self.speed;
if (self.y > 2732) {
self.y = -100;
self.x = Math.random() * 2048;
}
};
});
var Obstacle3 = Container.expand(function () {
var self = Container.call(this);
var obstacleGraphics = self.attachAsset('obstacle3', {
anchorX: 0.5,
anchorY: 0.5,
rotation: Math.random() * 2 * Math.PI // Add random rotation
});
self.speed = Math.random() * 3 + 2;
self.size = (Math.random() * 4.5 + 4.0) * 1.2;
self.update = function () {
self.y += self.speed;
if (self.y > 2732) {
self.y = -100;
self.x = Math.random() * 2048;
}
};
});
// Class for the fifth obstacle
//<Assets used in the game will automatically appear here>
//<Write imports for supported plugins here>
// Class for the player's fish
var PlayerFish = Container.expand(function () {
var self = Container.call(this);
var fishGraphics = self.attachAsset('playerFish', {
anchorX: 0.5,
anchorY: 0.5,
rotation: Math.random() * 2 * Math.PI // Add random rotation
});
self.speed = 5;
self.size = 2.0 * 1.2;
self.update = function () {
// Move the player fish automatically to the right
// Removed automatic movement of player fish
};
self.grow = function () {
// Function intentionally left empty to keep player fish size constant
};
});
var RewardFish = Container.expand(function () {
var self = Container.call(this);
var fishGraphics = self.attachAsset('rewardFish', {
anchorX: 0.5,
anchorY: 0.5,
rotation: Math.random() * 2 * Math.PI
});
self.speed = Math.random() * 2 + 1;
self.size = (Math.random() * 0.6 + 0.4) * 1.2;
self.update = function () {
self.y += self.speed;
if (self.y > 2732) {
self.y = -100;
self.x = Math.random() * 2048;
}
};
});
// Class for smaller fish
var SmallFish = Container.expand(function () {
var self = Container.call(this);
var fishGraphics = self.attachAsset('smallFish', {
anchorX: 0.5,
anchorY: 0.5,
rotation: Math.random() * 2 * Math.PI // Add random rotation
});
self.speed = Math.random() * 2 + 1;
self.size = (Math.random() * 0.6 + 0.4) * 1.2;
self.update = function () {
self.y += self.speed;
if (self.y > 2732) {
self.y = -100;
self.x = Math.random() * 2048;
}
};
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x0000ff // Init game with blue background to represent the ocean
});
/****
* Game Code
****/
//<Write imports for supported plugins here>
var oceanBackground = LK.getAsset('oceanBackground', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1366
});
game.addChild(oceanBackground);
// Play background music continuously
LK.playMusic('games');
var lives = 4;
// Create heart shapes to represent lives
var heartShapes = [];
for (var i = 0; i < lives; i++) {
var heart = LK.getAsset('heartShape', {
anchorX: 0.5,
anchorY: 0.5,
x: 50 + i * 110,
// Position hearts with some spacing
y: 50
});
LK.gui.topLeft.addChild(heart);
heartShapes.push(heart);
}
// Function to update the life display
function updateLifeDisplay(lives) {
for (var i = 0; i < 4; i++) {
heartShapes[i].visible = i < lives; // Show or hide hearts based on remaining lives
}
}
// Create a score text object
var scoreText = new Text2('Score: 0', {
size: 100,
fill: 0xFFFFFF
});
// Set the anchor point to the top-right corner
scoreText.anchor.set(1, 0);
// Position the score text at the top-right corner of the screen
LK.gui.topRight.addChild(scoreText);
// Function to update the score display
function updateScoreDisplay(score) {
scoreText.setText('Score: ' + score);
}
// Initialize score
var score = 0;
// Example of updating the score
function increaseScore(amount) {
score += amount;
updateScoreDisplay(score);
}
var playerFish = game.addChild(new PlayerFish());
playerFish.x = 1024;
playerFish.y = 1366;
var enemyFishes = [];
for (var i = 0; i < 5; i++) {
var enemyFish = new EnemyFish();
enemyFish.x = Math.random() * 2048;
enemyFish.y = Math.random() * 2732;
enemyFishes.push(enemyFish);
game.addChild(enemyFish);
}
var smallFishes = [];
LK.setInterval(function () {
var smallFish = new SmallFish();
smallFish.x = Math.random() * 2048;
smallFish.y = -100; // Start above the screen
smallFishes.push(smallFish);
game.addChild(smallFish);
}, 3000); // Spawn a new small fish every 3 seconds
game.move = function (x, y, obj) {
playerFish.x = x;
playerFish.y = y;
};
var obstacles = [];
for (var i = 0; i < 3; i++) {
var obstacle = new Obstacle1();
obstacle.x = Math.random() * 2048;
obstacle.y = Math.random() * 2732;
obstacles.push(obstacle);
game.addChild(obstacle);
}
for (var i = 0; i < 3; i++) {
var obstacle = new Obstacle2();
obstacle.x = Math.random() * 2048;
obstacle.y = Math.random() * 2732;
obstacles.push(obstacle);
game.addChild(obstacle);
}
for (var i = 0; i < 3; i++) {
var obstacle = new Obstacle3();
obstacle.x = Math.random() * 2048;
obstacle.y = Math.random() * 2732;
obstacles.push(obstacle);
game.addChild(obstacle);
}
var rewardFishes = [];
LK.setInterval(function () {
var rewardFish = new RewardFish();
rewardFish.x = Math.random() * 2048;
rewardFish.y = -100; // Start above the screen
rewardFishes.push(rewardFish);
game.addChild(rewardFish);
}, 2000); // Spawn a new reward fish every 2 seconds
var invincible = true;
LK.setTimeout(function () {
invincible = false;
}, 3000);
game.update = function () {
// Removed obstacle speed increase when score reaches 90
for (var i = 0; i < rewardFishes.length; i++) {
rewardFishes[i].update();
if (playerFish.intersects(rewardFishes[i])) {
rewardFishes[i].destroy();
rewardFishes.splice(i, 1);
i--;
increaseScore(2); // Increase score by 2 when intersecting reward fish
LK.getSound('collect').play(); // Play sound effect when collecting reward fish
}
}
for (var i = 0; i < enemyFishes.length; i++) {
enemyFishes[i].update();
if (playerFish.intersects(enemyFishes[i]) && !invincible) {
LK.getSound('obstacle').play(); // Play sound effect when colliding with a large enemy fish
lives--;
updateLifeDisplay(lives);
if (lives <= 0) {
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
console.log("Game Over! Your Score: " + score);
} else {
// Make player fish temporarily invincible after losing a life
invincible = true;
LK.setTimeout(function () {
invincible = false;
}, 1000); // 1 second of invincibility
}
}
}
for (var i = 0; i < smallFishes.length; i++) {
smallFishes[i].update();
if (playerFish.intersects(smallFishes[i])) {
playerFish.grow();
smallFishes[i].destroy();
smallFishes.splice(i, 1);
i--;
increaseScore(1); // Increase score by 1 when intersecting small fish
LK.getSound('collect').play(); // Play sound effect when collecting small fish
}
}
for (var i = 0; i < obstacles.length; i++) {
obstacles[i].update();
if (playerFish.intersects(obstacles[i]) && !invincible) {
LK.getSound('obstacle').play(); // Play sound effect when colliding with an obstacle
lives--;
updateLifeDisplay(lives);
if (lives <= 0) {
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
} else {
// Make player fish temporarily invincible after losing a life
invincible = true;
LK.setTimeout(function () {
invincible = false;
}, 1000); // 1 second of invincibility
}
}
}
}; ===================================================================
--- original.js
+++ change.js
@@ -144,9 +144,10 @@
x: 1024,
y: 1366
});
game.addChild(oceanBackground);
-// Initialize lives
+// Play background music continuously
+LK.playMusic('games');
var lives = 4;
// Create heart shapes to represent lives
var heartShapes = [];
for (var i = 0; i < lives; i++) {
korkuç köpekbalığ 2d Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
korkunç denizanası. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
sevimli solucan. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
kalp. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
okyanus içi. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
kötü balık. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
daha gösterişli altın para
kötü yengeç. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
güzel ve sevimli bir kırmızı balık. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows