Code edit (5 edits merged)
Please save this source code
User prompt
Lets go ahead and standardize all human image assets that start with human_ to dimensions 48x146
User prompt
Please fix the bug: 'ReferenceError: greyscaleFilter is not defined' in or related to this line: 'humanGraphics.filters = [greyscaleFilter]; // Reset to greyscale filter' Line Number: 618
User prompt
Please fix the bug: 'ReferenceError: greyscaleFilter is not defined' in or related to this line: 'humanGraphics.filters = [greyscaleFilter]; // Reset to greyscale filter' Line Number: 618
User prompt
Please fix the bug: 'filters is not defined' in or related to this line: 'var greyscaleFilter = new filters.ColorMatrixFilter();' Line Number: 487
Code edit (3 edits merged)
Please save this source code
User prompt
atm the humans are not spawning in greyscale. this is a reminder of how we did it for zombies: zombieGraphics.tint = 0x007e94; // Blue tint for the mask YOu can use grey for a grey mask
User prompt
fix
User prompt
instead of doing this so complicated, do it similarly to how we apply masks on zombies. Apply a grey mask over our humans the same way we color our zombie
User prompt
Please fix the bug: 'filters is not defined' in or related to this line: 'humanGraphics.filters = [new filters.ColorMatrixFilter()];' Line Number: 484
User prompt
humans are not loading in greyscale
User prompt
now to normalize humans even further, make sure they load in greyscale
User prompt
one of the humans appear as purple rectangle why is this
Code edit (2 edits merged)
Please save this source code
User prompt
normalize all the human images (Human_#) asset to dimension 80x220. iterate through all of them
User prompt
We need to redo the appearance for humans. When it loads the Human image assets it can choose randomly between Human_1 all the way to Human_16 (That's right any of the 16 human images at random) so list them out and make them random
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
it's still not working. please remove the admin tools for now
User prompt
it's still not working. make sure the admin tool is crafted properly so it works. make sure its in the correct section. it should proabbly be in var factory
User prompt
our admin tool doesn't work, when i click mishnu snacks don't increase. lets remove what we just did and instead make an admin tool to increase meat by 10 when clicking. meat on the backend, not the display text
User prompt
add an easy to remove function that increase "dog food" (the backend in our factory) as I click as an admin tool. Label thos lines //admin tool so they can be removed easily later
Code edit (1 edits merged)
Please save this source code
User prompt
please fix this
User prompt
Please fix the bug: 'Timeout.tick error: UpgradedZombie is not defined' in or related to this line: 'newZombie = new UpgradedZombie(); // Upgraded zombie for higher levels' Line Number: 955
===================================================================
--- original.js
+++ change.js
@@ -590,137 +590,8 @@
globalHealthBar.y = 2560; // Position at the top center
uiLayer.addChild(globalHealthBar); // Add to the UI layer to ensure visibility
return self;
});
-var UpgradedZombie = Container.expand(function () {
- var self = Container.call(this);
- // Add the upgraded zombie graphics
- self.zombieGraphics = self.attachAsset('Zombie', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.zombieGraphics.tint = 0xff0000; // Red tint for upgraded zombies
- // Attributes
- self.speed = 3; // Faster speed for upgraded zombies
- self.harvestTime = 3000; // Faster harvest time
- self.attackCooldown = 2000; // Faster attack cooldown
- self.lastAttackTime = 0;
- self.state = 'roaming';
- self.targetX = Math.random() * 2048;
- self.targetY = Math.random() * 2432;
- self.inRadiusStartTime = null;
- var agonySound = null;
- var harvestSoundPlayed = false;
- // Helper function: Generate a random roaming target
- function setRandomTarget() {
- self.targetX = Math.random() * 2048;
- self.targetY = Math.random() * 2432;
- }
- // Helper function: Move to a target
- function moveToTarget(targetX, targetY) {
- var speedMultiplier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
- var dx = targetX - self.x;
- var dy = targetY - self.y;
- var distance = Math.sqrt(dx * dx + dy * dy);
- if (distance > 1) {
- self.x += dx / distance * self.speed * speedMultiplier;
- self.y += dy / distance * self.speed * speedMultiplier;
- } else {
- setRandomTarget();
- }
- }
- // Update behavior
- self.update = function () {
- var dx = mishnu.x - self.x;
- var dy = mishnu.y - self.y;
- var distanceToMishnu = Math.sqrt(dx * dx + dy * dy);
- switch (self.state) {
- case 'roaming':
- moveToTarget(self.targetX, self.targetY);
- if (distanceToMishnu < radius.radiusSize) {
- self.state = 'attacking';
- self.inRadiusStartTime = Date.now();
- if (Math.random() < 1 / 2) {
- agonySound = getRandomSound(['GiggleMan_1', 'GiggleMan_2', 'GiggleMan_3', 'GiggleMan_4']);
- agonySound.volume = 0.3;
- agonySound.play();
- }
- }
- break;
- case 'attacking':
- moveToTarget(mishnu.x, mishnu.y, 1.5);
- if (distanceToMishnu < radius.radiusSize) {
- var elapsedTime = Date.now() - self.inRadiusStartTime;
- if (elapsedTime >= self.harvestTime / mishnu.harvestSpeed) {
- self.state = 'harvested';
- game.removeChild(self);
- zombies.splice(zombies.indexOf(self), 1);
- mishnu.humansHarvested += 2;
- if (!harvestSoundPlayed) {
- LK.getSound('Ding_1').play();
- getRandomSound(['Squish_1', 'Squish_2', 'Squish_3', 'Squish_4']).play();
- harvestSoundPlayed = true;
- }
- addBloodSplashes(true);
- return;
- }
- if (distanceToMishnu < 50 && Date.now() - self.lastAttackTime > self.attackCooldown) {
- globalHealthBar.setHealth(globalHealthBar.currentHealth - 1);
- self.lastAttackTime = Date.now();
- self.state = 'fleeing';
- var fleeAngle = Math.random() * Math.PI * 2;
- self.targetX = mishnu.x + Math.cos(fleeAngle) * (radius.radiusSize + 50);
- self.targetY = mishnu.y + Math.sin(fleeAngle) * (radius.radiusSize + 50);
- addBloodSplashes();
- flashGreyMask([mishnu, radius, globalHealthBar], 400, 3);
- LK.getSound('Hit').play();
- LK.setTimeout(function () {
- LK.getSound('Bark').play();
- }, 200);
- }
- } else {
- self.state = 'roaming';
- setRandomTarget();
- }
- break;
- case 'fleeing':
- moveToTarget(self.targetX, self.targetY, 2);
- if (distanceToMishnu > radius.radiusSize + 50) {
- self.state = 'roaming';
- setRandomTarget();
- } else if (distanceToMishnu < radius.radiusSize) {
- if (!self.inRadiusStartTime) {
- self.inRadiusStartTime = Date.now();
- }
- var elapsedTime = Date.now() - self.inRadiusStartTime;
- if (elapsedTime >= self.harvestTime) {
- self.state = 'harvested';
- game.removeChild(self);
- zombies.splice(zombies.indexOf(self), 1);
- mishnu.humansHarvested += 2;
- if (!harvestSoundPlayed) {
- LK.getSound('Ding_1').play();
- getRandomSound(['Squish_1', 'Squish_2', 'Squish_3', 'Squish_4']).play();
- harvestSoundPlayed = true;
- }
- addBloodSplashes(true);
- return;
- }
- }
- break;
- case 'harvested':
- break;
- default:
- console.error("Zombie in unknown state: ".concat(self.state));
- self.state = 'roaming';
- setRandomTarget();
- break;
- }
- };
- // Set initial target
- setRandomTarget();
- return self;
-});
var Zombie = Container.expand(function () {
var self = Container.call(this);
// Add the zombie graphics
self.zombieGraphics = self.attachAsset('Zombie', {
@@ -1024,12 +895,14 @@
spawnY = Math.random() * (2432 - 300);
break;
}
var newZombie;
- if (currentLevelGroup === 0) {
- newZombie = new Zombie(); // Base zombie
- } else {
- newZombie = new UpgradedZombie(); // Upgraded zombie for higher levels
+ newZombie = new Zombie(); // Use base zombie class
+ if (currentLevelGroup > 0) {
+ // Upgrade stats for higher levels
+ newZombie.speed *= 1.1 * currentLevelGroup; // Increase speed by 10% per level group
+ newZombie.harvestTime = (newZombie.harvestTime || 4000) * Math.pow(2, currentLevelGroup); // Increase harvest time exponentially
+ newZombie.zombieGraphics.tint = 0xff0000; // Red tint for upgraded zombies
}
newZombie.x = spawnX;
newZombie.y = spawnY;
zombies.push(newZombie);
blurry texture background 4k black and white
can of Dog Food. Game asset. 3d clipart. Blank background. High contrast. No shadows..
black capsule. Game asset. 3d clipart. Blank background. High contrast. No shadows..
woman in short shorts. mobile game art. pixel art. full body. front facing. Blank background. High contrast. No shadows.
laser beam cartoon game asset. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
bone. clipart. cartoon. Blank background. High contrast. No shadows..
Game Over. Red game letters, dripping. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Dog_panting
Sound effect
Agony_Yell_1
Sound effect
Music_Level_1_5
Music
Music_Level_1_4
Music
Agony_Yell_2
Sound effect
Agony_Yell_3
Sound effect
Agony_Yell_4
Sound effect
Agony_Yell_5
Sound effect
Agony_Yell_6
Sound effect
Agony_Yell_7
Sound effect
Dog_Crunch
Sound effect
Dog_Crunch_2
Sound effect
Dog_Crunch_3
Sound effect
Ding_1
Sound effect
Squish_1
Sound effect
Squish_2
Sound effect
Squish_4
Sound effect
Squish_3
Sound effect
Factory_Deposit
Sound effect
Factory_Operation
Sound effect
Level_Up
Sound effect
Bark
Sound effect
Hit
Sound effect
Agony_Yell_8
Sound effect
Agony_Yell_9
Sound effect
GiggleMan_1
Sound effect
GiggleMan_2
Sound effect
GiggleMan_3
Sound effect
GiggleMan_4
Sound effect
Booster_Sound
Sound effect
Can
Sound effect
woosh
Sound effect
Agony_Yell_10
Sound effect
Bark_2
Sound effect
Bark_3
Sound effect
laser
Sound effect
searing
Sound effect
laser_2
Sound effect
Laser_3
Sound effect
Laser_4
Sound effect
Boss_Hit
Sound effect
Boss_Hit_2
Sound effect
Boss_Hit_3
Sound effect
GiggleMan_5
Sound effect
GiggleMan_6
Sound effect
hip_hop_loop
Sound effect