User prompt
can you add another vampire varient(the stats dont really change but they both spawn in pairs of 2 when twisted bloodmoon)
User prompt
can you add a zombie and vampire in assets a twisted bloodmoon theme (the wendigo ISNT able to apear in twisted bloodmoons) also add a red and black shade for twisted bloodmoons a zombie chase theme and a wendigo chase theme
User prompt
can you make only the wood apear in the gui when its night and also make the cat being able to pick up wood also start with 3 wood and every 5-10 seconds deplete the wood if the fire runs out the night turns into a new type "twisted" bloodmoon where a new enemy type shows up vampires also add zombies that are able to apear in both nights(25% to apear 2 apear) and blood moon(50% to apear 3 apear) also there pretty slow vampires are fast and kill npcs the npcs run to the cabin when its "twisted" bloodmoon
User prompt
can you also make wood apear during night and a campfire and if it runs out you lose a live and when its night/peacefull night the npcs go the campfire instead of the cabin) and also make it so a blood moon cant apear after a blood moon ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
and also a live counter for the player its 3 lives for the dog 3 (the npc lives are hidden) for the deer its 2 lives and for the rest 1 (also make berries spawn less at night and they dont have 25% to spawn extra berries)
User prompt
the deer doesnt move in blood moon when targeted
User prompt
can you also make a day counter
User prompt
the animals are still green and stuff can you fix that to please
User prompt
theres a bug the music keeps playing like night keeps playing when its day can you please fix that
User prompt
can you delete the hit sound but if the npc gets hit they play the kill sound
User prompt
can you also add a touch sound for every animal in assets and kill/hit sounds
User prompt
also can you add when theres a bloodmoon instead of doing the berries x2 can you add the berries by 5 (what i mean is when the first bloodmoon happens it goes from 10>15 to advance the day AND bloodmoon also it goes from 5>10 to advance the night each bloodmoon it adds 5+ berries to collect so you can advance)
User prompt
can you also add a chase theme for the wolves when they get close and a 25% chance when night apears no wolves apears wich is called a "peacefull" night where nothing happens when the next night is a bloodmoon theres a 75% for a "peacefull" night also add ambience for a peacefull night please
User prompt
can you also add a blood moon music in assets
User prompt
can you also add a howl in assets that sounds when the night appears and also both a day song where theres birds and a night song where theres cricket
User prompt
they have a 50% chance to go to a berry and wait there so its harder for the player to get berries during the night
User prompt
the wolves also walk around at night
User prompt
also the wolfs only go after the player/npcs when there close
User prompt
okay i dont think you know the abillities cat,squirrel and bunny:they give a 2x multiplier but only the bunny is able to move when targeted the are drasticly slowed more slowed than the deer(there common so they have a 50% of apearing when an npc is chosen to spawn) deer:they dont give a multiplier but if they die they give 20 berries (is able to get multiplied) (uncommon so 35% chance of appearing when an npc is chosen to spawn) the deer also has an extra live so the deer is able to get hit twice they arent frozen when targeted but are slowed fennec they are also able to collect berries and dont get frozen but dont give a multiplier and if there targeted they CANT get into the cabin(uncommon so they have a 35% chance of apearing when a npc is chosen to spawn) mouse gives a 4x multiplier when targeted they get a speed boost and run to the cabin NO MATTER WHAT(rare so they have a 15% chance to spawn) dog can be killed when hit 3 times when its night/bloodmoon they stun a wolf for 5 seconds and get a slowed down a bit or stun the wendigo for 3 seconds getting targeted and getting slowed DRASTICLY after the stun they run back to the cabin to hide (rare 15% chance of apearing when an npc is chosen to spawn) also npcs have 25% to spawn after a night
User prompt
also the deer can move when targeted theyre only slowed also the wendigo targets like this (commons(25%)mouse(10%)fennec(20%)dog(50%)deer(30%)) also make the 3rd night be a blood moon and after the third night theres a 25% chance when its night its a blood moon
User prompt
also the dier doesnt give a multiplier niether does the fennec and the dog also they only the mouse gives a 4x multiplier and the rest give a 2x multiplier
User prompt
can you make it whenever a berry spawns it has a 25% chance to spawn another (maxes out at 4)
User prompt
make 3 wolves spawn at night but when theres a fennec fox it gets depleted by 1 when blood moon apears and the player survives it add 1 wolf when night apears
User prompt
can you make it only 20% for an npc to spawn and dont make the bunny show up in the start
User prompt
all of the npcs have different things except common(they do the same) they give a 2x multiplier for score and freeze if there targeted by the wendigo for the uncommon tier deer and the fennec fox do something different the fennec fox is also able to collect berries and depletes the wolves that apear during night by 1 they do freeze if targeted the deer is able to run if the wendigo apears and if they get killed by the wendigo or a wolf they give 10 berries they also have to get hit twice the mouse gives a 4x multiplier is able to run to the cabin but slows down if there targeted by the wendigo and i already explained the dog ↪💡 Consider importing and using the following plugins: @upit/tween.v1
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var Bunny = Container.expand(function () { var self = Container.call(this); var bunnyGraphics = self.attachAsset('bunny', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.5, scaleY: 1.5 }); self.berriesGiven = 0; self.update = function () { // Gentle bouncing animation self.y += Math.sin(LK.ticks * 0.15) * 0.3; // Move bunny around in a gentle pattern if (LK.ticks % 120 === 0) { // Every 2 seconds, move to a new position var newX = Math.random() * (1800 - 200) + 200; var newY = Math.random() * (2400 - 200) + 200; tween(self, { x: newX, y: newY }, { duration: 2000, easing: tween.easeInOut }); } }; return self; }); var Campfire = Container.expand(function () { var self = Container.call(this); var campfireGraphics = self.attachAsset('campfire', { anchorX: 0.5, anchorY: 0.5 }); self.wood = 3; // Start with 3 wood self.burnRate = 1; // Wood burns every 60 frames (1 second) self.lastBurnTime = 0; self.nextBurnIn = Math.floor(Math.random() * 300) + 300; // Random 5-10 seconds (300-600 frames) self.addWood = function (amount) { self.wood += amount; updateCampfireDisplay(); }; self.update = function () { if (isNight || isPeacefulNight) { // Burn wood during night at random intervals if (LK.ticks - self.lastBurnTime >= self.nextBurnIn) { if (self.wood > 0) { self.wood--; self.lastBurnTime = LK.ticks; self.nextBurnIn = Math.floor(Math.random() * 300) + 300; // Random 5-10 seconds updateCampfireDisplay(); } else { // No wood left, start twisted blood moon isTwistedBloodMoon = true; isNight = false; isBloodMoon = true; LK.stopMusic(); LK.playMusic('twistedBloodMoonTheme'); dayNightTxt.setText('Twisted Blood Moon'); dayNightTxt.fill = 0x8B0000; game.setBackgroundColor(0x110000); tween(background, { tint: 0x220000, alpha: 0.8 }, { duration: 1000 }); // Move all NPCs to cabin during twisted blood moon for (var i = 0; i < npcs.length; i++) { npcs[i].enterCabin(); } self.wood = 3; // Reset wood to prevent immediate re-trigger updateCampfireDisplay(); } } // Fire animation effect campfireGraphics.scaleX = 1 + Math.sin(LK.ticks * 0.3) * 0.2; campfireGraphics.scaleY = 1 + Math.cos(LK.ticks * 0.25) * 0.15; } }; return self; }); var Fox = Container.expand(function () { var self = Container.call(this); var foxGraphics = self.attachAsset('fox', { anchorX: 0.5, anchorY: 0.5 }); return self; }); var NPC = Container.expand(function (type) { var self = Container.call(this); self.type = type; // Set multiplier based on type: only mouse gives 4x, cat/bunny/squirrel give 2x, deer/fennec/dog give no multiplier if (type === 'mouse') { self.multiplier = 4; } else if (type === 'cat' || type === 'bunny' || type === 'squirrel') { self.multiplier = 2; } else { self.multiplier = 0; // deer, fennec, dog don't give multipliers } self.inCabin = false; self.frozen = false; // Set hit points: deer has 2 lives, dog has 3 lives, others have 1 if (type === 'deer') { self.hitPoints = 2; } else if (type === 'dog') { self.hitPoints = 3; } else { self.hitPoints = 1; } self.isTargeted = false; self.rarity = 'common'; // Default rarity, will be set when spawned var npcGraphics = self.attachAsset(type, { anchorX: 0.5, anchorY: 0.5 }); // Add rarity visual indicator after graphics are created self.setRarityVisual = function () { // All animals keep their natural colors - no tinting applied // Rarity can be indicated through other means like size or behavior }; self.update = function () { if (self.frozen || self.inCabin) return; // Apply movement speed based on targeting and type if (self.isTargeted) { if (self.type === 'bunny') { // Bunny can move when targeted but is drastically slowed self.targetedSpeed = 0.3; } else if (self.type === 'cat' || self.type === 'squirrel') { // Cat and squirrel are more drastically slowed than deer self.targetedSpeed = 0.1; } else if (self.type === 'deer') { // Deer is slowed but not as much as commons self.targetedSpeed = 0.5; } else if (self.type === 'mouse') { // Mouse gets speed boost when targeted self.targetedSpeed = 4; } else if (self.type === 'fennec') { // Fennec can't enter cabin when targeted self.canEnterCabin = false; self.targetedSpeed = 1; } else if (self.type === 'dog') { // Dog is slowed drastically when targeted self.targetedSpeed = 0.2; } } // Cat behavior - collect wood during night if (self.type === 'cat' && (isNight || isPeacefulNight) && !self.inCabin) { // Check for nearby wood to collect for (var w = woodItems.length - 1; w >= 0; w--) { var wood = woodItems[w]; var woodDist = Math.sqrt(Math.pow(wood.x - self.x, 2) + Math.pow(wood.y - self.y, 2)); if (woodDist < 100) { // Move towards wood var dx = wood.x - self.x; var dy = wood.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 0) { self.x += dx / distance * 2; self.y += dy / distance * 2; } // Collect wood if close enough if (woodDist < 50) { campfire.addWood(1); woodItems.splice(w, 1); wood.destroy(); break; } return; } } } // Fennec fox behavior - collect berries and deplete wolves if (self.type === 'fennec' && (!self.isTargeted || !self.canEnterCabin)) { // Check for nearby berries to collect for (var b = normalBerries.length - 1; b >= 0; b--) { var berry = normalBerries[b]; var berryDist = Math.sqrt(Math.pow(berry.x - self.x, 2) + Math.pow(berry.y - self.y, 2)); if (berryDist < 100) { // Move towards berry var dx = berry.x - self.x; var dy = berry.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 0) { self.x += dx / distance * 2; self.y += dy / distance * 2; } // Collect berry if close enough if (berryDist < 50) { normalBerries.splice(b, 1); berry.destroy(); berriesCollectedInCycle++; break; } return; } } // Deplete wolves during night if (isNight && wolves.length > 0) { var targetWolf = wolves[0]; var wolfDist = Math.sqrt(Math.pow(targetWolf.x - self.x, 2) + Math.pow(targetWolf.y - self.y, 2)); if (wolfDist < 100) { // Remove one wolf targetWolf.destroy(); wolves.splice(0, 1); } } } // Deer behavior - run from wendigo, give berries when killed if (self.type === 'deer') { if (isBloodMoon && wendigo) { var wendigoDist = Math.sqrt(Math.pow(wendigo.x - self.x, 2) + Math.pow(wendigo.y - self.y, 2)); if (wendigoDist < 400) { // Run away from wendigo - use targetedSpeed if targeted, otherwise normal speed var speed = self.isTargeted ? self.targetedSpeed : 3; var dx = self.x - wendigo.x; var dy = self.y - wendigo.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 0) { self.x += dx / distance * speed; self.y += dy / distance * speed; } return; } } } // Mouse behavior - run to cabin but slow down when targeted if (self.type === 'mouse') { if ((isNight || isBloodMoon) && !self.inCabin) { var targetSpeed = self.isTargeted ? 1 : 3; var dx = cabin.x - self.x; var dy = cabin.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 50) { self.x += dx / distance * targetSpeed; self.y += dy / distance * targetSpeed; } else { self.enterCabin(); } return; } } // Dog behavior during night/blood moon if (self.type === 'dog' && (isNight || isBloodMoon) && !self.isTargeted) { // Check for nearby wolves or wendigo var nearestThreat = null; var minDistance = Infinity; // Check wolves for (var w = 0; w < wolves.length; w++) { if (!wolves[w].stunned) { var dist = Math.sqrt(Math.pow(wolves[w].x - self.x, 2) + Math.pow(wolves[w].y - self.y, 2)); if (dist < minDistance) { minDistance = dist; nearestThreat = wolves[w]; } } } // Check wendigo if (wendigo && !wendigo.stunned) { var wendigoDist = Math.sqrt(Math.pow(wendigo.x - self.x, 2) + Math.pow(wendigo.y - self.y, 2)); if (wendigoDist < minDistance) { minDistance = wendigoDist; nearestThreat = wendigo; } } // If threat is close enough (within 300 pixels), attack it if (nearestThreat && minDistance < 300) { self.isTargeted = true; // Move towards threat to stun it var dx = nearestThreat.x - self.x; var dy = nearestThreat.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 0) { self.x += dx / distance * 4; // Dog moves fast when attacking self.y += dy / distance * 4; } return; } } // Normal movement when not attacking if (!self.isTargeted) { // Gentle movement animation self.y += Math.sin(LK.ticks * 0.1 + self.x * 0.01) * 0.3; if (LK.ticks % 200 === 0) { var newX = Math.random() * (1800 - 200) + 200; var newY = Math.random() * (2400 - 200) + 200; tween(self, { x: newX, y: newY }, { duration: 3000, easing: tween.easeInOut }); } } }; self.enterCabin = function () { self.inCabin = true; var targetX, targetY; if ((isNight || isPeacefulNight) && !isTwistedBloodMoon) { // Go to campfire during night targetX = campfire.x + (Math.random() - 0.5) * 200; targetY = campfire.y + (Math.random() - 0.5) * 200; } else { // Go to cabin during day or twisted blood moon targetX = cabin.x; targetY = cabin.y; } tween(self, { x: targetX, y: targetY, alpha: 0.3 }, { duration: 1000 }); }; self.exitCabin = function () { self.inCabin = false; var newX = Math.random() * (1800 - 200) + 200; var newY = Math.random() * (2400 - 200) + 200; tween(self, { x: newX, y: newY, alpha: 1 }, { duration: 1000 }); }; self.freeze = function () { self.frozen = true; npcGraphics.tint = 0x4444ff; }; self.takeDamage = function () { self.hitPoints--; // Always play kill sound when NPC gets hit LK.getSound(self.type + 'Kill').play(); if (self.hitPoints <= 0) { // If it's a deer being killed, spawn 20 berries (can be multiplied) if (self.type === 'deer') { for (var i = 0; i < 20; i++) { LK.setTimeout(function () { spawnNormalBerry(); }, i * 100); // Stagger berry spawning } } return true; // NPC is killed } else { // Flash red to show damage tween(npcGraphics, { tint: 0xFF0000 }, { duration: 200, onFinish: function onFinish() { tween(npcGraphics, { tint: 0xFFFFFF }, { duration: 200 }); } }); return false; } }; self.stunThreat = function (threat) { if (threat === wendigo) { threat.stunned = true; threat.stunnedUntil = LK.ticks + 180; // 3 seconds at 60fps } else { threat.stunned = true; threat.stunnedUntil = LK.ticks + 300; // 5 seconds at 60fps } // Make threat flash blue to show it's stunned tween(threat.children[0], { tint: 0x4444FF }, { duration: 300 }); // Dog retreats after stunning self.isTargeted = true; var retreatX = Math.random() * (1800 - 200) + 200; var retreatY = Math.random() * (2400 - 200) + 200; tween(self, { x: retreatX, y: retreatY }, { duration: 1000, onFinish: function onFinish() { self.isTargeted = false; } }); }; return self; }); var NormalBerry = Container.expand(function () { var self = Container.call(this); var berryGraphics = self.attachAsset('normalBerry', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { // Gentle floating animation self.y += Math.sin(LK.ticks * 0.1 + self.x * 0.01) * 0.5; }; return self; }); var Vampire = Container.expand(function () { var self = Container.call(this); var vampireGraphics = self.attachAsset('vampire', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 4; // Fast vampire self.update = function () { if (!isTwistedBloodMoon) return; // Find nearest NPC to kill var closestNPC = null; var closestDistance = Infinity; for (var i = 0; i < npcs.length; i++) { if (!npcs[i].inCabin && !npcs[i].killed) { var dx = npcs[i].x - self.x; var dy = npcs[i].y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance < closestDistance) { closestDistance = distance; closestNPC = npcs[i]; } } } // Move towards closest NPC if (closestNPC) { var dx = closestNPC.x - self.x; var dy = closestNPC.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 0) { self.x += dx / distance * self.speed; self.y += dy / distance * self.speed; } // Kill NPC if close enough if (distance < 50) { closestNPC.killed = true; tween(closestNPC, { alpha: 0, scaleX: 0, scaleY: 0 }, { duration: 500, onFinish: function onFinish() { closestNPC.destroy(); npcs.splice(npcs.indexOf(closestNPC), 1); } }); } } // Vampire animation vampireGraphics.scaleX = 0.8 + Math.sin(LK.ticks * 0.4) * 0.1; vampireGraphics.scaleY = 0.8 + Math.cos(LK.ticks * 0.3) * 0.1; }; return self; }); var Vampire2 = Container.expand(function () { var self = Container.call(this); var vampire2Graphics = self.attachAsset('vampire2', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 4; // Fast vampire self.update = function () { if (!isTwistedBloodMoon) return; // Find nearest NPC to kill var closestNPC = null; var closestDistance = Infinity; for (var i = 0; i < npcs.length; i++) { if (!npcs[i].inCabin && !npcs[i].killed) { var dx = npcs[i].x - self.x; var dy = npcs[i].y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance < closestDistance) { closestDistance = distance; closestNPC = npcs[i]; } } } // Move towards closest NPC if (closestNPC) { var dx = closestNPC.x - self.x; var dy = closestNPC.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 0) { self.x += dx / distance * self.speed; self.y += dy / distance * self.speed; } // Kill NPC if close enough if (distance < 50) { closestNPC.killed = true; tween(closestNPC, { alpha: 0, scaleX: 0, scaleY: 0 }, { duration: 500, onFinish: function onFinish() { closestNPC.destroy(); npcs.splice(npcs.indexOf(closestNPC), 1); } }); } } // Vampire animation vampire2Graphics.scaleX = 0.8 + Math.sin(LK.ticks * 0.4) * 0.1; vampire2Graphics.scaleY = 0.8 + Math.cos(LK.ticks * 0.3) * 0.1; }; return self; }); var Wendigo = Container.expand(function () { var self = Container.call(this); // Create a scary looking wendigo using a dark red box shape var wendigoGraphics = self.attachAsset('wendigoBody', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 3; self.lastFoxX = 0; self.lastFoxY = 0; self.update = function () { if (!isBloodMoon || isTwistedBloodMoon) return; if (self.stunned && LK.ticks < self.stunnedUntil) { // Wendigo is stunned, can't move return; } else if (self.stunned) { // Stun expired, remove stun self.stunned = false; tween(wendigoGraphics, { tint: 0xFFFFFF }, { duration: 300 }); } // Check for dog collision for stunning for (var d = 0; d < npcs.length; d++) { if (npcs[d].type === 'dog' && npcs[d].isTargeted && self.intersects(npcs[d])) { npcs[d].stunThreat(self); break; } } // Calculate survival time and increase speed accordingly var survivalTime = (LK.ticks - bloodMoonStartTime) / 60; // Convert to seconds var currentSpeed = self.speed + survivalTime * wendigoSpeedIncreaseRate; // Wendigo targeting with probability system var target = null; var availableTargets = []; // Check for frozen NPC first (always highest priority) for (var i = 0; i < npcs.length; i++) { if (npcs[i].frozen && !npcs[i].killed) { target = npcs[i]; break; } } // If no frozen NPC, use probability system if (!target) { // Create weighted target list based on probabilities for (var i = 0; i < npcs.length; i++) { var npc = npcs[i]; if (!npc.inCabin && !npc.killed) { var weight = 0; if (npc.type === 'cat' || npc.type === 'bunny' || npc.type === 'squirrel') { weight = 25; // Common NPCs 25% } else if (npc.type === 'mouse') { weight = 10; // Mouse 10% } else if (npc.type === 'fennec') { weight = 20; // Fennec 20% } else if (npc.type === 'dog') { weight = 50; // Dog 50% } else if (npc.type === 'deer') { weight = 30; // Deer 30% } // Add multiple entries based on weight for probability for (var w = 0; w < weight; w++) { availableTargets.push(npc); } } } // Select random target from weighted list if (availableTargets.length > 0) { target = availableTargets[Math.floor(Math.random() * availableTargets.length)]; target.isTargeted = true; // Mark target as targeted } } if (!target) { target = fox; } if (!target) return; // Move towards target var dx = target.x - self.x; var dy = target.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); // Start wendigo chase music if targeting fox and close enough if (target === fox && distance < 400 && !isWendigoChaseThemePlaying) { isWendigoChaseThemePlaying = true; LK.stopMusic(); LK.playMusic('wendigoChaseTheme'); } else if ((target !== fox || distance >= 500) && isWendigoChaseThemePlaying) { // Stop chase music if not targeting fox or far away isWendigoChaseThemePlaying = false; LK.stopMusic(); LK.playMusic('bloodMoonMusic'); } if (distance > 0) { // Normalize direction and apply increasing speed self.x += dx / distance * currentSpeed; self.y += dy / distance * currentSpeed; } // Check if wendigo caught frozen NPC for (var i = 0; i < npcs.length; i++) { var npc = npcs[i]; if (npc.frozen && !npc.killed && self.intersects(npc)) { // Attack the NPC (dogs take 2 hits, others die in 1) var isKilled = npc.takeDamage(); if (isKilled) { npc.killed = true; // Make NPC disappear with death effect tween(npc, { alpha: 0, scaleX: 0, scaleY: 0 }, { duration: 500, onFinish: function onFinish() { npc.destroy(); npcs.splice(npcs.indexOf(npc), 1); } }); } // Play kill sound LK.getSound('wendigoGrowl').play(); break; } } // Check if wendigo caught the fox if (self.intersects(fox)) { // Fox is caught - create jumpscare effect LK.effects.flashScreen(0xffffff, 500); // Scale wendigo up for jumpscare tween(wendigo, { scaleX: 3, scaleY: 3 }, { duration: 200 }); // Play jumpscare sound LK.getSound('wendigoGrowl').play(); // Decrease player lives playerLives--; updateLivesDisplay(); // Show scary game over after jumpscare LK.setTimeout(function () { if (playerLives <= 0) { LK.showGameOver(); } else { // Respawn fox at safe location fox.x = 1024; fox.y = 1366; // End blood moon early when player gets caught isBloodMoon = false; startDay(); } }, 1000); return; } // Add scary breathing/pulsing effect wendigoGraphics.scaleX = 1 + Math.sin(LK.ticks * 0.2) * 0.1; wendigoGraphics.scaleY = 1 + Math.cos(LK.ticks * 0.2) * 0.1; }; return self; }); var Wolf = Container.expand(function () { var self = Container.call(this); var wolfGraphics = self.attachAsset('wolf', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 2; self.update = function () { if (!isNight) return; if (self.stunned && LK.ticks < self.stunnedUntil) { // Wolf is stunned, can't move return; } else if (self.stunned) { // Stun expired, remove stun self.stunned = false; tween(wolfGraphics, { tint: 0xFFFFFF }, { duration: 300 }); } // Check for dog collision for stunning for (var d = 0; d < npcs.length; d++) { if (npcs[d].type === 'dog' && npcs[d].isTargeted && self.intersects(npcs[d])) { npcs[d].stunThreat(self); break; } } // Find closest target (fox or NPCs) var closestTarget = null; var closestDistance = Infinity; var detectionRange = 400; // Wolves only chase when within 400 pixels // Check distance to fox var foxDx = fox.x - self.x; var foxDy = fox.y - self.y; var foxDistance = Math.sqrt(foxDx * foxDx + foxDy * foxDy); if (foxDistance < detectionRange && foxDistance < closestDistance) { closestTarget = fox; closestDistance = foxDistance; } // Check distance to NPCs that are not in cabin for (var n = 0; n < npcs.length; n++) { if (!npcs[n].inCabin && !npcs[n].killed) { var npcDx = npcs[n].x - self.x; var npcDy = npcs[n].y - self.y; var npcDistance = Math.sqrt(npcDx * npcDx + npcDy * npcDy); if (npcDistance < detectionRange && npcDistance < closestDistance) { closestTarget = npcs[n]; closestDistance = npcDistance; } } } // Only chase if there's a target within range if (closestTarget && closestDistance < detectionRange) { // Start chase music if not already playing and wolf is chasing fox if (!isChaseThemePlaying && closestTarget === fox) { isChaseThemePlaying = true; LK.stopMusic(); LK.playMusic('chaseTheme'); } var dx = closestTarget.x - self.x; var dy = closestTarget.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 0) { self.x += dx / distance * self.speed; self.y += dy / distance * self.speed; } } else { // Check if we should stop chase music if (isChaseThemePlaying) { var anyWolfChasing = false; for (var wc = 0; wc < wolves.length; wc++) { if (wolves[wc] !== self) { var foxDist = Math.sqrt(Math.pow(fox.x - wolves[wc].x, 2) + Math.pow(fox.y - wolves[wc].y, 2)); if (foxDist < detectionRange) { anyWolfChasing = true; break; } } } if (!anyWolfChasing) { isChaseThemePlaying = false; LK.stopMusic(); if (isPeacefulNight) { LK.playMusic('peacefulNightAmbience'); } else { LK.playMusic('nightMusic'); } } } // Add prowling animation when not chasing wolfGraphics.scaleX = 1 + Math.sin(LK.ticks * 0.1) * 0.1; // 50% chance to target a berry and wait there if (!self.berryTarget && !self.wanderTarget && Math.random() < 0.01) { if (Math.random() < 0.5 && normalBerries.length > 0) { // 50% chance to target a berry self.berryTarget = normalBerries[Math.floor(Math.random() * normalBerries.length)]; } else { // Otherwise wander normally self.wanderTarget = { x: Math.random() * (1800 - 200) + 200, y: Math.random() * (2400 - 200) + 200 }; } } // Move towards berry target and wait there if (self.berryTarget) { // Check if berry still exists var berryExists = false; for (var b = 0; b < normalBerries.length; b++) { if (normalBerries[b] === self.berryTarget) { berryExists = true; break; } } if (!berryExists) { // Berry was collected, pick a new target self.berryTarget = null; } else { var berryDx = self.berryTarget.x - self.x; var berryDy = self.berryTarget.y - self.y; var berryDistance = Math.sqrt(berryDx * berryDx + berryDy * berryDy); if (berryDistance > 100) { // Move towards berry var berrySpeed = self.speed * 0.4; self.x += berryDx / berryDistance * berrySpeed; self.y += berryDy / berryDistance * berrySpeed; } // If close enough to berry (within 100 pixels), just wait there } } // Wandering behavior when not targeting berry or chasing if (!self.berryTarget && self.wanderTarget) { var wanderDx = self.wanderTarget.x - self.x; var wanderDy = self.wanderTarget.y - self.y; var wanderDistance = Math.sqrt(wanderDx * wanderDx + wanderDy * wanderDy); if (wanderDistance > 50) { // Only move if not close to target var wanderSpeed = self.speed * 0.3; // Slower wandering speed self.x += wanderDx / wanderDistance * wanderSpeed; self.y += wanderDy / wanderDistance * wanderSpeed; } else { // Reached wander target, pick a new one self.wanderTarget = null; } } } // Check if wolf caught the fox for jumpscare if (self.intersects(fox)) { // Wolf jumpscare effect LK.effects.flashScreen(0xffffff, 300); // Scale wolf up for jumpscare tween(self, { scaleX: 2.5, scaleY: 2.5 }, { duration: 150 }); // Play wolf roar sound LK.getSound('wolfRoar').play(); // Decrease player lives playerLives--; updateLivesDisplay(); // Check if game over or respawn LK.setTimeout(function () { if (playerLives <= 0) { LK.showGameOver(); } else { // Respawn fox at safe location fox.x = 1024; fox.y = 1366; // Remove this wolf self.destroy(); wolves.splice(wolves.indexOf(self), 1); } }, 800); return; } }; return self; }); var Wood = Container.expand(function () { var self = Container.call(this); var woodGraphics = self.attachAsset('wood', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { // Gentle floating animation self.y += Math.sin(LK.ticks * 0.1 + self.x * 0.01) * 0.5; }; return self; }); var Zombie = Container.expand(function () { var self = Container.call(this); var zombieGraphics = self.attachAsset('zombie', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 1; // Slow zombie self.update = function () { if (!isNight && !isBloodMoon && !isTwistedBloodMoon) return; // Check if close enough to fox to trigger chase music var dx = fox.x - self.x; var dy = fox.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); // Start zombie chase music if close to fox (within 300 pixels) if (distance < 300 && !isZombieChaseThemePlaying) { isZombieChaseThemePlaying = true; LK.stopMusic(); LK.playMusic('zombieChaseTheme'); } else if (distance >= 400 && isZombieChaseThemePlaying) { // Stop chase music if far from fox isZombieChaseThemePlaying = false; LK.stopMusic(); if (isTwistedBloodMoon) { LK.playMusic('twistedBloodMoonTheme'); } else if (isBloodMoon) { LK.playMusic('bloodMoonMusic'); } else if (isNight) { LK.playMusic('nightMusic'); } } // Move towards fox slowly if (distance > 0) { self.x += dx / distance * self.speed; self.y += dy / distance * self.speed; } // Check collision with fox if (self.intersects(fox)) { // Zombie caught fox LK.effects.flashScreen(0x00FF00, 300); playerLives--; updateLivesDisplay(); LK.setTimeout(function () { if (playerLives <= 0) { LK.showGameOver(); } else { // Respawn fox at safe location fox.x = 1024; fox.y = 1366; // Remove this zombie self.destroy(); zombies.splice(zombies.indexOf(self), 1); } }, 800); return; } // Zombie animation zombieGraphics.scaleX = 0.7 + Math.sin(LK.ticks * 0.2) * 0.05; zombieGraphics.scaleY = 0.7 + Math.cos(LK.ticks * 0.15) * 0.05; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x228b22 }); /**** * Game Code ****/ // Game state variables var fox; var normalBerries = []; var wolves = []; var npcs = []; var dragNode = null; var berrySpawnTimer = 0; var wendigo; var wendigoSpeedIncreaseRate = 0.02; var bunny; var cabin; // Day/Night cycle variables var isNight = false; var isBloodMoon = false; var isPeacefulNight = false; var isTwistedBloodMoon = false; var vampires = []; var vampires2 = []; var zombies = []; var nightCount = 0; var dayCount = 1; var berriesCollectedInCycle = 0; var scoreMultiplier = 1; var bloodMoonStartTime = 0; var bloodMoonCount = 0; var dayLengthMultiplier = 1; var isChaseThemePlaying = false; var isZombieChaseThemePlaying = false; var isWendigoChaseThemePlaying = false; var playerLives = 3; var campfire; var woodItems = []; var lastBloodMoonNight = -1; // Track when last blood moon occurred // NPC types organized by rarity var commonNPCs = ['cat', 'bunny', 'squirrel']; var uncommonNPCs = ['deer', 'fennec']; var rareNPCs = ['dog', 'mouse']; // Add forest background var background = game.attachAsset('forestBackground', { x: 0, y: 0 }); // Create score display var scoreTxt = new Text2('Score: 0 (x1)', { size: 80, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Create day/night indicator var dayNightTxt = new Text2('Day', { size: 60, fill: 0xFFFF00 }); dayNightTxt.anchor.set(0.5, 0); dayNightTxt.y = 100; LK.gui.top.addChild(dayNightTxt); // Create day counter display var dayCounterTxt = new Text2('Day 1', { size: 60, fill: 0xFFFFFF }); dayCounterTxt.anchor.set(0.5, 0); dayCounterTxt.y = 170; LK.gui.top.addChild(dayCounterTxt); // Create lives counter display var livesTxt = new Text2('Lives: 3', { size: 60, fill: 0xFF0000 }); livesTxt.anchor.set(0.5, 0); livesTxt.y = 240; LK.gui.top.addChild(livesTxt); // Create campfire wood counter display var campfireTxt = new Text2('Campfire: 0 wood', { size: 50, fill: 0xFFFFFF }); campfireTxt.anchor.set(0.5, 0); campfireTxt.y = 310; campfireTxt.visible = false; // Hidden by default LK.gui.top.addChild(campfireTxt); // Add cabin for NPCs cabin = game.attachAsset('cabin', { anchorX: 0.5, anchorY: 0.5, x: 1650, y: 450 }); // Add campfire campfire = game.addChild(new Campfire()); campfire.x = 1024; campfire.y = 1000; // Bunny removed from initial spawn // Initialize fox fox = game.addChild(new Fox()); fox.x = 1024; fox.y = 1366; // Spawn normal berry function function spawnNormalBerry() { var berriesSpawned = 1; var maxBerries = 4; // Spawn first berry var berry = new NormalBerry(); berry.x = Math.random() * (2048 - 120) + 60; berry.y = Math.random() * (2732 - 120) + 60; normalBerries.push(berry); game.addChild(berry); // During night, don't spawn extra berries if (!isNight) { // Check for additional berries (25% chance each, max 4 total) - only during day while (berriesSpawned < maxBerries && Math.random() < 0.25) { var extraBerry = new NormalBerry(); extraBerry.x = Math.random() * (2048 - 120) + 60; extraBerry.y = Math.random() * (2732 - 120) + 60; normalBerries.push(extraBerry); game.addChild(extraBerry); berriesSpawned++; } } } // Spawn wolf function function spawnWolf() { var wolf = new Wolf(); wolf.x = Math.random() * (2048 - 120) + 60; wolf.y = Math.random() * (2732 - 120) + 60; wolves.push(wolf); game.addChild(wolf); } // Spawn wood function function spawnWood() { var wood = new Wood(); wood.x = Math.random() * (2048 - 120) + 60; wood.y = Math.random() * (2732 - 120) + 60; woodItems.push(wood); game.addChild(wood); } // Spawn zombie function function spawnZombie() { var zombie = new Zombie(); zombie.x = Math.random() * (2048 - 120) + 60; zombie.y = Math.random() * (2732 - 120) + 60; zombies.push(zombie); game.addChild(zombie); } // Spawn vampire function function spawnVampire() { var vampire = new Vampire(); vampire.x = Math.random() * (2048 - 120) + 60; vampire.y = Math.random() * (2732 - 120) + 60; vampires.push(vampire); game.addChild(vampire); } // Spawn vampire2 function function spawnVampire2() { var vampire2 = new Vampire2(); vampire2.x = Math.random() * (2048 - 120) + 60; vampire2.y = Math.random() * (2732 - 120) + 60; vampires2.push(vampire2); game.addChild(vampire2); } // Update campfire display function updateCampfireDisplay() { campfireTxt.setText('Campfire: ' + campfire.wood + ' wood'); } // Spawn NPC function function spawnNPC() { // Determine rarity first with updated probabilities var rarity; var selectedType; var rarityRand = Math.random(); if (rarityRand <= 0.5) { // Common NPCs: 50% chance rarity = 'common'; selectedType = commonNPCs[Math.floor(Math.random() * commonNPCs.length)]; } else if (rarityRand <= 0.85) { // Uncommon NPCs: 35% chance rarity = 'uncommon'; selectedType = uncommonNPCs[Math.floor(Math.random() * uncommonNPCs.length)]; } else { // Rare NPCs: 15% chance rarity = 'rare'; selectedType = rareNPCs[Math.floor(Math.random() * rareNPCs.length)]; } var npc = new NPC(selectedType); npc.rarity = rarity; npc.setRarityVisual(); // Apply visual indication based on rarity npc.x = Math.random() * (1800 - 200) + 200; npc.y = Math.random() * (2400 - 200) + 200; npcs.push(npc); game.addChild(npc); } // Transition to night function startNight() { isNight = true; nightCount++; berriesCollectedInCycle = 0; // Check for blood moon - 3rd night is guaranteed, then 25% chance (but not consecutive) var shouldBeBloodMoon = false; if (nightCount === 3) { // 3rd night is always a blood moon shouldBeBloodMoon = true; } else if (nightCount > 3 && nightCount !== lastBloodMoonNight + 1) { // After 3rd night, 25% chance for blood moon, but not if last night was blood moon shouldBeBloodMoon = Math.random() < 0.25; } // Check for peaceful night - 25% base chance, 75% chance after blood moon var peacefulChance = 0.25; if (nightCount > 3 && shouldBeBloodMoon) { // If next night will be blood moon, increase peaceful chance to 75% peacefulChance = 0.75; } isPeacefulNight = Math.random() < peacefulChance; // Only play howl if not peaceful night if (!isPeacefulNight) { LK.getSound('howl').play(); } // Stop any currently playing music and switch to appropriate night music LK.stopMusic(); if (shouldBeBloodMoon) { LK.playMusic('bloodMoonMusic'); } else if (isPeacefulNight) { LK.playMusic('peacefulNightAmbience'); } else { LK.playMusic('nightMusic'); } if (shouldBeBloodMoon) { bloodMoonCount++; lastBloodMoonNight = nightCount; // Track when blood moon occurred // Add 5 berries to requirement for each blood moon dayLengthMultiplier = 1 + bloodMoonCount * 0.5; // Each blood moon adds 5 berries (0.5 * 10 = 5) isBloodMoon = true; bloodMoonStartTime = LK.ticks; // Reset multiplier during blood moon scoreMultiplier = 1; updateScoreDisplay(); // Freeze one random NPC if (npcs.length > 0) { var randomNPC = npcs[Math.floor(Math.random() * npcs.length)]; randomNPC.freeze(); } // Move other NPCs to cabin for (var i = 0; i < npcs.length; i++) { if (!npcs[i].frozen) { npcs[i].enterCabin(); } } // Spawn wendigo only if not twisted blood moon if (!isTwistedBloodMoon) { wendigo = new Wendigo(); wendigo.x = -100; wendigo.y = Math.random() * 2000 + 300; game.addChild(wendigo); } // Spawn zombies (50% chance for 3 zombies during blood moon) if (Math.random() < 0.5) { spawnZombie(); spawnZombie(); spawnZombie(); } // Spawn vampires during twisted blood moon if (isTwistedBloodMoon) { spawnVampire(); spawnVampire(); spawnVampire2(); spawnVampire2(); } // Change background to blood red game.setBackgroundColor(0x330000); tween(background, { tint: 0x660000, alpha: 0.8 }, { duration: 1500 }); dayNightTxt.setText('Blood Moon'); dayNightTxt.fill = 0xFF0000; } else { // Regular night if (!isPeacefulNight) { // Spawn wolves - 3 by default, reduced by 1 if fennec fox present var baseWolves = 3 + bloodMoonCount; // Add 1 wolf for each survived blood moon var fennecPresent = false; for (var f = 0; f < npcs.length; f++) { if (npcs[f].type === 'fennec') { fennecPresent = true; break; } } var wolvesToSpawn = fennecPresent ? baseWolves - 1 : baseWolves; for (var w = 0; w < wolvesToSpawn; w++) { spawnWolf(); } } // Move NPCs to cabin (even during peaceful nights) for (var i = 0; i < npcs.length; i++) { npcs[i].enterCabin(); } // Change background to dark blue night game.setBackgroundColor(0x001122); tween(background, { tint: 0x223355, alpha: 0.7 }, { duration: 1500 }); if (isPeacefulNight) { dayNightTxt.setText('Peaceful Night'); dayNightTxt.fill = 0x99CCFF; } else { dayNightTxt.setText('Night'); dayNightTxt.fill = 0x6666FF; } // Show wood counter during night campfireTxt.visible = true; updateCampfireDisplay(); // Spawn wood during night (3-5 pieces) var woodToSpawn = Math.floor(Math.random() * 3) + 3; for (var w = 0; w < woodToSpawn; w++) { spawnWood(); } // Spawn zombies (25% chance for 2 zombies) if (Math.random() < 0.25) { spawnZombie(); spawnZombie(); } } } // Transition to day function startDay() { isNight = false; isBloodMoon = false; isPeacefulNight = false; isChaseThemePlaying = false; berriesCollectedInCycle = 0; // Stop any currently playing music and switch to day music LK.stopMusic(); LK.playMusic('dayMusic'); // Remove wolves for (var i = 0; i < wolves.length; i++) { wolves[i].destroy(); } wolves = []; // Remove wendigo if exists if (wendigo) { wendigo.destroy(); wendigo = null; } // Hide wood counter during day campfireTxt.visible = false; // Remove remaining wood items for (var i = 0; i < woodItems.length; i++) { woodItems[i].destroy(); } woodItems = []; // Remove zombies for (var i = 0; i < zombies.length; i++) { zombies[i].destroy(); } zombies = []; // Remove vampires for (var i = 0; i < vampires.length; i++) { vampires[i].destroy(); } vampires = []; // Remove vampires2 for (var i = 0; i < vampires2.length; i++) { vampires2[i].destroy(); } vampires2 = []; // Reset twisted blood moon state isTwistedBloodMoon = false; // Bring NPCs out of cabin for (var i = 0; i < npcs.length; i++) { if (!npcs[i].killed) { npcs[i].exitCabin(); } } // Spawn new NPC with 25% chance if (Math.random() < 0.25) { spawnNPC(); } // Change background back to day game.setBackgroundColor(0x228b22); tween(background, { tint: 0xFFFFFF, alpha: 1 }, { duration: 1500 }); dayNightTxt.setText('Day'); dayNightTxt.fill = 0xFFFF00; // Update day counter dayCount++; dayCounterTxt.setText('Day ' + dayCount); } // Update score display with multiplier function updateScoreDisplay() { scoreTxt.setText('Score: ' + LK.getScore() + ' (x' + scoreMultiplier + ')'); } // Update lives display function updateLivesDisplay() { livesTxt.setText('Lives: ' + playerLives); } // Keyboard state tracking var keys = { left: false, right: false, up: false, down: false }; // Handle mouse/touch move function handleMove(x, y, obj) { if (dragNode) { dragNode.x = x; dragNode.y = y; // Keep fox within bounds if (dragNode.x < 60) dragNode.x = 60; if (dragNode.x > 1988) dragNode.x = 1988; if (dragNode.y < 60) dragNode.y = 60; if (dragNode.y > 2672) dragNode.y = 2672; } } // Mouse/touch events game.move = handleMove; game.down = function (x, y, obj) { dragNode = fox; handleMove(x, y, obj); }; game.up = function (x, y, obj) { dragNode = null; }; // Start with day music LK.playMusic('dayMusic'); // Initial berry spawning spawnNormalBerry(); spawnNormalBerry(); spawnNormalBerry(); // Main game update loop game.update = function () { // Spawn berries over time with random intervals - slower at night berrySpawnTimer++; var baseSpawnTime = isNight ? 180 : 90; // Night: 3-8 seconds, Day: 1.5-5 seconds var maxSpawnTime = isNight ? 480 : 300; var randomSpawnTime = Math.random() * (maxSpawnTime - baseSpawnTime) + baseSpawnTime; if (berrySpawnTimer >= randomSpawnTime) { spawnNormalBerry(); berrySpawnTimer = 0; } // Check collisions with normal berries for (var i = normalBerries.length - 1; i >= 0; i--) { var berry = normalBerries[i]; if (fox.intersects(berry)) { // Collect berry and increase score with multiplier var scoreGain = 1 * scoreMultiplier; LK.setScore(LK.getScore() + scoreGain); berriesCollectedInCycle++; updateScoreDisplay(); LK.getSound('berryCollect').play(); // Remove berry from array first, then destroy normalBerries.splice(i, 1); berry.destroy(); // Check for day/night transitions var dayRequirement = 10 * dayLengthMultiplier; var nightRequirement = isBloodMoon ? dayRequirement : 5; if (!isNight && berriesCollectedInCycle >= dayRequirement) { startNight(); } else if (isNight && berriesCollectedInCycle >= nightRequirement) { startDay(); } } } // Check collisions with wood items for (var i = woodItems.length - 1; i >= 0; i--) { var wood = woodItems[i]; if (fox.intersects(wood)) { // Collect wood and add to campfire campfire.addWood(1); LK.getSound('berryCollect').play(); // Reuse berry collect sound // Remove wood from array first, then destroy woodItems.splice(i, 1); wood.destroy(); } } // Check collisions with NPCs for score multiplier for (var i = 0; i < npcs.length; i++) { var npc = npcs[i]; if (!npc.inCabin && !npc.frozen && fox.intersects(npc)) { // Play touch sound for the specific animal type LK.getSound(npc.type + 'Touch').play(); // Only mouse gives 4x multiplier, cat/bunny/squirrel give 2x, others give no multiplier if (npc.type === 'mouse') { // Mouse gives 4x multiplier scoreMultiplier = 4; updateScoreDisplay(); } else if (npc.type === 'cat' || npc.type === 'bunny' || npc.type === 'squirrel') { // Common NPCs (cat, bunny, squirrel) give 2x multiplier scoreMultiplier = 2; updateScoreDisplay(); } // deer, fennec, dog don't give any multiplier // Give visual feedback tween(npc, { scaleX: 1.5, scaleY: 1.5 }, { duration: 200, onFinish: function onFinish() { tween(npc, { scaleX: 1, scaleY: 1 }, { duration: 200 }); } }); } } // Wolf collision is now handled in Wolf class update method };
===================================================================
--- original.js
+++ change.js
@@ -466,8 +466,62 @@
vampireGraphics.scaleY = 0.8 + Math.cos(LK.ticks * 0.3) * 0.1;
};
return self;
});
+var Vampire2 = Container.expand(function () {
+ var self = Container.call(this);
+ var vampire2Graphics = self.attachAsset('vampire2', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 4; // Fast vampire
+ self.update = function () {
+ if (!isTwistedBloodMoon) return;
+ // Find nearest NPC to kill
+ var closestNPC = null;
+ var closestDistance = Infinity;
+ for (var i = 0; i < npcs.length; i++) {
+ if (!npcs[i].inCabin && !npcs[i].killed) {
+ var dx = npcs[i].x - self.x;
+ var dy = npcs[i].y - self.y;
+ var distance = Math.sqrt(dx * dx + dy * dy);
+ if (distance < closestDistance) {
+ closestDistance = distance;
+ closestNPC = npcs[i];
+ }
+ }
+ }
+ // Move towards closest NPC
+ if (closestNPC) {
+ var dx = closestNPC.x - self.x;
+ var dy = closestNPC.y - self.y;
+ var distance = Math.sqrt(dx * dx + dy * dy);
+ if (distance > 0) {
+ self.x += dx / distance * self.speed;
+ self.y += dy / distance * self.speed;
+ }
+ // Kill NPC if close enough
+ if (distance < 50) {
+ closestNPC.killed = true;
+ tween(closestNPC, {
+ alpha: 0,
+ scaleX: 0,
+ scaleY: 0
+ }, {
+ duration: 500,
+ onFinish: function onFinish() {
+ closestNPC.destroy();
+ npcs.splice(npcs.indexOf(closestNPC), 1);
+ }
+ });
+ }
+ }
+ // Vampire animation
+ vampire2Graphics.scaleX = 0.8 + Math.sin(LK.ticks * 0.4) * 0.1;
+ vampire2Graphics.scaleY = 0.8 + Math.cos(LK.ticks * 0.3) * 0.1;
+ };
+ return self;
+});
var Wendigo = Container.expand(function () {
var self = Container.call(this);
// Create a scary looking wendigo using a dark red box shape
var wendigoGraphics = self.attachAsset('wendigoBody', {
@@ -909,8 +963,9 @@
var isBloodMoon = false;
var isPeacefulNight = false;
var isTwistedBloodMoon = false;
var vampires = [];
+var vampires2 = [];
var zombies = [];
var nightCount = 0;
var dayCount = 1;
var berriesCollectedInCycle = 0;
@@ -1044,8 +1099,16 @@
vampire.y = Math.random() * (2732 - 120) + 60;
vampires.push(vampire);
game.addChild(vampire);
}
+// Spawn vampire2 function
+function spawnVampire2() {
+ var vampire2 = new Vampire2();
+ vampire2.x = Math.random() * (2048 - 120) + 60;
+ vampire2.y = Math.random() * (2732 - 120) + 60;
+ vampires2.push(vampire2);
+ game.addChild(vampire2);
+}
// Update campfire display
function updateCampfireDisplay() {
campfireTxt.setText('Campfire: ' + campfire.wood + ' wood');
}
@@ -1147,8 +1210,10 @@
// Spawn vampires during twisted blood moon
if (isTwistedBloodMoon) {
spawnVampire();
spawnVampire();
+ spawnVampire2();
+ spawnVampire2();
}
// Change background to blood red
game.setBackgroundColor(0x330000);
tween(background, {
@@ -1246,8 +1311,13 @@
for (var i = 0; i < vampires.length; i++) {
vampires[i].destroy();
}
vampires = [];
+ // Remove vampires2
+ for (var i = 0; i < vampires2.length; i++) {
+ vampires2[i].destroy();
+ }
+ vampires2 = [];
// Reset twisted blood moon state
isTwistedBloodMoon = false;
// Bring NPCs out of cabin
for (var i = 0; i < npcs.length; i++) {
a cute fox with a basket. In-Game asset. 2d. High contrast. No shadows
a berry bush with a phew yummy berries on it. In-Game asset. 2d. High contrast. No shadows
a top view of a grass field with a cabin and some trees. In-Game asset. 2d. High contrast. No shadows
a cute little bunny. In-Game asset. 2d. High contrast. No shadows
cabin. In-Game asset. 2d. High contrast. No shadows
a angry wolve thats in 2d. In-Game asset. 2d. High contrast. No shadows
a cute cat with a bow. In-Game asset. 2d. High contrast. No shadows
a cute dear with an axe. In-Game asset. 2d. High contrast. No shadows
a dog cute dog with a hat and a shotgun. In-Game asset. 2d. High contrast. No shadows
a cute mouse with a hoodie on. In-Game asset. 2d. High contrast. No shadows
a cute fennec fox with a backbag. In-Game asset. 2d. High contrast. No shadows
a cute squirrel with a gutair. In-Game asset. 2d. High contrast. No shadows
a campfire. In-Game asset. 2d. High contrast. No shadows
sticks. In-Game asset. 2d. High contrast. No shadows
zombie duck. In-Game asset. 2d. High contrast. No shadows
cultists animal. In-Game asset. 2d. High contrast. No shadows
cultist girrafe. In-Game asset. 2d. High contrast. No shadows
cute nice bat cultist. In-Game asset. 2d. High contrast. No shadows
glitchSound
Sound effect
berryCollect
Sound effect
wendigoGrowl
Sound effect
wolfRoar
Sound effect
howl
Sound effect
dayMusic
Music
nightMusic
Music
bloodMoonMusic
Music
chaseTheme
Music
bunnyTouch
Sound effect
bunnyKill
Sound effect
catTouch
Sound effect
catKill
Sound effect
deerTouch
Sound effect
deerKill
Sound effect
dogTouch
Sound effect
dogKill
Sound effect
fennecTouch
Sound effect
fennecKill
Sound effect
mouseTouch
Sound effect
mouseKill
Sound effect
squirrelTouch
Sound effect
squirrelKill
Sound effect
peacefulNightAmbience
Music
twistedBloodMoonTheme
Music
wendigoChaseTheme
Music
zombieChaseTheme
Music
woodCollect
Sound effect
vampireJumpscare
Sound effect
dogStun
Sound effect
catWoodCollect
Sound effect
foxTwistedWoodCollect
Sound effect
batTouch
Sound effect
batKill
Sound effect