User prompt
all of the npcs are in these rarities common:(cat,bunny,(a new one)squirrel) uncommon:(deer and (a new one) fennec fox) rare:(dog and mouse
User prompt
can you also add rarities the rarities are :common(50%),uncommon(35%)rare(15%)
User prompt
can you make it when theres a dog npc he has to get hit 2 times instead of 1 and stays out when the wendigo or wolfs show up he stuns 1 of the wolves for 5 seconds or the wendigo for 3 seconds and runs back during this time hes targeted ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
also let the berrys spawn 1.5-5 seconds
User prompt
make the night and day be able to longer so multiplie it by 2 every blood moon (so the fourth day takes 20 berries to complete after the first bloodmoon) and also it doesnt have to apear each 3 days it can also apear later but bloodmoons can only apear after day 3 also let berrys spawn less often
User prompt
can you make berries spawn more often
User prompt
make the night different looking than the bloodmoon also add a jumpscare for the wolves and a wolve roar ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'TypeError: Cannot set properties of undefined (setting 'fill')' in or related to this line: 'dayNightTxt.style.fill = 0x4444FF;' Line Number: 404
User prompt
no on the background theres a cabin put the cabin on there
User prompt
its not on the cabin in the map
User prompt
can you move the cabin onto the cabin on the map please
User prompt
can you remove the glitched berry and add a night system where every 10 berries you collect it turns night and wolves attack then when you collect 5 berries during night it turns day again also remove the inventory every 3 nights it turns into a blood moon where the wendigo spawns every night theres a chance that a new npc spawns the npcs are : a bunny, a deer, a mouse, a dog and a cat every npc gives a score multiplier of 2x accept the mouse wich gives a multiplier of 3x each time you collect a berry the mouse is the rarest and the multiplier cant be higher than 4x also each blood moon 1 of the npcs goes into a frozen state and gets killed by the wendigo while the rest goes into the cabin the multiplier also goes back to 1x when its blood moon and you need to collect 10 berries not 5 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
when the wendigo appears can you make the bunny not move then the wendigo KILLS the bunny and goes after you
User prompt
the inventory counter and score counter dont go up the glitched berry isnt here( you can delete the inventory)
User prompt
i still cant collect any berries
User prompt
uhm i cant collect any berries even if i dont have any in my inventory
User prompt
no can you make a bunny sprite in assets
User prompt
make the bunny move and not scary ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
make an inventory where you can only hold 5 berries but if you give 10 berries to a bunny your inventory increases by 1 ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
make the wendigo go faster the longer you survive ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
make the wendigo not spin
User prompt
can you also fix the bug where the fox cant move and make the background scary when the wendigo apears also add a jumpscare + a jumpscare sound when the wendigo touches you ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
can you also let the red disepear when the glitch happens it wont go away
User prompt
can you make it when the fox touches the glitched berry he gets transported to a world where a wendigo monster chases him ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
yes please
/**** * 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 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; self.multiplier = type === 'mouse' ? 3 : 2; self.inCabin = false; self.frozen = false; var npcGraphics = self.attachAsset(type, { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { if (self.frozen || self.inCabin) return; // 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; tween(self, { x: cabin.x, y: cabin.y, 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; }; 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 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) return; // Calculate survival time and increase speed accordingly var survivalTime = (LK.ticks - bloodMoonStartTime) / 60; // Convert to seconds var currentSpeed = self.speed + survivalTime * wendigoSpeedIncreaseRate; // Target frozen NPC first, then fox var target = null; for (var i = 0; i < npcs.length; i++) { if (npcs[i].frozen && !npcs[i].killed) { target = npcs[i]; break; } } 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); 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)) { // Kill the NPC 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(); // Show scary game over after jumpscare LK.setTimeout(function () { LK.showGameOver(); }, 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; // Chase fox during night var dx = fox.x - self.x; var dy = fox.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; } // Add prowling animation wolfGraphics.scaleX = 1 + Math.sin(LK.ticks * 0.1) * 0.1; }; 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 nightCount = 0; var berriesCollectedInCycle = 0; var scoreMultiplier = 1; var bloodMoonStartTime = 0; // NPC spawn chances (mouse is rarest) var npcTypes = ['bunny', 'deer', 'dog', 'cat', 'mouse']; var npcSpawnChances = [0.3, 0.25, 0.25, 0.15, 0.05]; // 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); // Add cabin for NPCs cabin = game.attachAsset('cabin', { anchorX: 0.5, anchorY: 0.5, x: 1700, y: 300 }); // Spawn bunny bunny = game.addChild(new Bunny()); bunny.x = 200; bunny.y = 200; // Initialize fox fox = game.addChild(new Fox()); fox.x = 1024; fox.y = 1366; // Spawn normal berry function function spawnNormalBerry() { var berry = new NormalBerry(); berry.x = Math.random() * (2048 - 120) + 60; berry.y = Math.random() * (2732 - 120) + 60; normalBerries.push(berry); game.addChild(berry); } // 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 NPC function function spawnNPC() { var rand = Math.random(); var cumulativeChance = 0; var selectedType = 'bunny'; for (var i = 0; i < npcTypes.length; i++) { cumulativeChance += npcSpawnChances[i]; if (rand <= cumulativeChance) { selectedType = npcTypes[i]; break; } } var npc = new NPC(selectedType); 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 (every 3 nights) if (nightCount % 3 === 0) { 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 wendigo = new Wendigo(); wendigo.x = -100; wendigo.y = Math.random() * 2000 + 300; game.addChild(wendigo); // Change background to blood red game.setBackgroundColor(0x330000); tween(background, { tint: 0x660000, alpha: 0.8 }, { duration: 1500 }); dayNightTxt.setText('Blood Moon'); dayNightTxt.style.fill = 0xFF0000; } else { // Regular night // Spawn wolves spawnWolf(); spawnWolf(); if (Math.random() < 0.5) spawnWolf(); // Move NPCs to cabin for (var i = 0; i < npcs.length; i++) { npcs[i].enterCabin(); } // Change background to dark game.setBackgroundColor(0x000033); tween(background, { tint: 0x333366, alpha: 0.9 }, { duration: 1500 }); dayNightTxt.setText('Night'); dayNightTxt.style.fill = 0x4444FF; } } // Transition to day function startDay() { isNight = false; isBloodMoon = false; berriesCollectedInCycle = 0; // Remove wolves for (var i = 0; i < wolves.length; i++) { wolves[i].destroy(); } wolves = []; // Remove wendigo if exists if (wendigo) { wendigo.destroy(); wendigo = null; } // Bring NPCs out of cabin for (var i = 0; i < npcs.length; i++) { if (!npcs[i].killed) { npcs[i].exitCabin(); } } // Spawn new NPC with chance if (Math.random() < 0.7) { spawnNPC(); } // Change background back to day game.setBackgroundColor(0x228b22); tween(background, { tint: 0xFFFFFF, alpha: 1 }, { duration: 1500 }); dayNightTxt.setText('Day'); dayNightTxt.style.fill = 0xFFFF00; } // Update score display with multiplier function updateScoreDisplay() { scoreTxt.setText('Score: ' + LK.getScore() + ' (x' + scoreMultiplier + ')'); } // 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; }; // Initial berry spawning spawnNormalBerry(); spawnNormalBerry(); spawnNormalBerry(); // Main game update loop game.update = function () { // Spawn berries over time berrySpawnTimer++; if (berrySpawnTimer >= 180) { // Every 3 seconds 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 if (!isNight && berriesCollectedInCycle >= 10) { startNight(); } else if (isNight && berriesCollectedInCycle >= (isBloodMoon ? 10 : 5)) { startDay(); } } } // 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)) { // Update multiplier but cap at 4x if (scoreMultiplier < 4) { scoreMultiplier = Math.min(4, scoreMultiplier + (npc.multiplier === 3 ? 1 : npc.multiplier === 2 ? 0.5 : 0)); if (npc.multiplier === 3) scoreMultiplier = Math.min(4, scoreMultiplier + 1); // Mouse gives +1 extra updateScoreDisplay(); } // Give visual feedback tween(npc, { scaleX: 1.5, scaleY: 1.5 }, { duration: 200, onFinish: function onFinish() { tween(npc, { scaleX: 1, scaleY: 1 }, { duration: 200 }); } }); } } // Check collisions with wolves (game over) for (var i = 0; i < wolves.length; i++) { var wolf = wolves[i]; if (fox.intersects(wolf)) { LK.effects.flashScreen(0xff0000, 1000); LK.getSound('wendigoGrowl').play(); LK.setTimeout(function () { LK.showGameOver(); }, 1000); return; } } };
===================================================================
--- original.js
+++ change.js
@@ -16,15 +16,8 @@
scaleY: 1.5
});
self.berriesGiven = 0;
self.update = function () {
- // Don't move if glitch mode is active (bunny is frozen in fear)
- if (isGlitched) {
- // Bunny is frozen in fear, just add subtle shaking
- self.x += (Math.random() - 0.5) * 2;
- self.y += (Math.random() - 0.5) * 2;
- return;
- }
// 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) {
@@ -49,24 +42,60 @@
anchorY: 0.5
});
return self;
});
-var GlitchedBerry = Container.expand(function () {
+var NPC = Container.expand(function (type) {
var self = Container.call(this);
- var berryGraphics = self.attachAsset('glitchedBerry', {
+ self.type = type;
+ self.multiplier = type === 'mouse' ? 3 : 2;
+ self.inCabin = false;
+ self.frozen = false;
+ var npcGraphics = self.attachAsset(type, {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
- // Erratic glitching movement
- berryGraphics.rotation += 0.2;
- berryGraphics.scaleX = 1 + Math.sin(LK.ticks * 0.3) * 0.3;
- berryGraphics.scaleY = 1 + Math.cos(LK.ticks * 0.3) * 0.3;
- if (LK.ticks % 10 === 0) {
- self.x += (Math.random() - 0.5) * 20;
- self.y += (Math.random() - 0.5) * 20;
+ if (self.frozen || self.inCabin) return;
+ // 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;
+ tween(self, {
+ x: cabin.x,
+ y: cabin.y,
+ 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;
+ };
return self;
});
var NormalBerry = Container.expand(function () {
var self = Container.call(this);
@@ -90,21 +119,24 @@
self.speed = 3;
self.lastFoxX = 0;
self.lastFoxY = 0;
self.update = function () {
- if (!isGlitched) return;
+ if (!isBloodMoon) return;
// Calculate survival time and increase speed accordingly
- var survivalTime = (LK.ticks - glitchModeStartTime) / 60; // Convert to seconds
+ var survivalTime = (LK.ticks - bloodMoonStartTime) / 60; // Convert to seconds
var currentSpeed = self.speed + survivalTime * wendigoSpeedIncreaseRate;
- // First target bunny if it's alive, then chase fox
- var target;
- if (bunny && bunny.alive !== false) {
- target = bunny;
- } else if (fox) {
+ // Target frozen NPC first, then fox
+ var target = null;
+ for (var i = 0; i < npcs.length; i++) {
+ if (npcs[i].frozen && !npcs[i].killed) {
+ target = npcs[i];
+ break;
+ }
+ }
+ if (!target) {
target = fox;
- } else {
- return;
}
+ 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);
@@ -112,35 +144,78 @@
// Normalize direction and apply increasing speed
self.x += dx / distance * currentSpeed;
self.y += dy / distance * currentSpeed;
}
- // Check if wendigo caught the bunny
- if (bunny && bunny.alive !== false && self.intersects(bunny)) {
- // Kill the bunny
- bunny.alive = false;
- // Make bunny disappear with death effect
- tween(bunny, {
- alpha: 0,
- scaleX: 0,
- scaleY: 0
- }, {
- duration: 500,
- onFinish: function onFinish() {
- if (bunny) {
- bunny.destroy();
- bunny = null;
+ // 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)) {
+ // Kill the NPC
+ 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 kill sound
+ // Play jumpscare sound
LK.getSound('wendigoGrowl').play();
+ // Show scary game over after jumpscare
+ LK.setTimeout(function () {
+ LK.showGameOver();
+ }, 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;
+ // Chase fox during night
+ var dx = fox.x - self.x;
+ var dy = fox.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;
+ }
+ // Add prowling animation
+ wolfGraphics.scaleX = 1 + Math.sin(LK.ticks * 0.1) * 0.1;
+ };
+ return self;
+});
/****
* Initialize Game
****/
@@ -153,41 +228,53 @@
****/
// Game state variables
var fox;
var normalBerries = [];
-var glitchedBerry;
+var wolves = [];
+var npcs = [];
var dragNode = null;
-var isGlitched = false;
var berrySpawnTimer = 0;
-var glitchedBerrySpawned = false;
var wendigo;
-var wendigoSpawned = false;
-var glitchModeStartTime = 0;
var wendigoSpeedIncreaseRate = 0.02;
-// Inventory system
-var inventory = storage.inventory || 0;
-var maxInventory = storage.maxInventory || 5;
var bunny;
+var cabin;
+// Day/Night cycle variables
+var isNight = false;
+var isBloodMoon = false;
+var nightCount = 0;
+var berriesCollectedInCycle = 0;
+var scoreMultiplier = 1;
+var bloodMoonStartTime = 0;
+// NPC spawn chances (mouse is rarest)
+var npcTypes = ['bunny', 'deer', 'dog', 'cat', 'mouse'];
+var npcSpawnChances = [0.3, 0.25, 0.25, 0.15, 0.05];
// Add forest background
var background = game.attachAsset('forestBackground', {
x: 0,
y: 0
});
// Create score display
-var scoreTxt = new Text2('Score: 0', {
+var scoreTxt = new Text2('Score: 0 (x1)', {
size: 80,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
-// Create inventory display - positioned below score to avoid platform menu overlap
-var inventoryTxt = new Text2('Inventory: 0/' + maxInventory, {
+// Create day/night indicator
+var dayNightTxt = new Text2('Day', {
size: 60,
- fill: 0xFFFFFF
+ fill: 0xFFFF00
});
-inventoryTxt.anchor.set(0.5, 0);
-inventoryTxt.y = 100;
-LK.gui.top.addChild(inventoryTxt);
+dayNightTxt.anchor.set(0.5, 0);
+dayNightTxt.y = 100;
+LK.gui.top.addChild(dayNightTxt);
+// Add cabin for NPCs
+cabin = game.attachAsset('cabin', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1700,
+ y: 300
+});
// Spawn bunny
bunny = game.addChild(new Bunny());
bunny.x = 200;
bunny.y = 200;
@@ -202,68 +289,134 @@
berry.y = Math.random() * (2732 - 120) + 60;
normalBerries.push(berry);
game.addChild(berry);
}
-// Spawn glitched berry function
-function spawnGlitchedBerry() {
- if (!glitchedBerrySpawned) {
- glitchedBerry = new GlitchedBerry();
- glitchedBerry.x = Math.random() * (2048 - 120) + 60;
- glitchedBerry.y = Math.random() * (2732 - 120) + 60;
- game.addChild(glitchedBerry);
- glitchedBerrySpawned = true;
- }
+// 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);
}
-// Transform game to scary mode
-function triggerGlitchMode() {
- isGlitched = true;
- glitchModeStartTime = LK.ticks;
- // Change background to dark scary color
- game.setBackgroundColor(0x1a0d1a);
- // Make background scary by tinting it dark red
- tween(background, {
- tint: 0x330000,
- alpha: 0.7
- }, {
- duration: 1000
- });
- // Flash screen red
- LK.effects.flashScreen(0xff0000, 2000);
- // Play scary sound
- LK.getSound('glitchSound').play();
- // Remove the glitched berry
- if (glitchedBerry) {
- glitchedBerry.destroy();
- glitchedBerry = null;
+// Spawn NPC function
+function spawnNPC() {
+ var rand = Math.random();
+ var cumulativeChance = 0;
+ var selectedType = 'bunny';
+ for (var i = 0; i < npcTypes.length; i++) {
+ cumulativeChance += npcSpawnChances[i];
+ if (rand <= cumulativeChance) {
+ selectedType = npcTypes[i];
+ break;
+ }
}
- // Spawn wendigo monster
- if (!wendigoSpawned) {
+ var npc = new NPC(selectedType);
+ 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 (every 3 nights)
+ if (nightCount % 3 === 0) {
+ 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
wendigo = new Wendigo();
- // Spawn wendigo off-screen and make it approach
wendigo.x = -100;
wendigo.y = Math.random() * 2000 + 300;
game.addChild(wendigo);
- wendigoSpawned = true;
- // Play wendigo growl sound
- LK.getSound('wendigoGrowl').play();
- }
- // Make fox look scared by changing color to darker
- tween(fox, {
- tint: 0x666666
- }, {
- duration: 1000
- });
- // Make all remaining berries look corrupted
- for (var i = 0; i < normalBerries.length; i++) {
- tween(normalBerries[i], {
- tint: 0x4d0033,
- rotation: Math.PI
+ // Change background to blood red
+ game.setBackgroundColor(0x330000);
+ tween(background, {
+ tint: 0x660000,
+ alpha: 0.8
}, {
duration: 1500
});
+ dayNightTxt.setText('Blood Moon');
+ dayNightTxt.style.fill = 0xFF0000;
+ } else {
+ // Regular night
+ // Spawn wolves
+ spawnWolf();
+ spawnWolf();
+ if (Math.random() < 0.5) spawnWolf();
+ // Move NPCs to cabin
+ for (var i = 0; i < npcs.length; i++) {
+ npcs[i].enterCabin();
+ }
+ // Change background to dark
+ game.setBackgroundColor(0x000033);
+ tween(background, {
+ tint: 0x333366,
+ alpha: 0.9
+ }, {
+ duration: 1500
+ });
+ dayNightTxt.setText('Night');
+ dayNightTxt.style.fill = 0x4444FF;
}
- // Remove the automatic game over - let the chase happen
}
+// Transition to day
+function startDay() {
+ isNight = false;
+ isBloodMoon = false;
+ berriesCollectedInCycle = 0;
+ // Remove wolves
+ for (var i = 0; i < wolves.length; i++) {
+ wolves[i].destroy();
+ }
+ wolves = [];
+ // Remove wendigo if exists
+ if (wendigo) {
+ wendigo.destroy();
+ wendigo = null;
+ }
+ // Bring NPCs out of cabin
+ for (var i = 0; i < npcs.length; i++) {
+ if (!npcs[i].killed) {
+ npcs[i].exitCabin();
+ }
+ }
+ // Spawn new NPC with chance
+ if (Math.random() < 0.7) {
+ spawnNPC();
+ }
+ // Change background back to day
+ game.setBackgroundColor(0x228b22);
+ tween(background, {
+ tint: 0xFFFFFF,
+ alpha: 1
+ }, {
+ duration: 1500
+ });
+ dayNightTxt.setText('Day');
+ dayNightTxt.style.fill = 0xFFFF00;
+}
+// Update score display with multiplier
+function updateScoreDisplay() {
+ scoreTxt.setText('Score: ' + LK.getScore() + ' (x' + scoreMultiplier + ')');
+}
// Keyboard state tracking
var keys = {
left: false,
right: false,
@@ -281,24 +434,8 @@
if (dragNode.y < 60) dragNode.y = 60;
if (dragNode.y > 2672) dragNode.y = 2672;
}
}
-function handleKeyboardMovement() {
- if (isGlitched) return;
- var speed = 8;
- if (keys.left && fox.x > 60) {
- fox.x -= speed;
- }
- if (keys.right && fox.x < 1988) {
- fox.x += speed;
- }
- if (keys.up && fox.y > 60) {
- fox.y -= speed;
- }
- if (keys.down && fox.y < 2672) {
- fox.y += speed;
- }
-}
// Mouse/touch events
game.move = handleMove;
game.down = function (x, y, obj) {
dragNode = fox;
@@ -312,94 +449,72 @@
spawnNormalBerry();
spawnNormalBerry();
// Main game update loop
game.update = function () {
- // Handle wendigo chase mode
- if (isGlitched && wendigo) {
- // Check if wendigo caught the fox
- if (wendigo.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();
- // Show scary game over after jumpscare
- LK.setTimeout(function () {
- LK.showGameOver();
- }, 1000);
- return;
- }
- // Continue with normal game logic but allow movement in glitch mode
- }
// Spawn berries over time
berrySpawnTimer++;
if (berrySpawnTimer >= 180) {
// Every 3 seconds
spawnNormalBerry();
berrySpawnTimer = 0;
}
- // Spawn glitched berry after some normal berries collected
- if (LK.getScore() >= 3 && !glitchedBerrySpawned) {
- spawnGlitchedBerry();
- }
// Check collisions with normal berries
for (var i = normalBerries.length - 1; i >= 0; i--) {
var berry = normalBerries[i];
if (fox.intersects(berry)) {
- // Always collect berry and increase score
- LK.setScore(LK.getScore() + 1);
- scoreTxt.setText('Score: ' + LK.getScore());
- // Add to inventory if there's space
- if (inventory < maxInventory) {
- inventory++;
- storage.inventory = inventory;
- }
- // Update inventory display regardless
- inventoryTxt.setText('Inventory: ' + inventory + '/' + maxInventory);
+ // 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
+ if (!isNight && berriesCollectedInCycle >= 10) {
+ startNight();
+ } else if (isNight && berriesCollectedInCycle >= (isBloodMoon ? 10 : 5)) {
+ startDay();
+ }
}
}
- // Check collision with bunny to give berries
- if (bunny && fox.intersects(bunny)) {
- if (inventory >= 10) {
- // Give 10 berries to bunny
- inventory -= 10;
- maxInventory += 1;
- bunny.berriesGiven += 10;
- storage.inventory = inventory;
- storage.maxInventory = maxInventory;
- // Update score and displays
- LK.setScore(LK.getScore() + 50);
- scoreTxt.setText('Score: ' + LK.getScore());
- inventoryTxt.setText('Inventory: ' + inventory + '/' + maxInventory);
- // Add feedback effect
- tween(bunny, {
- scaleX: 2,
- scaleY: 2
+ // 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)) {
+ // Update multiplier but cap at 4x
+ if (scoreMultiplier < 4) {
+ scoreMultiplier = Math.min(4, scoreMultiplier + (npc.multiplier === 3 ? 1 : npc.multiplier === 2 ? 0.5 : 0));
+ if (npc.multiplier === 3) scoreMultiplier = Math.min(4, scoreMultiplier + 1); // Mouse gives +1 extra
+ updateScoreDisplay();
+ }
+ // Give visual feedback
+ tween(npc, {
+ scaleX: 1.5,
+ scaleY: 1.5
}, {
duration: 200,
onFinish: function onFinish() {
- tween(bunny, {
- scaleX: 1.5,
- scaleY: 1.5
+ tween(npc, {
+ scaleX: 1,
+ scaleY: 1
}, {
duration: 200
});
}
});
- LK.getSound('berryCollect').play();
}
}
- // Check collision with glitched berry
- if (glitchedBerry && fox.intersects(glitchedBerry)) {
- triggerGlitchMode();
+ // Check collisions with wolves (game over)
+ for (var i = 0; i < wolves.length; i++) {
+ var wolf = wolves[i];
+ if (fox.intersects(wolf)) {
+ LK.effects.flashScreen(0xff0000, 1000);
+ LK.getSound('wendigoGrowl').play();
+ LK.setTimeout(function () {
+ LK.showGameOver();
+ }, 1000);
+ return;
+ }
}
};
\ No newline at end of file
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