User prompt
Eğer hack mod açıkken 100 puanı geçerse desin ama şöyle desin
User prompt
Eğer hack mode açıksa sen noob sun hack mode açmışsın dalge geçsin
User prompt
Auto battle yerine hack mode olsun
User prompt
Auto battle basınca enerji gitmesin bütün düşmanları vursun
User prompt
100 Arrow tuşunu sil onun yerine bir tus olsun ona basınca on bida basınca off on olunca 3 tane Arrow atalım
User prompt
Arrow ve enemyarrow duvara çarpınca oklar yok olsun
User prompt
Oklar duvara çarpınca yok olsun
User prompt
Bizim okumuz la düşmanın oku deyerse oklar birbirine çarpıp yok olsun
User prompt
O tuşa basıldığında enerji gitmesin
User prompt
Bir tuş olsun 100 ok atma ona basınca 100 ok atsın
User prompt
Arrow la enemyarrow un oku birbirine çarparsa yok olsun
User prompt
Enemy nereye ok atarsa oda oraya baksın
User prompt
Archer nereye ok atarsa oraya baksın
User prompt
Archer nereye ok atarsa oraya baksın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Ben karşıdaki adam bakiyo benim karakterim baksın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Nereye ateş edersek cöp adam oraya baksın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Adamlar gelmesin bı yerde rasgele doğsun ama ölünce başkası doğsun teker teker sonra hızlı canımız olsun 10 ok deyerse ölelim adamlarda bize ok atsın
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'toGlobal')' in or related to this line: 'var gamePos = game.toLocal(obj.parent.toGlobal({' Line Number: 116
User prompt
Ekrana basıyorum ama ok gelmiyor
User prompt
Hata var
User prompt
Assagida tuş oosun ona basınca otomatik savaş olsun
User prompt
Otomatik savaş olsun
User prompt
Ok atarken enerji artmasin durunca artsin
User prompt
Enerji her saniye artsın ve her okta 2 enerji harcasin
User prompt
Enerji olsun enerji 100 olsun her ok firlattiginda azalsın
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Archer = Container.expand(function () { var self = Container.call(this); var archerGraphics = self.attachAsset('archer', { anchorX: 0.5, anchorY: 0.5 }); return self; }); var Arrow = Container.expand(function () { var self = Container.call(this); var arrowGraphics = self.attachAsset('arrow', { anchorX: 0.5, anchorY: 0.5 }); self.speedX = 0; self.speedY = 0; self.update = function () { self.x += self.speedX; self.y += self.speedY; }; return self; }); var Enemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.attachAsset('enemy', { anchorX: 0.5, anchorY: 0.5 }); self.shootTimer = 0; self.shootRate = 120 + Math.random() * 60; // Random shooting interval self.update = function () { // Enemies don't move, they stay in place and shoot self.shootTimer++; if (self.shootTimer >= self.shootRate) { self.shootTimer = 0; // Shoot at player var dirX = archer.x - self.x; var dirY = archer.y - self.y; var distance = Math.sqrt(dirX * dirX + dirY * dirY); var normalX = dirX / distance; var normalY = dirY / distance; // Make enemy face the shooting direction self.rotation = Math.atan2(normalY, normalX); var enemyArrow = new EnemyArrow(); enemyArrow.x = self.x; enemyArrow.y = self.y; enemyArrow.speedX = normalX * 8; enemyArrow.speedY = normalY * 8; enemyArrow.rotation = Math.atan2(normalY, normalX); enemyArrows.push(enemyArrow); game.addChild(enemyArrow); } }; return self; }); var EnemyArrow = Container.expand(function () { var self = Container.call(this); var arrowGraphics = self.attachAsset('enemyArrow', { anchorX: 0.5, anchorY: 0.5 }); self.speedX = 0; self.speedY = 0; self.update = function () { self.x += self.speedX; self.y += self.speedY; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB }); /**** * Game Code ****/ var archer = game.addChild(new Archer()); archer.x = 150; archer.y = 2732 / 2; var arrows = []; var enemies = []; var enemyArrows = []; var enemySpawnTimer = 0; var enemySpawnRate = 120; // frames between spawns var playerHealth = 10; var maxEnemies = 1; // Start with 1 enemy, increase over time var energy = 100; var energyRegenTimer = 0; var isShooting = false; var shootingTimer = 0; var scoreTxt = new Text2('0', { size: 100, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); scoreTxt.setText(LK.getScore()); var energyTxt = new Text2('Energy: 100', { size: 80, fill: 0x00ff00 }); energyTxt.anchor.set(1, 0); LK.gui.topRight.addChild(energyTxt); energyTxt.x = -20; energyTxt.y = 20; var healthTxt = new Text2('Health: 10', { size: 80, fill: 0xff0000 }); healthTxt.anchor.set(0, 0); LK.gui.topLeft.addChild(healthTxt); healthTxt.x = 120; // Avoid the platform menu icon healthTxt.y = 20; var autoShootTimer = 0; var autoBattleActive = false; // Create hack mode button var autoBattleButton = new Text2('HACK MODE', { size: 80, fill: 0xff0000 }); autoBattleButton.anchor.set(0.5, 1); LK.gui.bottom.addChild(autoBattleButton); autoBattleButton.y = -50; // Create noob text for hack mode var noobText = new Text2('SEN NOOB SUN HACK MODE AÇMIŞSIN DALGE GEÇSIN', { size: 60, fill: 0xffffff }); noobText.anchor.set(0.5, 0.5); LK.gui.center.addChild(noobText); noobText.visible = false; // Hidden by default // Create triple shot toggle button var tripleShootButton = new Text2('TRIPLE SHOOT: OFF', { size: 60, fill: 0xff0000 }); tripleShootButton.anchor.set(0.5, 1); LK.gui.bottom.addChild(tripleShootButton); tripleShootButton.y = -150; // Button click handler autoBattleButton.down = function (x, y, obj) { autoBattleActive = !autoBattleActive; if (autoBattleActive) { autoBattleButton.setText('STOP HACK'); autoBattleButton.tint = 0x00ff00; // Green when active noobText.visible = true; // Show noob text when hack mode is active } else { autoBattleButton.setText('HACK MODE'); autoBattleButton.tint = 0xff0000; // Red when inactive noobText.visible = false; // Hide noob text when hack mode is inactive } ; }; // Triple shoot variables var tripleShootActive = false; var tripleShootTimer = 0; // Triple shoot button click handler tripleShootButton.down = function (x, y, obj) { tripleShootActive = !tripleShootActive; if (tripleShootActive) { tripleShootButton.setText('TRIPLE SHOOT: ON'); tripleShootButton.tint = 0x00ff00; // Green when active } else { tripleShootButton.setText('TRIPLE SHOOT: OFF'); tripleShootButton.tint = 0xff0000; // Red when inactive } }; // Manual shooting - touch screen to shoot game.down = function (x, y, obj) { // Only allow manual shooting when hack mode is not active if (!autoBattleActive && energy > 0) { // Convert touch position to game coordinates // Check if obj and obj.parent exist before calling toGlobal if (obj && obj.parent && obj.parent.toGlobal) { var gamePos = game.toLocal(obj.parent.toGlobal({ x: x, y: y })); shootArrowAtTarget(gamePos.x, gamePos.y); } else { // Fallback: use x, y directly as they should already be in the correct coordinate system shootArrowAtTarget(x, y); } } }; function shootArrowAtTarget(targetX, targetY) { // Check if player has enough energy if (energy <= 0) { return; } // Calculate direction from archer to target point var dirX = targetX - archer.x; var dirY = targetY - archer.y; var distance = Math.sqrt(dirX * dirX + dirY * dirY); // Normalize direction var normalX = dirX / distance; var normalY = dirY / distance; // Make archer face the shooting direction archer.rotation = Math.atan2(normalY, normalX); // Create arrow var newArrow = new Arrow(); newArrow.x = archer.x; newArrow.y = archer.y; newArrow.speedX = normalX * 15; newArrow.speedY = normalY * 15; // Rotate arrow to face direction newArrow.rotation = Math.atan2(normalY, normalX); arrows.push(newArrow); game.addChild(newArrow); LK.getSound('shoot').play(); // Decrease energy energy -= 2; // Set shooting state isShooting = true; shootingTimer = 0; // Update energy display energyTxt.setText('Energy: ' + energy); // Change color based on energy level if (energy <= 20) { energyTxt.tint = 0xff0000; // Red when low } else if (energy <= 50) { energyTxt.tint = 0xffff00; // Yellow when medium } else { energyTxt.tint = 0x00ff00; // Green when high } } game.update = function () { // Triple shoot logic if (tripleShootActive) { tripleShootTimer++; if (tripleShootTimer >= 20 && energy >= 6) { // Fire every 20 frames (1/3 second) and need energy for 3 arrows tripleShootTimer = 0; // Find nearest enemy for targeting var nearestEnemy = null; var nearestDistance = Infinity; for (var e = 0; e < enemies.length; e++) { var enemy = enemies[e]; var distanceToEnemy = Math.sqrt(Math.pow(enemy.x - archer.x, 2) + Math.pow(enemy.y - archer.y, 2)); if (distanceToEnemy < nearestDistance) { nearestDistance = distanceToEnemy; nearestEnemy = enemy; } } // Fire 3 arrows with slight spread for (var triple = 0; triple < 3; triple++) { // If enemy exists, shoot at it, otherwise shoot straight right var targetX = nearestEnemy ? nearestEnemy.x : archer.x + 500; var targetY = nearestEnemy ? nearestEnemy.y : archer.y; // Add some spread to make it look more natural var spreadAngle = (triple - 1) * 0.2; // -0.2, 0, 0.2 radians spread // Calculate direction var dirX = targetX - archer.x; var dirY = targetY - archer.y; var distance = Math.sqrt(dirX * dirX + dirY * dirY); var baseAngle = Math.atan2(dirY, dirX); var finalAngle = baseAngle + spreadAngle; var normalX = Math.cos(finalAngle); var normalY = Math.sin(finalAngle); // Make archer face the shooting direction archer.rotation = baseAngle; // Create arrow var newArrow = new Arrow(); newArrow.x = archer.x; newArrow.y = archer.y; newArrow.speedX = normalX * 15; newArrow.speedY = normalY * 15; newArrow.rotation = finalAngle; arrows.push(newArrow); game.addChild(newArrow); // Decrease energy for each arrow energy -= 2; } // Play shoot sound LK.getSound('shoot').play(); // Update energy display energyTxt.setText('Energy: ' + energy); // Change color based on energy level if (energy <= 20) { energyTxt.tint = 0xff0000; // Red when low } else if (energy <= 50) { energyTxt.tint = 0xffff00; // Yellow when medium } else { energyTxt.tint = 0x00ff00; // Green when high } } } // Automatic shooting logic - only when hack mode is active if (autoBattleActive) { // Check if score exceeds 100 and update noob text accordingly if (LK.getScore() > 100) { noobText.setText('AMA ŞÖYLE DE'); } else { noobText.setText('SEN NOOB SUN HACK MODE AÇMIŞSIN DALGE GEÇSIN'); } autoShootTimer++; if (autoShootTimer >= 15) { // Shoot every 0.25 seconds (faster rate for hack mode) autoShootTimer = 0; // Shoot at all enemies for (var e = 0; e < enemies.length; e++) { var enemy = enemies[e]; if (enemy) { // Calculate direction from archer to enemy var dirX = enemy.x - archer.x; var dirY = enemy.y - archer.y; var distance = Math.sqrt(dirX * dirX + dirY * dirY); // Normalize direction var normalX = dirX / distance; var normalY = dirY / distance; // Make archer face the shooting direction archer.rotation = Math.atan2(normalY, normalX); // Create arrow without energy cost var newArrow = new Arrow(); newArrow.x = archer.x; newArrow.y = archer.y; newArrow.speedX = normalX * 15; newArrow.speedY = normalY * 15; // Rotate arrow to face direction newArrow.rotation = Math.atan2(normalY, normalX); arrows.push(newArrow); game.addChild(newArrow); } } // Play shoot sound if we shot any arrows if (enemies.length > 0) { LK.getSound('shoot').play(); } } } // Update shooting timer if (isShooting) { shootingTimer++; if (shootingTimer >= 30) { // Stop shooting state after 0.5 seconds isShooting = false; } } // Update energy regeneration only when not shooting (every 60 frames = 1 second at 60 FPS) if (!isShooting) { energyRegenTimer++; if (energyRegenTimer >= 60) { energyRegenTimer = 0; if (energy < 100) { energy += 1; // Update energy display energyTxt.setText('Energy: ' + energy); // Change color based on energy level if (energy <= 20) { energyTxt.tint = 0xff0000; // Red when low } else if (energy <= 50) { energyTxt.tint = 0xffff00; // Yellow when medium } else { energyTxt.tint = 0x00ff00; // Green when high } } } } else { energyRegenTimer = 0; // Reset regen timer when shooting } // Spawn enemies randomly on screen when needed if (enemies.length < maxEnemies) { enemySpawnTimer++; if (enemySpawnTimer >= enemySpawnRate) { enemySpawnTimer = 0; // Spawn new enemy at random position var newEnemy = new Enemy(); newEnemy.x = Math.random() * (2048 - 200) + 100; newEnemy.y = Math.random() * (2732 - 200) + 100; // Make sure enemy doesn't spawn too close to archer var distToArcher = Math.sqrt(Math.pow(newEnemy.x - archer.x, 2) + Math.pow(newEnemy.y - archer.y, 2)); if (distToArcher < 200) { // Respawn farther away newEnemy.x = Math.random() * (2048 - 400) + 200; if (newEnemy.x > archer.x - 200 && newEnemy.x < archer.x + 200) { newEnemy.x += 300; } } enemies.push(newEnemy); game.addChild(newEnemy); } } // Update arrows for (var i = arrows.length - 1; i >= 0; i--) { var arrow = arrows[i]; // Remove arrows that hit walls or go off screen if (arrow.x >= 2048 || arrow.x <= 0 || arrow.y >= 2732 || arrow.y <= 0) { arrow.destroy(); arrows.splice(i, 1); continue; } // Check arrow-enemy arrow collisions var arrowDestroyed = false; for (var k = enemyArrows.length - 1; k >= 0; k--) { var enemyArrow = enemyArrows[k]; if (arrow && enemyArrow && arrow.intersects(enemyArrow)) { // Both arrows destroy each other arrow.destroy(); arrows.splice(i, 1); enemyArrow.destroy(); enemyArrows.splice(k, 1); arrowDestroyed = true; break; } } // Skip enemy collision check if arrow was destroyed by enemy arrow if (arrowDestroyed) { continue; } // Check arrow-enemy collisions for (var j = enemies.length - 1; j >= 0; j--) { var enemy = enemies[j]; if (enemy && arrow && arrow.intersects(enemy)) { // Hit enemy LK.setScore(LK.getScore() + 10); scoreTxt.setText(LK.getScore()); LK.getSound('hit').play(); LK.effects.flashObject(enemy, 0xff0000, 200); // Remove arrow and enemy arrow.destroy(); arrows.splice(i, 1); enemy.destroy(); enemies.splice(j, 1); break; } } } // Update enemy arrows for (var m = enemyArrows.length - 1; m >= 0; m--) { var enemyArrow = enemyArrows[m]; // Remove arrows that hit walls or go off screen if (enemyArrow.x >= 2048 || enemyArrow.x <= 0 || enemyArrow.y >= 2732 || enemyArrow.y <= 0) { enemyArrow.destroy(); enemyArrows.splice(m, 1); continue; } // Check if enemy arrow hits player if (enemyArrow.intersects(archer)) { playerHealth--; healthTxt.setText('Health: ' + playerHealth); LK.getSound('playerHit').play(); LK.effects.flashObject(archer, 0xff0000, 300); enemyArrow.destroy(); enemyArrows.splice(m, 1); // Check if player is dead if (playerHealth <= 0) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); return; } continue; } } // When enemy dies, increase max enemies and spawn rate for difficulty if (LK.getScore() > 0 && LK.getScore() % 50 === 0) { if (maxEnemies < 5) { maxEnemies++; } if (enemySpawnRate > 30) { enemySpawnRate -= 5; } } };
===================================================================
--- original.js
+++ change.js
@@ -298,8 +298,14 @@
}
}
// Automatic shooting logic - only when hack mode is active
if (autoBattleActive) {
+ // Check if score exceeds 100 and update noob text accordingly
+ if (LK.getScore() > 100) {
+ noobText.setText('AMA ŞÖYLE DE');
+ } else {
+ noobText.setText('SEN NOOB SUN HACK MODE AÇMIŞSIN DALGE GEÇSIN');
+ }
autoShootTimer++;
if (autoShootTimer >= 15) {
// Shoot every 0.25 seconds (faster rate for hack mode)
autoShootTimer = 0;