User prompt
Bullet her zaman en alt orta noktadan çıksın
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'y')' in or related to this line: 'self.rotation = Math.atan2(game.mouse.y - self.y, game.mouse.x - self.x);' Line Number: 48
User prompt
Bullet in ilerleme yönü şöyle olsun: Bulletin ilerleme başlangıç noktası her zaman ekranın orta noktası olsun ve farenin yatay eksende gösterdiği yer bulletin ilerleyeceği doğrultu olsun
User prompt
Bunu yapabilirsin
User prompt
Bullet fakenin gösterdiği yöne doğru ilerleyebilsin
User prompt
Bullet balıklara değince puan artsın ve saplanma sesi çıksın
User prompt
Bulletin yönünü tam tersine çevir
User prompt
Bulletin ucu yukarı yöne doğru olsun
User prompt
Biraz daha küçült
User prompt
Bulleti küçült
User prompt
Bulllet her zaman mouse nin baktığı tarafa soğru girsin
User prompt
Bullet balığı vurduğunda saplanma sesi çıksın
User prompt
Score yazısı midye kabuğu görünümünde olsun
User prompt
Hava kabarcıklarının sayısını çok çok azalt
User prompt
Bullleti büyüt
User prompt
Bulleti görünür hale getir
User prompt
Hava karcıkları belirli yükseklikte kaybolsun
User prompt
Hava kabarcıkları şeffaf olsun
User prompt
Biraz daha azalt
User prompt
Hava kabarcıklarının sayısını daha da azalt
User prompt
Hava kabarcıklarının sayısını azalt
User prompt
Hava kabarcıkları olsun
User prompt
Balıklar hep aynı boyutta olsun
User prompt
Bullet büyümedi hala
User prompt
Bulleti büyüt
/****
* Classes
****/
// Bullet class to represent the bullets shot by the player
var Bullet = Container.expand(function () {
var self = Container.call(this);
self.speed = 10; // Default speed
// Attach bullet asset
var bulletGraphics = self.attachAsset('bullet', {
anchorX: 0.5,
anchorY: 0.5
});
bulletGraphics.scale.set(8, 8); // Increase the size of the bullet
// Update function to move bullet
self.update = function () {
self.y -= self.speed;
if (self.y < 0) {
self.destroy(); // Destroy the bullet if it goes off screen
}
};
});
//<Assets used in the game will automatically appear here>
//<Write imports for supported plugins here>
// Fish class to represent different types of fish
var Fish = Container.expand(function () {
var self = Container.call(this);
self.size = 1; // Default size multiplier
self.points = 1; // Default points
self.speed = 2; // Default speed
// Attach fish asset
var fishGraphics = self.attachAsset('fish', {
anchorX: 0.5,
anchorY: 0.5
});
// Update function to move fish
self.update = function () {
self.x += self.speed;
// Reset position if fish goes off screen
if (self.speed > 0 && self.x > 2048) {
self.x = -fishGraphics.width;
fishGraphics.scale.x = 1; // Reset the scale for right moving fish
} else if (self.speed < 0 && self.x < -fishGraphics.width) {
self.x = 2048;
fishGraphics.scale.x = -1; // Flip the scale for left moving fish
}
};
// Method to set fish properties based on level
self.setProperties = function (level) {
self.size = 1 + level; // Increase size with level
self.points = level * 100; // Increase points with level
self.speed = 2 + level * 0.5; // Increase speed with level
fishGraphics.scale.set(self.size, self.size);
// Randomly assign some fish to move to the left
if (Math.random() > 0.5) {
self.speed = -self.speed;
}
};
// Method to shoot a bullet
self.shoot = function () {
var bullet = new Bullet();
bullet.x = self.x;
bullet.y = self.y;
game.addChild(bullet);
};
});
// Spear class to represent the spear shot by the player
var Spear = Container.expand(function () {
var self = Container.call(this);
self.speed = 10; // Default speed
// Attach spear asset
var spearGraphics = self.attachAsset('spear', {
anchorX: 0.5,
anchorY: 1.0
});
// Update function to move spear
self.update = function () {
self.y -= self.speed;
if (self.y < 0) {
self.destroy(); // Destroy the spear if it goes off screen
}
};
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x0000FF // Change background color to blue to simulate water
});
/****
* Game Code
****/
// Load the background image
var background = game.attachAsset('background', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2,
y: 2732 / 2
});
background.scale.set(1, 1); // Scale the image to cover the entire screen
// Initialize variables
var level = 1;
var score = 0;
var fishArray = [];
var scoreTxt = new Text2('Score: 0', {
size: 100,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Function to start a new level
function startLevel() {
// Clear existing fish
fishArray.forEach(function (fish) {
return fish.destroy();
});
fishArray = [];
// Create new fish for the level
for (var i = 0; i < level + 2; i++) {
var fish = new Fish();
fish.setProperties(level);
fish.x = Math.random() * 2048;
fish.y = Math.random() * 1000 + 500; // Position fish in the middle of the screen
fishArray.push(fish);
game.addChild(fish);
}
}
// Function to handle fish click
function handleFishClick(fish) {
score += fish.points;
scoreTxt.setText('Score: ' + score);
fish.destroy();
fishArray.splice(fishArray.indexOf(fish), 1);
// Check if all fish are caught
if (fishArray.length === 0) {
level++;
startLevel();
}
}
// Add event listeners for fish
fishArray.forEach(function (fish) {
fish.down = function (x, y, obj) {
handleFishClick(fish);
fish.shoot();
};
});
// Game update function
game.update = function () {
fishArray.forEach(function (fish) {
return fish.update();
});
game.children.forEach(function (child) {
if (child instanceof Spear) {
child.update();
// Check for collision with fish
fishArray.forEach(function (fish) {
if (child.intersects(fish)) {
handleFishClick(fish);
child.destroy();
}
});
}
});
};
// Start the first level
startLevel();
// Mouse or touch down on the game
game.down = function (x, y, obj) {
var spear = new Spear();
spear.x = 2048 / 2;
spear.y = 2732; // Start from the bottom of the screen
spear.rotation = Math.atan2(y - spear.y, x - spear.x);
game.addChild(spear);
};
// Play background music
LK.playMusic('bgmusic', {
loop: true
});
Red pot fish. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
spear. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
palyaço balığı. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
japon balığı. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Guppy fish. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
undersea olants rocks etc but no fish. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.