User prompt
her 50 puanda bir yukardan ulti özelliği gelecek
User prompt
ultiyi mousun sağ tuşu ile kullan
User prompt
mouse sağ tuşuna basınca ultiyi fırlat
User prompt
ulti ekranı kaplayan ishal bir bok olacak
User prompt
her 100 puanda bir ulti saldırısı gelecek mouse sağ tusuyla atılabilecek. saldırı ise ishal bok gibi bütün alana saldırı yapacak ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
bossun can barını dahada büyült
User prompt
boss için asset ekle
User prompt
saldırı seçme ekranında seçilen saldırılar oyuna eklediğimiz diğer saldırılardan olacak ve seçiği saldırı ile devame decek
User prompt
saldırı seç ekranındaki saldırılar farklı saldırılar olsun fart poop snot
User prompt
saldırı seç ekranıdna 3 adet saldırı olsun
User prompt
saldırı seçme ekranı geldiginde 3 farklı saldırı olsun ve hangisini seçerse onunla saldırsın
User prompt
saldırı seçme ekranı gelince zombiler dursun
User prompt
Please fix the bug: 'TypeError: LK.pauseGame is not a function' in or related to this line: 'LK.pauseGame();' Line Number: 525
User prompt
Please fix the bug: 'TypeError: LK.pause is not a function' in or related to this line: 'LK.pause();' Line Number: 525
User prompt
Please fix the bug: 'TypeError: LK.pauseGame is not a function' in or related to this line: 'LK.pauseGame();' Line Number: 525
User prompt
3 adet saldırı kusmuk kaka osurma bunlardan birini seçerek saldırıyı değiştirecek ekran gelince oyun duracak seçince saldırı değişecek ve devam edecek
User prompt
her 50 puanda bir saldırı seçme ekranı gelsin
User prompt
boss varken diğer zombiler çok az gelsin
User prompt
boss can barı biraz büyük olsun
User prompt
boss yavaş hareket etsin ve boss un canı olsun
User prompt
boss yavaş saldırı yapacak ve yukarı aşağı ve sağa sola hareket edecek maksimum ekranın yarısına kadar inebilecek
User prompt
boss yavaş saldırı yapacak ve yukarı aşağı ve sağa sola hareket edecek maksimum ekranın yarısına kadar inebilecek
User prompt
bossun saldırı hızı düşük olacak bossun canı 200 olacak ana karakterin salırısı 10 olacak
User prompt
her 200 puanda bir boss gelecek
User prompt
kalkan efektinin alanını küçült
/**** * 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 (daha küçük ve daha az alan kaplayan) var shieldAsset = LK.getAsset('centerCircle', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.5, scaleY: 1.5, alpha: 0.72, x: 0, y: 0, tint: 0x66e0ff }); player.addChild(shieldAsset); // Ekstra: dış glow efekti için ikinci bir halka ekle (küçültüldü) var shieldGlow = LK.getAsset('centerCircle', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.8, scaleY: 1.8, alpha: 0.22, tint: 0x00eaff, x: 0, y: 0 }); shieldAsset.addChild(shieldGlow); 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 + 320 // Mesafe artırıldı }, { duration: 520, 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) { // Kalkan glow animasyonu (pulsing) if (shieldGlow && shieldGlow.visible) { var pulse = 0.18 + 0.06 * Math.sin(LK.ticks / 8); shieldGlow.alpha = 0.18 + pulse; shieldGlow.scaleX = 3.2 + 0.12 * Math.sin(LK.ticks / 10); shieldGlow.scaleY = 3.2 + 0.12 * Math.sin(LK.ticks / 10); } if (player.children.indexOf(shieldAsset) === -1) player.addChild(shieldAsset); shieldAsset.visible = true; if (shieldAsset.children.indexOf(shieldGlow) === -1) shieldAsset.addChild(shieldGlow); shieldGlow.visible = true; // Elektrik efekti ekle if (!shieldAsset.electricEffect || shieldAsset.electricEffect.destroyed) { // Varsa eskiyi sil if (shieldAsset.electricEffect && !shieldAsset.electricEffect.destroyed) { shieldAsset.electricEffect.destroy(); } // Yeni elektrik efekti oluştur var electric = LK.getAsset('centerCircle', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.2 + Math.random() * 0.15, scaleY: 1.2 + Math.random() * 0.15, alpha: 0.22 + Math.random() * 0.13, tint: 0x00eaff }); electric.x = 0; electric.y = 0; shieldAsset.addChild(electric); shieldAsset.electricEffect = electric; // Elektrik sesi çal if (LK.getSound('attackSnot')) { LK.getSound('attackSnot').play(); } // Animasyon: titreşim ve parıltı tween(electric, { alpha: 0.05 + Math.random() * 0.1, scaleX: electric.scaleX * (0.95 + Math.random() * 0.1), scaleY: electric.scaleY * (0.95 + Math.random() * 0.1), rotation: Math.random() * Math.PI * 2 }, { duration: 180 + Math.random() * 120, onFinish: function onFinish() { if (electric && !electric.destroyed) { electric.destroy(); } if (shieldAsset && shieldAsset.visible && player.shieldActive) { shieldAsset.electricEffect = null; } } }); } } else { shieldAsset.visible = false; if (player.children.indexOf(shieldAsset) !== -1) player.removeChild(shieldAsset); if (shieldAsset.children.indexOf(shieldGlow) !== -1) shieldAsset.removeChild(shieldGlow); shieldGlow.visible = false; // Elektrik efekti varsa kaldır if (shieldAsset.electricEffect && !shieldAsset.electricEffect.destroyed) { shieldAsset.electricEffect.destroy(); shieldAsset.electricEffect = null; } } // 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]);
/****
* 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 (daha küçük ve daha az alan kaplayan)
var shieldAsset = LK.getAsset('centerCircle', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1.5,
scaleY: 1.5,
alpha: 0.72,
x: 0,
y: 0,
tint: 0x66e0ff
});
player.addChild(shieldAsset);
// Ekstra: dış glow efekti için ikinci bir halka ekle (küçültüldü)
var shieldGlow = LK.getAsset('centerCircle', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1.8,
scaleY: 1.8,
alpha: 0.22,
tint: 0x00eaff,
x: 0,
y: 0
});
shieldAsset.addChild(shieldGlow);
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 + 320 // Mesafe artırıldı
}, {
duration: 520,
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) {
// Kalkan glow animasyonu (pulsing)
if (shieldGlow && shieldGlow.visible) {
var pulse = 0.18 + 0.06 * Math.sin(LK.ticks / 8);
shieldGlow.alpha = 0.18 + pulse;
shieldGlow.scaleX = 3.2 + 0.12 * Math.sin(LK.ticks / 10);
shieldGlow.scaleY = 3.2 + 0.12 * Math.sin(LK.ticks / 10);
}
if (player.children.indexOf(shieldAsset) === -1) player.addChild(shieldAsset);
shieldAsset.visible = true;
if (shieldAsset.children.indexOf(shieldGlow) === -1) shieldAsset.addChild(shieldGlow);
shieldGlow.visible = true;
// Elektrik efekti ekle
if (!shieldAsset.electricEffect || shieldAsset.electricEffect.destroyed) {
// Varsa eskiyi sil
if (shieldAsset.electricEffect && !shieldAsset.electricEffect.destroyed) {
shieldAsset.electricEffect.destroy();
}
// Yeni elektrik efekti oluştur
var electric = LK.getAsset('centerCircle', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1.2 + Math.random() * 0.15,
scaleY: 1.2 + Math.random() * 0.15,
alpha: 0.22 + Math.random() * 0.13,
tint: 0x00eaff
});
electric.x = 0;
electric.y = 0;
shieldAsset.addChild(electric);
shieldAsset.electricEffect = electric;
// Elektrik sesi çal
if (LK.getSound('attackSnot')) {
LK.getSound('attackSnot').play();
}
// Animasyon: titreşim ve parıltı
tween(electric, {
alpha: 0.05 + Math.random() * 0.1,
scaleX: electric.scaleX * (0.95 + Math.random() * 0.1),
scaleY: electric.scaleY * (0.95 + Math.random() * 0.1),
rotation: Math.random() * Math.PI * 2
}, {
duration: 180 + Math.random() * 120,
onFinish: function onFinish() {
if (electric && !electric.destroyed) {
electric.destroy();
}
if (shieldAsset && shieldAsset.visible && player.shieldActive) {
shieldAsset.electricEffect = null;
}
}
});
}
} else {
shieldAsset.visible = false;
if (player.children.indexOf(shieldAsset) !== -1) player.removeChild(shieldAsset);
if (shieldAsset.children.indexOf(shieldGlow) !== -1) shieldAsset.removeChild(shieldGlow);
shieldGlow.visible = false;
// Elektrik efekti varsa kaldır
if (shieldAsset.electricEffect && !shieldAsset.electricEffect.destroyed) {
shieldAsset.electricEffect.destroy();
shieldAsset.electricEffect = null;
}
}
// 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]);
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