User prompt
When lost control make kirby spin and add dizzy star emoji (💫 this one) over him until not lost control anymore. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make infected text be green and infected tint green, not red. Keep red wave 3 bg. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make dark matter shoot green water which is just a Waddle dee code but green tinted water image ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make throw work, add water counter
User prompt
Make throw work, make button bg be centered where text is
User prompt
Make throw e
User prompt
Make water be thrown at nearest en2my and add button bg for throw so easier to tqp
User prompt
Make it so water can be thrown at enemies with throw button to take out, but dark matter requires 4 hits
User prompt
Make waves be every 20 score not 30,
User prompt
Make there only be 3 waves, dark matter spawns in 3rd wave and all other enemies are gone. Bg becomes red in dark matter wave. Make kirby do dance animation when not infected. Use tween plug in for dance. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Move wave counter left 80px
User prompt
Make control loss not continue on to other.
User prompt
Please fix the bug: 'TypeError: tween.to is not a function' in or related to this line: 'tween.to(game, {' Line Number: 108 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Neither of the changes 2ork3e fix it
User prompt
When control loss = 0 show time until death timer, and when kirby cleansed bg pulses green for 1 second hold, with fade in and fade out being 0.5 seconds ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Replace lost control timer with 5 seca
User prompt
Make water regenerate every time you get to water
User prompt
It's always instant death, fix it
Code edit (1 edits merged)
Please save this source code
User prompt
Kirby's Infection Crisis
User prompt
Kirby infection au game, control kirby. If you get infected, you don't lose control (but will die in 1 min if not going in water once in that min then after water bath timer goes away and kirby is cleansed), you lose control for 20 seconds (then see dont lose control for happen next), or you die immediately, chosen randomly. Avoid infected Waddle dees, avoid normal and infected Waddle doos, and try not to get infected! Defeat Dark Matter to save Dream Land!
Initial prompt
Kirby infection au game, control kirby. If you get infected, you don't lose control (but will die in 1 min if not going in water once in that min), you lose control for 20 seconds (then see dont lose control for happen next), or you die immediately, chosen randomly. Avoid infected Waddle dees, avoid normal and infected Waddle doos, and try not to get infected! Defeat Dark Matter to save Dream Land!
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var DarkMatter = Container.expand(function () {
var self = Container.call(this);
var graphics = self.attachAsset('darkMatter', {
anchorX: 0.5,
anchorY: 0.5
});
self.health = 10;
self.moveTimer = 0;
self.speed = 1;
self.direction = 0;
self.update = function () {
self.moveTimer++;
// Change direction every 2 seconds
if (self.moveTimer % 120 === 0) {
self.direction = Math.random() * Math.PI * 2;
}
self.x += Math.cos(self.direction) * self.speed;
self.y += Math.sin(self.direction) * self.speed;
// Keep in bounds
self.x = Math.max(100, Math.min(1948, self.x));
self.y = Math.max(100, Math.min(2632, self.y));
// Pulsing dark energy effect
graphics.scaleX = 1 + Math.sin(self.moveTimer * 0.15) * 0.3;
graphics.scaleY = 1 + Math.sin(self.moveTimer * 0.15) * 0.3;
};
return self;
});
var Kirby = Container.expand(function () {
var self = Container.call(this);
var kirbyGraphics = self.attachAsset('kirby', {
anchorX: 0.5,
anchorY: 0.5
});
self.isInfected = false;
self.infectionTimer = 0;
self.controlLossTimer = 0;
self.isControlLoss = false;
self.update = function () {
if (self.infectionTimer > 0) {
self.infectionTimer--;
if (self.infectionTimer <= 0) {
// Infection timer expired - game over
LK.showGameOver();
}
}
if (self.controlLossTimer > 0) {
self.controlLossTimer--;
if (self.controlLossTimer <= 0) {
self.isControlLoss = false;
self.isInfected = false; // Clear infection when control loss ends
}
}
// Update visual feedback for infection
if (self.isInfected) {
kirbyGraphics.tint = 0xFF6B6B; // Red tint when infected
} else {
kirbyGraphics.tint = 0xFFFFFF; // Normal color
}
};
self.getInfected = function () {
if (self.isInfected) return; // Already infected
var outcome = Math.floor(Math.random() * 3);
if (outcome === 0) {
// Instant death (33% chance)
LK.showGameOver();
} else if (outcome === 1) {
// Control loss for 5 seconds (33% chance)
self.isControlLoss = true;
self.controlLossTimer = 300; // 5 seconds at 60fps
self.isInfected = true;
} else {
// 1 minute survival timer (33% chance)
self.isInfected = true;
self.infectionTimer = 3600; // 60 seconds at 60fps
}
LK.getSound('infection').play();
};
self.cleanse = function () {
self.isInfected = false;
self.infectionTimer = 0;
self.controlLossTimer = 0;
self.isControlLoss = false;
LK.getSound('cleanse').play();
};
return self;
});
var WaddleDee = Container.expand(function () {
var self = Container.call(this);
var graphics = self.attachAsset('waddleDee', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 2;
self.direction = Math.random() * Math.PI * 2;
self.update = function () {
self.x += Math.cos(self.direction) * self.speed;
self.y += Math.sin(self.direction) * self.speed;
// Bounce off edges
if (self.x < 40 || self.x > 2008) {
self.direction = Math.PI - self.direction;
}
if (self.y < 40 || self.y > 2692) {
self.direction = -self.direction;
}
// Keep in bounds
self.x = Math.max(40, Math.min(2008, self.x));
self.y = Math.max(40, Math.min(2692, self.y));
};
return self;
});
var WaddleDoo = Container.expand(function () {
var self = Container.call(this);
var graphics = self.attachAsset('waddleDoo', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 3;
self.targetX = 0;
self.targetY = 0;
self.update = function () {
// Move toward Kirby
var dx = self.targetX - self.x;
var dy = self.targetY - 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;
}
};
return self;
});
var Water = Container.expand(function () {
var self = Container.call(this);
var graphics = self.attachAsset('water', {
anchorX: 0.5,
anchorY: 0.5
});
// Gentle pulsing animation
self.pulseTimer = 0;
self.regenTimer = 0;
self.isHidden = false;
self.update = function () {
self.pulseTimer++;
if (self.isHidden) {
self.regenTimer--;
if (self.regenTimer <= 0) {
self.isHidden = false;
graphics.alpha = 1;
graphics.scaleX = 1;
graphics.scaleY = 1;
}
} else {
graphics.scaleX = 1 + Math.sin(self.pulseTimer * 0.1) * 0.2;
graphics.scaleY = 1 + Math.sin(self.pulseTimer * 0.1) * 0.2;
}
};
self.hide = function () {
self.isHidden = true;
self.regenTimer = 300; // 5 seconds at 60fps
graphics.alpha = 0;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB
});
/****
* Game Code
****/
// Game variables
var kirby;
var waddleDees = [];
var waddleDoos = [];
var waters = [];
var darkMatter = null;
var gameTimer = 0;
var waveLevel = 1;
var enemySpawnTimer = 0;
var waterSpawnTimer = 0;
var dragNode = null;
var bossSpawned = false;
// UI Elements
var scoreTxt = new Text2('Score: 0', {
size: 80,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
var infectionTxt = new Text2('', {
size: 60,
fill: 0xFF0000
});
infectionTxt.anchor.set(0.5, 0);
infectionTxt.y = 100;
LK.gui.top.addChild(infectionTxt);
var waveTxt = new Text2('Wave: 1', {
size: 70,
fill: 0xFFFFFF
});
waveTxt.anchor.set(0, 0);
LK.gui.topRight.addChild(waveTxt);
waveTxt.x = -280;
// Initialize Kirby
kirby = game.addChild(new Kirby());
kirby.x = 1024;
kirby.y = 1366;
// Spawn initial water
for (var i = 0; i < 3; i++) {
var water = game.addChild(new Water());
water.x = Math.random() * 1800 + 200;
water.y = Math.random() * 2400 + 200;
waters.push(water);
}
function spawnWaddleDee() {
var waddleDee = game.addChild(new WaddleDee());
var edge = Math.floor(Math.random() * 4);
if (edge === 0) {
// Top
waddleDee.x = Math.random() * 2048;
waddleDee.y = 0;
} else if (edge === 1) {
// Right
waddleDee.x = 2048;
waddleDee.y = Math.random() * 2732;
} else if (edge === 2) {
// Bottom
waddleDee.x = Math.random() * 2048;
waddleDee.y = 2732;
} else {
// Left
waddleDee.x = 0;
waddleDee.y = Math.random() * 2732;
}
waddleDees.push(waddleDee);
LK.getSound('enemySpawn').play();
}
function spawnWaddleDoo() {
var waddleDoo = game.addChild(new WaddleDoo());
var edge = Math.floor(Math.random() * 4);
if (edge === 0) {
// Top
waddleDoo.x = Math.random() * 2048;
waddleDoo.y = 0;
} else if (edge === 1) {
// Right
waddleDoo.x = 2048;
waddleDoo.y = Math.random() * 2732;
} else if (edge === 2) {
// Bottom
waddleDoo.x = Math.random() * 2048;
waddleDoo.y = 2732;
} else {
// Left
waddleDoo.x = 0;
waddleDoo.y = Math.random() * 2732;
}
waddleDoo.targetX = kirby.x;
waddleDoo.targetY = kirby.y;
waddleDoos.push(waddleDoo);
LK.getSound('enemySpawn').play();
}
function spawnWater() {
if (waters.length < 2) {
var water = game.addChild(new Water());
water.x = Math.random() * 1800 + 200;
water.y = Math.random() * 2400 + 200;
waters.push(water);
}
}
function spawnDarkMatter() {
if (!bossSpawned) {
darkMatter = game.addChild(new DarkMatter());
darkMatter.x = 1024;
darkMatter.y = 500;
bossSpawned = true;
// Clear all other enemies when boss spawns
for (var i = waddleDees.length - 1; i >= 0; i--) {
waddleDees[i].destroy();
}
waddleDees = [];
for (var j = waddleDoos.length - 1; j >= 0; j--) {
waddleDoos[j].destroy();
}
waddleDoos = [];
}
}
function handleMove(x, y, obj) {
if (dragNode && !kirby.isControlLoss) {
dragNode.x = x;
dragNode.y = y;
}
}
game.move = handleMove;
game.down = function (x, y, obj) {
dragNode = kirby;
handleMove(x, y, obj);
};
game.up = function (x, y, obj) {
dragNode = null;
};
game.update = function () {
gameTimer++;
// Update score
LK.setScore(Math.floor(gameTimer / 60));
scoreTxt.setText('Score: ' + LK.getScore());
// Update infection display
if (kirby.isInfected) {
var timeLeft = Math.ceil(kirby.infectionTimer / 60);
if (kirby.isControlLoss) {
var controlLeft = Math.ceil(kirby.controlLossTimer / 60);
infectionTxt.setText('INFECTED! Control Lost: ' + controlLeft + 's');
} else {
infectionTxt.setText('INFECTED! Time Left: ' + timeLeft + 's');
}
} else {
infectionTxt.setText('');
}
// Wave progression
if (gameTimer > 0 && gameTimer % 1800 === 0) {
// Every 30 seconds
waveLevel++;
waveTxt.setText('Wave: ' + waveLevel);
// Spawn boss after wave 5
if (waveLevel > 5) {
spawnDarkMatter();
}
}
// Enemy spawning
if (!bossSpawned) {
enemySpawnTimer++;
var spawnRate = Math.max(60, 180 - waveLevel * 20); // Faster spawning each wave
if (enemySpawnTimer >= spawnRate) {
enemySpawnTimer = 0;
if (Math.random() < 0.7) {
spawnWaddleDee();
} else {
spawnWaddleDoo();
}
}
}
// Water spawning
waterSpawnTimer++;
if (waterSpawnTimer >= 600) {
// Every 10 seconds
waterSpawnTimer = 0;
spawnWater();
}
// Update WaddleDoo targets
for (var i = 0; i < waddleDoos.length; i++) {
waddleDoos[i].targetX = kirby.x;
waddleDoos[i].targetY = kirby.y;
}
// Collision detection - WaddleDees
for (var j = waddleDees.length - 1; j >= 0; j--) {
var waddleDee = waddleDees[j];
if (kirby.intersects(waddleDee)) {
kirby.getInfected();
waddleDee.destroy();
waddleDees.splice(j, 1);
}
}
// Collision detection - WaddleDoos (always dangerous)
for (var k = waddleDoos.length - 1; k >= 0; k--) {
var waddleDoo = waddleDoos[k];
if (kirby.intersects(waddleDoo)) {
LK.showGameOver();
}
}
// Collision detection - Water
for (var l = waters.length - 1; l >= 0; l--) {
var water = waters[l];
if (kirby.intersects(water) && !water.isHidden) {
kirby.cleanse();
water.hide();
}
}
// Collision detection - Dark Matter
if (darkMatter && kirby.intersects(darkMatter)) {
darkMatter.health--;
LK.effects.flashObject(darkMatter, 0xFFFFFF, 200);
if (darkMatter.health <= 0) {
LK.showYouWin();
} else {
// Push Kirby away from Dark Matter
var dx = kirby.x - darkMatter.x;
var dy = kirby.y - darkMatter.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance > 0) {
kirby.x += dx / distance * 50;
kirby.y += dy / distance * 50;
}
}
}
};
// Start background music
LK.playMusic('bgmusic'); ===================================================================
--- original.js
+++ change.js
@@ -211,9 +211,9 @@
fill: 0xFFFFFF
});
waveTxt.anchor.set(0, 0);
LK.gui.topRight.addChild(waveTxt);
-waveTxt.x = -200;
+waveTxt.x = -280;
// Initialize Kirby
kirby = game.addChild(new Kirby());
kirby.x = 1024;
kirby.y = 1366;
Fullscreen modern App Store landscape banner, 16:9, high definition, for a game titled "Kirby's Infection Crisis" and with the description "Navigate Kirby through infected Dream Land, avoiding Waddle Dees and Waddle Doos while managing random infection consequences. Find water to cleanse infections and defeat Dark Matter to save the world.". No text on banner!
Waddle dee. In-Game asset. 2d. High contrast. No shadows
Waddle doo. In-Game asset. 2d. High contrast. No shadows
Water. In-Game asset. 2d. High contrast. No shadows