User prompt
kalkan efekti daha belirgin olsun
User prompt
kalkan efektine elektirik sesi ekle
User prompt
kusma efektinin mesafesini biraz arttır
User prompt
kalkanka elektirik efekti ekle
User prompt
zombilerin kusma saldırısına kusma efekti ekle
User prompt
osurma animasyonunu tekrardan 2d yap
User prompt
Please fix the bug: 'Uncaught TypeError: tween.create is not a function' in or related to this line: 'tween.create(fartAnim).to({' Line Number: 309 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'poop')' in or related to this line: 'if (attackTxt && player && typeof player.attackType !== "undefined" && typeof attackNames[player.attackType] !== "undefined") {' Line Number: 353
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'poop')' in or related to this line: 'if (attackTxt && player && typeof player.attackType !== "undefined" && attackNames[player.attackType]) {' Line Number: 353
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'poop')' in or related to this line: 'if (attackTxt && player && player.attackType && attackNames[player.attackType]) {' Line Number: 353
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'poop')' in or related to this line: 'attackTxt.setText(attackNames[player.attackType]);' Line Number: 354
User prompt
cod live sürümüne geri dönsün
User prompt
karakter seçme ve zombi seçme çalışmıyor fixlermisin
User prompt
ilk başta karakter ve zombi seçme ekranı gelmeli sadece
User prompt
2 ana karakatre asset
User prompt
Oso ve Zombi 2 ye asset eklemem lazım
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of null (reading 'x')' in or related to this line: 'if (!(Math.abs(x - player.x) < 120 && Math.abs(y - player.y) < 120)) {' Line Number: 585
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of null (reading 'x')' in or related to this line: 'if (!(Math.abs(x - player.x) < 120 && Math.abs(y - player.y) < 120)) {' Line Number: 585
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot set properties of null (setting 'x')' in or related to this line: 'player.x = px;' Line Number: 577
User prompt
Please fix the bug: 'TypeError: Cannot read properties of null (reading 'shieldActive')' in or related to this line: 'if (player.shieldActive) {' Line Number: 614
User prompt
Please fix the bug: 'TypeError: Cannot read properties of null (reading 'canAttack')' in or related to this line: 'if (player && !player.canAttack) {' Line Number: 607
User prompt
Please fix the bug: 'TypeError: Cannot read properties of null (reading 'canAttack')' in or related to this line: 'if (!player.canAttack) {' Line Number: 607
User prompt
Please fix the bug: 'Cannot read properties of null (reading 'setText')' in or related to this line: 'attackTxt.setText(attackNames[player.attackType]);' Line Number: 783
User prompt
Please fix the bug: 'Cannot read properties of null (reading 'setText')' in or related to this line: 'attackTxt.setText(attackNames[player.attackType]);' Line Number: 779
User prompt
Please fix the bug: 'Cannot read properties of null (reading 'setText')' in or related to this line: 'attackTxt.setText(attackNames[player.attackType]);' Line Number: 777
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Fart = Container.expand(function () { var self = Container.call(this); var gfx = self.attachAsset('fart', { anchorX: 0.5, anchorY: 0.5 }); self.speed = -10; self.update = function () { self.y += self.speed; }; return self; }); // Oyuncu karakteri var Player = Container.expand(function () { var self = Container.call(this); var playerGfx = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); self.radius = playerGfx.width / 2; self.cooldown = 0; // Atış bekleme süresi self.canAttack = true; self.lives = 3; self.attackType = 'poop'; // Başlangıç saldırısı self.unlockedAttacks = { poop: true, vomit: false, fart: false, snot: false }; // Saldırı tipini güncelle self.updateAttackType = function (score) { if (score >= 450 && !self.unlockedAttacks.snot) { self.unlockedAttacks.snot = true; LK.getSound('unlock').play(); } if (score >= 300 && !self.unlockedAttacks.fart) { self.unlockedAttacks.fart = true; LK.getSound('unlock').play(); } if (score >= 150 && !self.unlockedAttacks.vomit) { self.unlockedAttacks.vomit = true; LK.getSound('unlock').play(); } // Saldırı tipi otomatik değişmesin, oyuncu seçsin (ileride eklenebilir) }; return self; }); // Oyuncu saldırıları var Poop = Container.expand(function () { var self = Container.call(this); var gfx = self.attachAsset('poop', { anchorX: 0.5, anchorY: 0.5 }); self.speed = -22; self.update = function () { self.y += self.speed; }; return self; }); // Kalkan powerup sınıfı var ShieldPowerup = Container.expand(function () { var self = Container.call(this); var gfx = self.attachAsset('centerCircle', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.2, scaleY: 1.2, alpha: 0.7 }); self.speed = 8; self.update = function () { self.y += self.speed; }; return self; }); // Kalkan powerup üretici var Snot = Container.expand(function () { var self = Container.call(this); var gfx = self.attachAsset('snot', { anchorX: 0.5, anchorY: 0.5 }); self.speed = -30; self.update = function () { self.y += self.speed; }; return self; }); var Vomit = Container.expand(function () { var self = Container.call(this); var gfx = self.attachAsset('vomit', { anchorX: 0.5, anchorY: 0.5 }); self.speed = -16; self.update = function () { self.y += self.speed; }; return self; }); // Zombi var Zombie = Container.expand(function () { var self = Container.call(this); var zombieGfx = self.attachAsset('zombie', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 2 + Math.random() * 1.5; // Rastgele yavaş hız self.vomitCooldown = 90 + Math.floor(Math.random() * 120); // 1.5-3.5 sn arası kusma self.vomitTimer = 0; self.isDead = false; self.update = function () { self.y += self.speed; self.vomitTimer++; }; return self; }); // Zombinin kusmuğu var ZombieVomit = Container.expand(function () { var self = Container.call(this); var gfx = self.attachAsset('zombieVomit', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 6; self.update = function () { self.y += self.speed; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x222222 }); /**** * Game Code ****/ // Müzik başlat // Zombi, karakter ve saldırı tipleri için temel şekiller tanımlanıyor LK.playMusic('bgmusic'); // Arka plan banyo resmi ekle var bgBathroom = LK.getAsset('bathroomBg', { anchorX: 0, anchorY: 0, x: 0, y: 0, width: 2048, height: 2732 }); game.addChild(bgBathroom); // Oyun alanı boyutları var GAME_W = 2048; var GAME_H = 2732; // Skor ve can göstergeleri var scoreTxt = new Text2('0', { size: 110, fill: "#fff" }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); var livesTxt = new Text2('❤❤❤', { size: 90, fill: 0xFF4444 }); livesTxt.anchor.set(1, 0); LK.gui.topRight.addChild(livesTxt); // Saldırı tipi göstergesi var attackTxt = new Text2('Kaka', { size: 80, fill: 0xFFE066 }); attackTxt.anchor.set(0, 0); LK.gui.topLeft.addChild(attackTxt); // Oyuncu karakteri var player = new Player(); player.x = GAME_W / 2; player.y = GAME_H - 350; game.addChild(player); // Kalkan görseli (ilk başta görünür, 0-150 puan arası) var shieldAsset = LK.getAsset('centerCircle', { anchorX: 0.5, anchorY: 0.5, scaleX: 2.2, scaleY: 2.2, alpha: 0.45, x: 0, y: 0 }); player.addChild(shieldAsset); player.shieldActive = true; shieldAsset.visible = true; // Zombiler ve saldırılar için diziler var zombies = []; var playerAttacks = []; var zombieAttacks = []; // Kalkan powerup dizisi var shieldPowerups = []; // Sürükleme için var dragNode = null; // Kalkan powerup üretici function spawnShieldPowerup() { var p = new ShieldPowerup(); p.x = 180 + Math.random() * (GAME_W - 360); p.y = -80; shieldPowerups.push(p); game.addChild(p); } // Her 10 saniyede bir kalkan powerup üret LK.setInterval(function () { spawnShieldPowerup(); }, 10000); // Saldırı tipleri ve isimleri var attackTypes = ['poop', 'vomit', 'fart', 'snot']; var attackNames = { poop: 'Kaka', vomit: 'Kusmuk', fart: 'Osuruk', snot: 'Sümük' }; // Saldırı tipi göstergesi sadece bilgi amaçlı, tıklama ile değişmez LK.gui.topLeft.addChild(attackTxt); // Zombi oluşturucu function spawnZombie() { var z = new Zombie(); z.x = 180 + Math.random() * (GAME_W - 360); z.y = -100; zombies.push(z); game.addChild(z); } // Zombi saldırısı oluşturucu function spawnZombieVomit(zombie) { var zv = new ZombieVomit(); zv.x = zombie.x; zv.y = zombie.y + 80; zombieAttacks.push(zv); game.addChild(zv); LK.getSound('zombieVomit').play(); // Kusma efekti (2D animasyon) var vomitEffect = LK.getAsset('vomit', { anchorX: 0.5, anchorY: 0.5, x: zombie.x, y: zombie.y + 80, alpha: 0.7, scaleX: 1.1 + Math.random() * 0.5, scaleY: 0.7 + Math.random() * 0.4, tint: 0x99ff66 }); game.addChild(vomitEffect); tween(vomitEffect, { alpha: 0, scaleX: vomitEffect.scaleX * 2.2, scaleY: vomitEffect.scaleY * 1.7, y: vomitEffect.y + 180 }, { duration: 420, onFinish: function onFinish() { vomitEffect.destroy(); } }); } // Saldırı oluşturucu function spawnPlayerAttack() { var atk; var score = LK.getScore(); if (score < 150) { atk = new Poop(); player.attackType = 'poop'; } else if (score < 300) { atk = new Vomit(); player.attackType = 'vomit'; } else if (score < 400) { atk = new Fart(); player.attackType = 'fart'; } else { atk = new Snot(); player.attackType = 'snot'; } atk.x = player.x; atk.y = player.y - 90; playerAttacks.push(atk); game.addChild(atk); // Fart animation effect (2D shape) if (player.attackType === 'fart') { var fartAnim = LK.getAsset('centerCircle', { anchorX: 0.5, anchorY: 0.5, x: player.x, y: player.y - 60, alpha: 0.5, scaleX: 1.1 + Math.random() * 0.4, scaleY: 0.7 + Math.random() * 0.3, tint: 0xcccc66 }); game.addChild(fartAnim); tween(fartAnim, { alpha: 0, scaleX: fartAnim.scaleX * 2.2, scaleY: fartAnim.scaleY * 1.7, y: fartAnim.y - 80 }, { duration: 420, onFinish: function onFinish() { fartAnim.destroy(); } }); } // Play sound based on attack type if (player.attackType === 'poop') { LK.getSound('attackPoop').play(); } else if (player.attackType === 'vomit') { LK.getSound('attackVomit').play(); } else if (player.attackType === 'fart') { LK.getSound('attackFart').play(); } else if (player.attackType === 'snot') { LK.getSound('attackSnot').play(); } attackTxt.setText(attackNames[player.attackType]); } // Saldırı tipi güncelleme function updateAttackUnlocks() { var score = LK.getScore(); player.updateAttackType(score); attackTxt.setText(attackNames[player.attackType]); } // Can güncelle function updateLives() { var s = ''; for (var i = 0; i < player.lives; i++) s += '❤'; livesTxt.setText(s); } // Sürükleme ve hareket function handleMove(x, y, obj) { // Sadece yatay (X) eksende hareket etsin, Y sabit kalsın var px = Math.max(120, Math.min(GAME_W - 120, x)); player.x = px; // Y ekseni sabit, başlangıç konumunda kalacak } game.move = handleMove; // Ekrana dokununca saldırı (karaktere dokunulmazsa) game.down = function (x, y, obj) { if (!(Math.abs(x - player.x) < 120 && Math.abs(y - player.y) < 120)) { // Saldırı if (player.canAttack) { spawnPlayerAttack(); player.canAttack = false; // Saldırı bekleme süresi saldırı tipine göre değişir var cd = 18; if (player.attackType === 'vomit') cd = 28; if (player.attackType === 'fart') cd = 36; if (player.attackType === 'snot') cd = 50; player.cooldown = cd; } } }; game.up = function (x, y, obj) {}; // Oyun döngüsü game.update = function () { // Saldırı bekleme if (!player.canAttack) { player.cooldown--; if (player.cooldown <= 0) { player.canAttack = true; } } // Kalkan aktifliği güncelle (sadece bir kez alınan hasarla kaybolur) if (player.shieldActive) { if (player.children.indexOf(shieldAsset) === -1) player.addChild(shieldAsset); shieldAsset.visible = true; } else { shieldAsset.visible = false; if (player.children.indexOf(shieldAsset) !== -1) player.removeChild(shieldAsset); } // Zombiler for (var i = zombies.length - 1; i >= 0; i--) { var z = zombies[i]; z.update(); // Zombi ekrandan çıktıysa if (z.y > GAME_H + 100) { z.destroy(); zombies.splice(i, 1); continue; } // Zombi oyuncuya çarptı mı? if (!z.isDead && z.intersects(player)) { z.isDead = true; z.destroy(); zombies.splice(i, 1); if (player.shieldActive) { // Kalkan varsa hasar alma, kalkanı kısa süreliğine parlat LK.effects.flashObject(shieldAsset, 0x00ffff, 400); // Kalkan saldırı alınca kaybolacak player.shieldActive = false; shieldAsset.visible = false; if (player.children.indexOf(shieldAsset) !== -1) player.removeChild(shieldAsset); } else { player.lives--; updateLives(); LK.effects.flashObject(player, 0xff0000, 600); if (player.lives <= 0) { LK.effects.flashScreen(0xff0000, 1200); LK.showGameOver(); return; } } continue; } // Zombi kusacak mı? if (z.vomitTimer >= z.vomitCooldown) { spawnZombieVomit(z); z.vomitTimer = 0; z.vomitCooldown = 90 + Math.floor(Math.random() * 120); } } // Oyuncu saldırıları for (var i = playerAttacks.length - 1; i >= 0; i--) { var atk = playerAttacks[i]; atk.update(); // Ekrandan çıktıysa if (atk.y < -100) { atk.destroy(); playerAttacks.splice(i, 1); continue; } // Zombiye çarptı mı? for (var j = zombies.length - 1; j >= 0; j--) { var z = zombies[j]; if (!z.isDead && atk.intersects(z)) { z.isDead = true; LK.getSound('attack').play(); z.destroy(); zombies.splice(j, 1); atk.destroy(); playerAttacks.splice(i, 1); // Skor var prevScore = LK.getScore(); LK.setScore(prevScore + 10); scoreTxt.setText(LK.getScore()); updateAttackUnlocks(); // Ekstra can: Her 150 puanda bir ekstra can kazan var newScore = LK.getScore(); if (Math.floor(prevScore / 150) < Math.floor(newScore / 150)) { player.lives++; updateLives(); LK.getSound('unlock').play(); } // Kazanma yok, amaç hayatta kalmak break; } } } // Zombi saldırıları for (var i = zombieAttacks.length - 1; i >= 0; i--) { var zv = zombieAttacks[i]; zv.update(); // Ekrandan çıktıysa if (zv.y > GAME_H + 100) { zv.destroy(); zombieAttacks.splice(i, 1); continue; } // Oyuncuya çarptı mı? if (zv.intersects(player)) { zv.destroy(); zombieAttacks.splice(i, 1); if (player.shieldActive) { // Kalkan varsa hasar alma, kalkanı kısa süreliğine parlat LK.effects.flashObject(shieldAsset, 0x00ffff, 400); // Kalkan saldırı alınca kaybolacak player.shieldActive = false; shieldAsset.visible = false; if (player.children.indexOf(shieldAsset) !== -1) player.removeChild(shieldAsset); } else { player.lives--; updateLives(); LK.effects.flashObject(player, 0x00ff00, 600); if (player.lives <= 0) { LK.effects.flashScreen(0xff0000, 1200); LK.showGameOver(); return; } } continue; } } // Zombi üretimi (her 60-90 tickte bir) if (LK.ticks % (60 + Math.floor(Math.random() * 30)) === 0) { if (zombies.length < 7) spawnZombie(); } // Kalkan powerup hareket ve toplama for (var i = shieldPowerups.length - 1; i >= 0; i--) { var p = shieldPowerups[i]; p.update(); // Ekrandan çıktıysa if (p.y > GAME_H + 100) { p.destroy(); shieldPowerups.splice(i, 1); continue; } // Oyuncuya çarptı mı? if (p.intersects(player)) { p.destroy(); shieldPowerups.splice(i, 1); // Kalkanı aktif et player.shieldActive = true; if (player.children.indexOf(shieldAsset) === -1) player.addChild(shieldAsset); shieldAsset.visible = true; LK.getSound('unlock').play(); // Kısa bir parlama efekti LK.effects.flashObject(shieldAsset, 0x00ffff, 400); continue; } } }; // Oyun başında ilk zombi spawnZombie(); updateLives(); updateAttackUnlocks(); scoreTxt.setText(LK.getScore()); attackTxt.setText(attackNames[player.attackType]);
===================================================================
--- original.js
+++ change.js
@@ -148,10 +148,10 @@
/****
* Game Code
****/
-// Zombi, karakter ve saldırı tipleri için temel şekiller tanımlanıyor
// Müzik başlat
+// Zombi, karakter ve saldırı tipleri için temel şekiller tanımlanıyor
LK.playMusic('bgmusic');
// Arka plan banyo resmi ekle
var bgBathroom = LK.getAsset('bathroomBg', {
anchorX: 0,
@@ -248,8 +248,31 @@
zv.y = zombie.y + 80;
zombieAttacks.push(zv);
game.addChild(zv);
LK.getSound('zombieVomit').play();
+ // Kusma efekti (2D animasyon)
+ var vomitEffect = LK.getAsset('vomit', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: zombie.x,
+ y: zombie.y + 80,
+ alpha: 0.7,
+ scaleX: 1.1 + Math.random() * 0.5,
+ scaleY: 0.7 + Math.random() * 0.4,
+ tint: 0x99ff66
+ });
+ game.addChild(vomitEffect);
+ tween(vomitEffect, {
+ alpha: 0,
+ scaleX: vomitEffect.scaleX * 2.2,
+ scaleY: vomitEffect.scaleY * 1.7,
+ y: vomitEffect.y + 180
+ }, {
+ duration: 420,
+ onFinish: function onFinish() {
+ vomitEffect.destroy();
+ }
+ });
}
// Saldırı oluşturucu
function spawnPlayerAttack() {
var atk;
poop. In-Game asset. 2d. High contrast. No shadows
vomit. In-Game asset. 2d. High contrast. No shadows
bathrom. In-Game asset. 2d. High contrast. No shadows
fart animation. In-Game asset. 2d. High contrast. No shadows
yuvarlak mavi elektirikli kalkan. In-Game asset. 2d. High contrast. No shadows
snot. In-Game asset. 2d. High contrast. No shadows
transparent