User prompt
gemi yaratığını daha daha çok büyült
User prompt
gemi yaratığını daha çok büyült
User prompt
gem, yaratığını daha çok büyült
User prompt
gemi yaratığını biraz büyült
User prompt
eğer uranyum karakterimize değerse karakterimiz ölsün
User prompt
daha hızlı hareket etsin
User prompt
daha hızlı hareket etsin uranyum
User prompt
daha hızlı hareket etsin uranyum yaratığı
User prompt
uranyum yaratığı spawn olduktan sonra ekranın sağında ise soluna doğru solunda ise sağına doğru hareket etsin
User prompt
uranyum görselini daha da büyült
User prompt
uranyum görselini büyült
User prompt
yumurtadan uranyum çıktıktan sonra o yumurta görseli ekrandan kalksın
User prompt
duran yumurtaların içinden 1 saniye sonra uranyum diye yeni bir yaratık çıksın ve görseli uranyum olsun
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'intersects')' in or related to this line: 'if (game.children[l] instanceof DownwardProjectile && bullets[j].intersects(game.children[l])) {' Line Number: 291
User prompt
duran yumurtalar karakterin attığı mermi değerse yok olsun
User prompt
yumurtalar 4 saniye sonra dursun
User prompt
yumurtalar 2 sn sonra dursun
User prompt
normal enemylerin izlediği yatay konuma gelen yumurta dursun
User prompt
topenemy konumunda durmasın yumurta
User prompt
topenemy değil normal enemylerin konumu
User prompt
enemy spawn olduğu noktaya gelince yumurtalar o konumda ekranda dursun
User prompt
karakter hizasında fırlatmasın
User prompt
her 1 gemi düşmanı en fazla 1 tane fırlatabilsin
User prompt
daha da azalt
User prompt
spawn zamanını azalt fırlattığı şeyin
/**** * Classes ****/ var Bullet = Container.expand(function () { var self = Container.call(this); var bulletGraphics = self.attachAsset(self.speedX < 0 ? 'dart2' : 'dart', { anchorX: 0.5, anchorY: 0.5 }); self.speedX = 10; self.update = function () { self.x += self.speedX; if (self.x > 2048) { self.destroy(); } }; }); var DownwardProjectile = Container.expand(function () { var self = Container.call(this); var projectileGraphics = self.attachAsset('yumurta', { anchorX: 0.5, anchorY: 0.5 }); self.speedY = 5; self.update = function () { self.y += self.speedY; if (self.lastY === undefined) { self.lastY = self.y; } // Initialize lastY if (self.startTime === undefined) { self.startTime = Date.now(); } // Initialize startTime if (Date.now() - self.startTime >= 4000) { // Check if 4 seconds have passed self.speedY = 0; // Stop the projectile if (!self.spawnedUranium && Date.now() - self.startTime >= 5000) { // Check if 1 second has passed since stopping var uranium = new UraniumCreature(); uranium.x = self.x; uranium.y = self.y; game.addChild(uranium); self.spawnedUranium = true; self.destroy(); // Remove the DownwardProjectile from the screen } } for (var i = 0; i < enemies.length; i++) { if (self.lastX <= enemies[i].x && self.x > enemies[i].x) { self.speedY = 0; // Stop the projectile break; } } if (self.y > 2732) { self.destroy(); } self.lastY = self.y; // Update lastY }; }); // Define a class for enemies that move from right to left var Enemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.attachAsset('enemy', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.2, scaleY: 1.2 }); self.speedX = 5; self.update = function () { self.x -= self.speedX; if (self.x < 0) { self.destroy(); } }; }); // Define a class for jumping creatures var JumpingCreature = Container.expand(function () { var self = Container.call(this); var creatureGraphics = self.attachAsset('Yesil', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.jumpHeight = 40; self.isJumping = false; self.velocityY = 0; self.update = function () { // Jumping creature stays at the same position }; self.jump = function () { // Jumping creature doesn't jump }; }); var LeftBullet = Container.expand(function () { var self = Container.call(this); var bulletGraphics = self.attachAsset('dart2', { anchorX: 0.5, anchorY: 0.5 }); self.speedX = -10; self.update = function () { self.x += self.speedX; if (self.x < 0) { self.destroy(); } }; }); // Define a class for enemies that move from left to right var LeftToRightEnemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.attachAsset('enemy', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.2, scaleY: 1.2 }); self.speedX = 5; self.update = function () { self.x += self.speedX; if (self.x > 2048) { self.destroy(); } }; }); //<Assets used in the game will automatically appear here> // Define a class for the player character var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.5, scaleY: 1.5 }); self.speed = 5; self.jumpHeight = 40; self.isJumping = false; self.velocityY = 0; self.update = function () { if (self.isJumping) { self.y += self.velocityY; self.velocityY += self.speed / 8; // Decrease gravity by reducing the speed of the player's fall even more if (self.y > 2732 - self.height / 2 - 300) { self.y = 2732 - self.height / 2 - 300; self.isJumping = false; } } }; self.jump = function () { if (!self.isJumping) { self.isJumping = true; self.velocityY = -self.jumpHeight; } }; }); // Define a class for enemies that move from right to left at the top of the screen var TopEnemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.attachAsset('gemi', { anchorX: 0.5, anchorY: 0.5, scaleX: 2.0, scaleY: 2.0 }); self.speedX = 5; self.update = function () { self.x -= self.speedX; if (self.x < 0) { self.destroy(); } // Launch a downward projectile if none exists if (!self.hasProjectile) { if (Math.random() < 0.005) { var projectile = new DownwardProjectile(); projectile.x = self.x; projectile.y = self.y; game.addChild(projectile); self.hasProjectile = true; projectile.on('destroy', function () { self.hasProjectile = false; }); } } }; }); var UraniumCreature = Container.expand(function () { var self = Container.call(this); var uraniumGraphics = self.attachAsset('uranyum', { anchorX: 0.5, anchorY: 0.5, scaleX: 2.0, scaleY: 2.0 }); self.update = function () { // Determine direction based on initial position if (self.initialDirection === undefined) { self.initialDirection = self.x > 1024 ? -1 : 1; // Move left if on the right side, right if on the left } // Move the Uranium creature self.x += self.initialDirection * 15; // Move at a speed of 15 units per update // Destroy if it moves out of bounds if (self.x < 0 || self.x > 2048) { self.destroy(); } }; }); /**** * Initialize Game ****/ // Define a class for the level system var game = new LK.Game({ backgroundColor: 0x87CEEB // Sky blue background }); /**** * Game Code ****/ var bullets = []; var background = game.addChild(LK.getAsset('background', { anchorX: 0, anchorY: 0 })); background.x = 0; background.y = 0; // Initialize player var player = game.addChild(new Player()); player.x = 2048 / 2; // Position player at the center of the screen horizontally player.y = 2732 - player.height / 2 - 300; // Move player character slightly higher // Initialize enemies var enemies = []; var enemySpawnInterval = 30; // 30 ticks for half a second at 60FPS var enemySpawnCounter = 0; // Create a new Text2 object to display the score var scoreText = new Text2('Score: 0', { size: 100, fill: 0xFFFFFF }); // Add the score text to the game GUI at the bottom of the player character game.addChild(scoreText); scoreText.x = player.x; scoreText.y = player.y + player.height + 50; // Handle game updates game.update = function () { player.update(); enemySpawnCounter++; if (enemySpawnCounter >= enemySpawnInterval) { var topEnemy = new TopEnemy(); topEnemy.x = 2048; topEnemy.y = 1000; // Spawn even lower on the screen enemies.push(topEnemy); game.addChild(topEnemy); var enemy; // Create a new enemy if (!player.isJumping) { if (Math.random() < 0.5) { enemy = new Enemy(); enemy.x = 2048; } else { enemy = new LeftToRightEnemy(); enemy.x = 0; } enemy.y = player.y; // Spawn enemy at player's y position } else { enemy = new TopEnemy(); enemy.y = 2732 / 2 - 300; // Spawn enemy a bit lower enemy.x = 2048; } enemies.push(enemy); game.addChild(enemy); // Randomize the spawn interval for the next enemy enemySpawnInterval = Math.floor(Math.random() * 150) + 50; enemySpawnCounter = 0; } // Update enemy movement and check for collision with player for (var i = 0; i < enemies.length; i++) { enemies[i].update(); // Check if player passed an enemy if (enemies[i].lastX >= player.x && enemies[i].x < player.x) { // Increase score by 1 LK.setScore(LK.getScore() + 1); // Update score text scoreText.setText('Score: ' + LK.getScore()); } // Check if player collides with an enemy if (player.intersects(enemies[i])) { // Show game over. The game will be automatically paused while game over is showing. LK.showGameOver(); // Calling this will destroy the 'Game' and reset entire game state. } // Update last known position enemies[i].lastX = enemies[i].x; } // Update bullet movement and check for collision with enemies for (var j = bullets.length - 1; j >= 0; j--) { bullets[j].update(); for (var k = enemies.length - 1; k >= 0; k--) { if (bullets[j].intersects(enemies[k])) { bullets[j].destroy(); bullets.splice(j, 1); enemies[k].destroy(); enemies.splice(k, 1); break; } } for (var l = game.children.length - 1; l >= 0; l--) { if (game.children[l] instanceof DownwardProjectile && bullets[j] && bullets[j].intersects(game.children[l])) { bullets[j].destroy(); bullets.splice(j, 1); game.children[l].destroy(); break; } } } }; // Initialize jumping creature var creature; if (enemies.length > 3 && !creature) { creature = game.addChild(new JumpingCreature()); creature.x = 2048 / 2; creature.y = 2732 / 2; } // Handle player jump game.down = function (x, y, obj) { if (x < player.x) { // Fire bullet to the left var bullet = new LeftBullet(); game.addChild(bullet); bullet.x = player.x - player.width / 2; bullet.y = player.y; bullets.push(bullet); // Rotate player to face left player.scaleX = -1.5; } else if (x > 2048 / 2 - 100 && x < 2048 / 2 + 100) { player.jump(); } else { var bullet = game.addChild(new Bullet()); bullet.x = player.x + player.width / 2; bullet.y = player.y; var directionX = x - bullet.x; var directionY = y - bullet.y; var magnitude = Math.sqrt(directionX * directionX + directionY * directionY); bullet.speedX = directionX / magnitude * 10; bullet.speedY = directionY / magnitude * 10; bullets.push(bullet); // Rotate player to face right player.scaleX = 1.5; } };
===================================================================
--- original.js
+++ change.js
@@ -195,9 +195,9 @@
if (self.initialDirection === undefined) {
self.initialDirection = self.x > 1024 ? -1 : 1; // Move left if on the right side, right if on the left
}
// Move the Uranium creature
- self.x += self.initialDirection * 10; // Move at a speed of 10 units per update
+ self.x += self.initialDirection * 15; // Move at a speed of 15 units per update
// Destroy if it moves out of bounds
if (self.x < 0 || self.x > 2048) {
self.destroy();
}
uçabilen düşmanlar tatlı düşman. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
yeşil tatlı ok atmaya hazırlıklı okçu karakter. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
partıltılı yumurta. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
2d animation background forest with green and blue. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
altın coin üstünde C yazsın. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
pembe mor ve mavi karışımından oluşanının yap