User prompt
Make it a 0000000000.000.000.00000.000.000.0.0.0.000000.0.34% chance you will get the Buffdogbow when you get a power up.
User prompt
power up it moves so fast the human eye only sees a dot. Make the dog have aimbot and instant kill when gets a power up. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make it a 0000000000.000.000.00000.000.000.0.0.0.000000.0.34% chance you will get the Buffdogbow when you get a power up.
User prompt
Make it where when the dog gets a power up it goes a on fast it looks like and big brown dot. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make it where when the dog turns into a dog when moving so fast the dot is big and brown ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make the cat power up last for 2 minutes ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make it where when the dog gets a power up it moves so fast the human eye only sees a dot. Make the dog have aimbot and instant kill when gets a power up. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make the dog 92928922838822992% more faster when they get a power up. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make it where if the player is playing on dog team when they get a power up the dog becomes Buffdog and it goes so so fast and when it gets close to a cat it does ∞ damage ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make it where if the player is playing on dog team when they get a power up the dog becomes Buffdog and it goes so so fast and when it gets close to a cat it does ∞ damage ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make it where on the top right corner of the screen make a GUI that’s shows the other teams lives so if the player is playing on dog team it would say “cat lives:” but if the player is playing on cat team it would say “dog lives:”.
User prompt
Make it where on the top right corner of the screen make a GUI that’s shows the other teams lives so if the player is playing on dog team it would say “cat lives:” but if the player is playing on cat team it would say “dog lives:”.
User prompt
Make it where the power ups make the cats shoot Bulletofdeath so so so so super fast. Make it where when the cats shoot the Bulletofdeath instant kill the dogs.
User prompt
Make it where on the top right corner of the screen make a GUI that’s shows the other teams lives so if the player is playing on dog team it would say cat lives but if the player is playing on cat team it would say dog lives.
User prompt
Make it where on the top left corner of the screen there is a gui that says “your lives:” on the top right corner of the screen the is a gui that says “dog lives:”
User prompt
Make it where if the player is playing cat team it only spawns near the cats but if the player is on dog team it only spawns near the dogs.
User prompt
Make the power up only spawn at the team the person is playing as.
User prompt
Make it where the gui of how man dogs and cats there are is gone
User prompt
Make it where when you get the power up it gives the cat about so it shoots at where the enemy is.
User prompt
Make the Bulletofdeath the same size as catbullet.
User prompt
Fix all bugs
User prompt
Please fix the bug: 'TypeError: null is not an object (evaluating 'hitTarget.parent')' in or related to this line: 'if (hitTarget.parent) {' Line Number: 389
User prompt
Make it where the power ups make the cats shoot Bulletofdeath so so so so super fast. Make it where when the cats shoot the Bulletofdeath instant kill the dogs. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make it where the power ups make you shoot Bulletofdeath so so so so super fast. Please? Make the Bulletofdeath instant kill the dogs.
Code edit (1 edits merged)
Please save this source code
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Bullet = Container.expand(function (team, startX, startY, targetX, targetY) { var self = Container.call(this); self.team = team; self.speed = 8; var bulletGraphics = self.attachAsset(team === 'cat' ? 'catBullet' : 'dogBullet', { anchorX: 0.5, anchorY: 0.5 }); self.x = startX; self.y = startY; // Calculate direction var dx = targetX - startX; var dy = targetY - startY; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 0) { self.velocityX = dx / distance * self.speed; self.velocityY = dy / distance * self.speed; } else { self.velocityX = 0; self.velocityY = 0; } self.update = function () { self.x += self.velocityX; self.y += self.velocityY; }; return self; }); var BulletOfDeath = Container.expand(function (team, startX, startY, targetX, targetY) { var self = Container.call(this); self.team = team; self.speed = 15; // Faster than normal bullets self.isBulletOfDeath = true; // Mark as special bullet var bulletGraphics = self.attachAsset('Bulletofdeath', { anchorX: 0.5, anchorY: 0.5, tint: 0xFFD700 // Golden tint for BulletOfDeath }); // Add pulsing glow effect tween(bulletGraphics, { scaleX: 1.2, scaleY: 1.2 }, { duration: 200, easing: tween.easeInOut, onFinish: function onFinish() { tween(bulletGraphics, { scaleX: 1, scaleY: 1 }, { duration: 200, easing: tween.easeInOut }); } }); self.x = startX; self.y = startY; // Calculate direction var dx = targetX - startX; var dy = targetY - startY; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 0) { self.velocityX = dx / distance * self.speed; self.velocityY = dy / distance * self.speed; } else { self.velocityX = 0; self.velocityY = 0; } self.update = function () { self.x += self.velocityX; self.y += self.velocityY; }; return self; }); var Pet = Container.expand(function (team, x, y) { var self = Container.call(this); self.team = team; self.health = 3; self.lastShotTime = 0; self.shootCooldown = 1000; // 1 second between shots self.hasPowerUp = false; // Track if pet has power-up active var petGraphics = self.attachAsset(team, { anchorX: 0.5, anchorY: 0.5 }); self.x = x; self.y = y; self.takeDamage = function () { self.health--; LK.effects.flashObject(self, 0xFF0000, 500); if (self.health <= 0) { self.destroy(); return true; // Pet is dead } return false; }; self.shoot = function (targetX, targetY) { var currentTime = Date.now(); if (currentTime - self.lastShotTime >= self.shootCooldown) { var bullet; var finalTargetX = targetX; var finalTargetY = targetY; // If this is a powered-up cat, use smart targeting to find nearest enemy if (self.hasPowerUp && self.team === 'cat') { var nearestEnemy = null; var nearestDistance = Infinity; // Find the closest enemy dog for (var i = 0; i < enemyPets.length; i++) { var enemy = enemyPets[i]; if (enemy && enemy.parent && enemy.team === 'dog') { var dx = enemy.x - self.x; var dy = enemy.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance < nearestDistance) { nearestDistance = distance; nearestEnemy = enemy; } } } // If we found an enemy, target them directly if (nearestEnemy) { finalTargetX = nearestEnemy.x; finalTargetY = nearestEnemy.y; } } if (self.hasPowerUp) { bullet = new BulletOfDeath(self.team, self.x, self.y, finalTargetX, finalTargetY); } else { bullet = new Bullet(self.team, self.x, self.y, finalTargetX, finalTargetY); } game.addChild(bullet); bullets.push(bullet); self.lastShotTime = currentTime; LK.getSound('shoot').play(); } }; return self; }); var PowerUp = Container.expand(function (x, y) { var self = Container.call(this); var powerupGraphics = self.attachAsset('powerup', { anchorX: 0.5, anchorY: 0.5 }); self.x = x; self.y = y; self.type = 'speed'; // Could be expanded later // Gentle pulsing animation tween(self, { scaleX: 1.2, scaleY: 1.2 }, { duration: 1000, easing: tween.easeInOut, onFinish: function onFinish() { tween(self, { scaleX: 1, scaleY: 1 }, { duration: 1000, easing: tween.easeInOut }); } }); return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x90EE90 }); /**** * Game Code ****/ var gamePhase = 'teamSelect'; // 'teamSelect', 'playing', 'gameOver' var playerTeam = null; var playerPet = null; var enemyPets = []; var bullets = []; var powerups = []; var catScore = 0; var dogScore = 0; var targetScore = 25; var dragNode = null; var lastPowerupSpawn = 0; var powerupSpawnInterval = 10000; // 10 seconds // UI Elements var teamSelectText = new Text2('Choose Your Team!', { size: 80, fill: 0xFFFFFF }); teamSelectText.anchor.set(0.5, 0.5); teamSelectText.x = 1024; teamSelectText.y = 400; var catButton = LK.getAsset('cat', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.5, scaleY: 1.5 }); catButton.x = 700; catButton.y = 600; var dogButton = LK.getAsset('dog', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.5, scaleY: 1.5 }); dogButton.x = 1348; dogButton.y = 600; var catLabel = new Text2('CATS', { size: 60, fill: 0xFF6B35 }); catLabel.anchor.set(0.5, 0.5); catLabel.x = 700; catLabel.y = 750; var dogLabel = new Text2('DOGS', { size: 60, fill: 0x4A90E2 }); dogLabel.anchor.set(0.5, 0.5); dogLabel.x = 1348; dogLabel.y = 750; // Score display var scoreText = new Text2('Cats: 0 Dogs: 0', { size: 60, fill: 0xFFFFFF }); scoreText.anchor.set(0.5, 0); LK.gui.top.addChild(scoreText); // Add team selection UI game.addChild(teamSelectText); game.addChild(catButton); game.addChild(dogButton); game.addChild(catLabel); game.addChild(dogLabel); function startGame(selectedTeam) { playerTeam = selectedTeam; gamePhase = 'playing'; // Remove team selection UI teamSelectText.destroy(); catButton.destroy(); dogButton.destroy(); catLabel.destroy(); dogLabel.destroy(); // Create player pet playerPet = new Pet(selectedTeam, 1024, 2000); game.addChild(playerPet); // Create enemy pets var enemyTeam = selectedTeam === 'cat' ? 'dog' : 'cat'; for (var i = 0; i < 3; i++) { var enemyX = 300 + i * 700; var enemyY = 500 + Math.random() * 300; var enemy = new Pet(enemyTeam, enemyX, enemyY); game.addChild(enemy); enemyPets.push(enemy); } lastPowerupSpawn = Date.now(); } function updateScore() { scoreText.setText('Cats: ' + catScore + ' Dogs: ' + dogScore); if (catScore >= targetScore) { gamePhase = 'gameOver'; LK.showYouWin(); } else if (dogScore >= targetScore) { gamePhase = 'gameOver'; LK.showGameOver(); } } function findNearestTarget(pet) { var nearestTarget = null; var nearestDistance = Infinity; if (pet === playerPet) { // Player pet targets enemies for (var i = 0; i < enemyPets.length; i++) { var enemy = enemyPets[i]; if (enemy && enemy.parent) { var dx = enemy.x - pet.x; var dy = enemy.y - pet.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance < nearestDistance) { nearestDistance = distance; nearestTarget = enemy; } } } } else { // Enemy pets target player if (playerPet && playerPet.parent) { nearestTarget = playerPet; } } return nearestTarget; } function spawnPowerup() { var currentTime = Date.now(); if (currentTime - lastPowerupSpawn >= powerupSpawnInterval && powerups.length < 2) { var x = 200 + Math.random() * 1648; var y = 300 + Math.random() * 1500; var powerup = new PowerUp(x, y); game.addChild(powerup); powerups.push(powerup); lastPowerupSpawn = currentTime; } } // Event handlers catButton.down = function () { if (gamePhase === 'teamSelect') { startGame('cat'); } }; dogButton.down = function () { if (gamePhase === 'teamSelect') { startGame('dog'); } }; game.down = function (x, y, obj) { if (gamePhase === 'playing' && playerPet) { dragNode = playerPet; playerPet.x = x; playerPet.y = y; } }; game.move = function (x, y, obj) { if (gamePhase === 'playing' && dragNode === playerPet) { playerPet.x = Math.max(60, Math.min(1988, x)); playerPet.y = Math.max(60, Math.min(2672, y)); } }; game.up = function (x, y, obj) { dragNode = null; }; game.update = function () { if (gamePhase !== 'playing') return; // Update bullets for (var i = bullets.length - 1; i >= 0; i--) { var bullet = bullets[i]; // Check if bullet is off screen if (bullet.x < -50 || bullet.x > 2098 || bullet.y < -50 || bullet.y > 2782) { bullet.destroy(); bullets.splice(i, 1); continue; } // Check bullet collisions var hitTarget = null; if (bullet.team === playerTeam) { // Player bullet hitting enemies for (var j = 0; j < enemyPets.length; j++) { var enemy = enemyPets[j]; if (enemy && enemy.parent && bullet.intersects(enemy)) { hitTarget = enemy; if (playerTeam === 'cat') { catScore++; } else { dogScore++; } break; } } } else { // Enemy bullet hitting player if (playerPet && playerPet.parent && bullet.intersects(playerPet)) { hitTarget = playerPet; if (playerTeam === 'cat') { dogScore++; } else { catScore++; } } } if (hitTarget) { LK.getSound('hit').play(); var isDead = false; // Check if it's a BulletOfDeath hitting a dog - instant kill! if (bullet.isBulletOfDeath && hitTarget.team === 'dog') { hitTarget.health = 0; // Set health to 0 for instant kill isDead = true; // Special death effect for BulletOfDeath kills LK.effects.flashObject(hitTarget, 0xFFFF00, 800); // Golden flash for instant kill var targetToDestroy = hitTarget; // Store reference before tween tween(hitTarget, { scaleX: 2, scaleY: 2, alpha: 0 }, { duration: 300, easing: tween.easeOut, onFinish: function onFinish() { if (targetToDestroy && targetToDestroy.parent) { targetToDestroy.destroy(); } } }); } else { isDead = hitTarget.takeDamage(); } if (isDead) { if (hitTarget === playerPet) { // Respawn player after 2 seconds LK.setTimeout(function () { if (gamePhase === 'playing') { playerPet = new Pet(playerTeam, 1024, 2000); game.addChild(playerPet); } }, 2000); } else { // Remove from enemy array for (var k = 0; k < enemyPets.length; k++) { if (enemyPets[k] === hitTarget) { enemyPets.splice(k, 1); break; } } // Respawn enemy after 3 seconds LK.setTimeout(function () { if (gamePhase === 'playing') { var enemyTeam = playerTeam === 'cat' ? 'dog' : 'cat'; var enemyX = 300 + Math.random() * 1448; var enemyY = 300 + Math.random() * 800; var newEnemy = new Pet(enemyTeam, enemyX, enemyY); game.addChild(newEnemy); enemyPets.push(newEnemy); } }, 3000); } } bullet.destroy(); bullets.splice(i, 1); updateScore(); continue; } } // Auto-shooting for all pets if (playerPet && playerPet.parent) { var target = findNearestTarget(playerPet); if (target) { playerPet.shoot(target.x, target.y); } } for (var i = 0; i < enemyPets.length; i++) { var enemy = enemyPets[i]; if (enemy && enemy.parent) { var target = findNearestTarget(enemy); if (target) { enemy.shoot(target.x, target.y); } } } // Check powerup collisions - only cats can use powerups for (var i = powerups.length - 1; i >= 0; i--) { var powerup = powerups[i]; if (playerPet && playerPet.parent && powerup.intersects(playerPet) && playerPet.team === 'cat') { LK.getSound('powerup').play(); playerPet.shootCooldown = 25; // Super fast shooting - 40 bullets per second! playerPet.hasPowerUp = true; // Enable BulletOfDeath mode // Add visual effect to show cat is powered up tween(playerPet, { scaleX: 1.3, scaleY: 1.3 }, { duration: 200, easing: tween.easeOut }); // Reset after 8 seconds for extended mayhem LK.setTimeout(function () { if (playerPet && playerPet.parent) { playerPet.shootCooldown = 1000; playerPet.hasPowerUp = false; // Disable BulletOfDeath mode // Return cat to normal size tween(playerPet, { scaleX: 1, scaleY: 1 }, { duration: 200, easing: tween.easeOut }); } }, 8000); powerup.destroy(); powerups.splice(i, 1); } } // Spawn powerups occasionally spawnPowerup(); };
===================================================================
--- original.js
+++ change.js
@@ -104,12 +104,37 @@
self.shoot = function (targetX, targetY) {
var currentTime = Date.now();
if (currentTime - self.lastShotTime >= self.shootCooldown) {
var bullet;
+ var finalTargetX = targetX;
+ var finalTargetY = targetY;
+ // If this is a powered-up cat, use smart targeting to find nearest enemy
+ if (self.hasPowerUp && self.team === 'cat') {
+ var nearestEnemy = null;
+ var nearestDistance = Infinity;
+ // Find the closest enemy dog
+ for (var i = 0; i < enemyPets.length; i++) {
+ var enemy = enemyPets[i];
+ if (enemy && enemy.parent && enemy.team === 'dog') {
+ var dx = enemy.x - self.x;
+ var dy = enemy.y - self.y;
+ var distance = Math.sqrt(dx * dx + dy * dy);
+ if (distance < nearestDistance) {
+ nearestDistance = distance;
+ nearestEnemy = enemy;
+ }
+ }
+ }
+ // If we found an enemy, target them directly
+ if (nearestEnemy) {
+ finalTargetX = nearestEnemy.x;
+ finalTargetY = nearestEnemy.y;
+ }
+ }
if (self.hasPowerUp) {
- bullet = new BulletOfDeath(self.team, self.x, self.y, targetX, targetY);
+ bullet = new BulletOfDeath(self.team, self.x, self.y, finalTargetX, finalTargetY);
} else {
- bullet = new Bullet(self.team, self.x, self.y, targetX, targetY);
+ bullet = new Bullet(self.team, self.x, self.y, finalTargetX, finalTargetY);
}
game.addChild(bullet);
bullets.push(bullet);
self.lastShotTime = currentTime;