Code edit (1 edits merged)
Please save this source code
User prompt
Orb O'Malley: Energy Absorption
Initial prompt
Orb O'Malley: A New Arcade Icon Orb O'Malley is a spherical, sentient energy being, glowing with a soft, ethereal light. Rather than chomping, Orb O'Malley absorbs energy. Its movement is less about a mouth and more about a gentle, frictionless glide. Here's how Orb O'Malley changes the game: Appearance: Imagine a smooth, perfectly round orb with a subtle, pulsating inner glow. It doesn't have eyes or a mouth in the traditional sense, but its glow intensifies or flickers slightly to convey a sense of "alertness" or "satisfaction" when absorbing energy. When "powered up," its glow becomes vibrant and emits small, shimmering particles. Gameplay Interaction: Instead of "eating dots," Orb O'Malley "absorbs energy particles." When it touches a particle, the particle dissolves into Orb O'Malley, causing a brief, satisfying ripple effect across its surface. "Power Pellet" Equivalent: These would be "Resonance Cores." When Orb O'Malley absorbs a Resonance Core, its energy field temporarily expands and intensifies. This allows it to "disperse" the spectral entities (our new "ghosts") upon contact. When dispersed, the spectral entities don't get "eaten"; they temporarily destabilize and return to their containment unit, re-coalescing after a short period. Movement & Sound: Orb O'Malley would have a smooth, almost fluid movement, accompanied by a soft, consistent hum. When absorbing particles, you'd hear a gentle, resonant chime, and a more powerful, escalating hum and whoosh when a Resonance Core is activated. Dispersing spectral entities would be marked by a distinct, ethereal shimmer and a soft, fading chime. The New Antagonists: Spectral Entities Replacing the ghosts, we now have Spectral Entities. These are less about being spooky and more about being abstract, ethereal beings that are drawn to and want to re-absorb the loose energy particles. Appearance: They could be wispy, translucent figures, perhaps with a faint outline and a central, glowing "core." Each of the four entities could have a distinct color and slightly different visual distortions or movement patterns to hint at their unique AI (e.g., one might have sharper, more erratic movements, another smoother and more flowing). Behavior: Their goal is to "re-collect" the energy particles before Orb O'Malley. They aren't trying to "eat" Orb O'Malley; rather, if they collide with it when Orb O'Malley isn't empowered, they disrupt its energy field, causing it to temporarily destabilize and lose a "charge" (our equivalent of a life). When Orb O'Malley is empowered by a Resonance Core, its expanded energy field disperses them. Names (examples): "Flicker" (The direct chaser) "Shade" (The ambusher) "Drift" (The unpredictable one) "Wisp" (The elusive one)
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var EnergyParticle = Container.expand(function () { var self = Container.call(this); var particleGraphics = self.attachAsset('energyParticle', { anchorX: 0.5, anchorY: 0.5 }); self.collected = false; self.update = function () { // Gentle pulsing effect var pulse = 1 + Math.sin(LK.ticks * 0.15) * 0.2; particleGraphics.scaleX = pulse; particleGraphics.scaleY = pulse; }; return self; }); var OrbOMalley = Container.expand(function () { var self = Container.call(this); var orbGraphics = self.attachAsset('orb', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 8; self.energyField = 60; self.isPowered = false; self.powerTimer = 0; self.update = function () { if (self.isPowered) { self.powerTimer--; if (self.powerTimer <= 0) { self.isPowered = false; self.energyField = 60; orbGraphics.scaleX = 1; orbGraphics.scaleY = 1; orbGraphics.tint = 0x00ffff; } } // Pulsating glow effect var pulseScale = 1 + Math.sin(LK.ticks * 0.2) * 0.1; orbGraphics.scaleX = self.isPowered ? 1.5 * pulseScale : pulseScale; orbGraphics.scaleY = self.isPowered ? 1.5 * pulseScale : pulseScale; }; self.activate = function () { self.isPowered = true; self.powerTimer = 300; // 5 seconds at 60fps self.energyField = 120; orbGraphics.tint = 0xffffff; }; return self; }); var ResonanceCore = Container.expand(function () { var self = Container.call(this); var coreGraphics = self.attachAsset('resonanceCore', { anchorX: 0.5, anchorY: 0.5 }); self.collected = false; self.update = function () { // Rotating glow effect coreGraphics.rotation += 0.05; var pulse = 1 + Math.sin(LK.ticks * 0.1) * 0.3; coreGraphics.scaleX = pulse; coreGraphics.scaleY = pulse; }; return self; }); var SpectralEntity = Container.expand(function (entityType) { var self = Container.call(this); var entityGraphics = self.attachAsset(entityType, { anchorX: 0.5, anchorY: 0.5 }); self.entityType = entityType; self.speed = 2; self.direction = Math.random() * Math.PI * 2; self.changeTimer = 0; self.dispersed = false; self.disperseTimer = 0; self.update = function () { if (self.dispersed) { self.disperseTimer--; if (self.disperseTimer <= 0) { self.dispersed = false; entityGraphics.alpha = 1; } return; } // Different movement patterns based on entity type if (self.entityType === 'flicker') { // Flicker: erratic movement with sudden direction changes self.changeTimer--; if (self.changeTimer <= 0) { self.direction = Math.random() * Math.PI * 2; self.changeTimer = 30 + Math.random() * 60; } } else if (self.entityType === 'shade') { // Shade: slow, methodical movement toward orb var dx = orb.x - self.x; var dy = orb.y - self.y; self.direction = Math.atan2(dy, dx); self.speed = 1.5; } else if (self.entityType === 'drift') { // Drift: smooth curved movement self.direction += 0.02; self.speed = 2.5; } else if (self.entityType === 'wisp') { // Wisp: fast, straight line movement with periodic direction changes self.changeTimer--; if (self.changeTimer <= 0) { self.direction = Math.random() * Math.PI * 2; self.changeTimer = 90 + Math.random() * 120; } self.speed = 3; } // Move entity var newX = self.x + Math.cos(self.direction) * self.speed; var newY = self.y + Math.sin(self.direction) * self.speed; // Check boundaries and reverse direction if needed if (newX < 100 || newX > 1948 || newY < 100 || newY > 2632) { self.direction = self.direction + Math.PI; } else { self.x = newX; self.y = newY; } // Ghostly effect entityGraphics.alpha = 0.8 + Math.sin(LK.ticks * 0.1) * 0.2; }; self.disperse = function () { self.dispersed = true; self.disperseTimer = 180; // 3 seconds entityGraphics.alpha = 0.3; LK.getSound('disperse').play(); }; return self; }); var Wall = Container.expand(function () { var self = Container.call(this); var wallGraphics = self.attachAsset('wall', { anchorX: 0.5, anchorY: 0.5 }); return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000022 }); /**** * Game Code ****/ // Game state variables var orb; var energyParticles = []; var resonanceCores = []; var spectralEntities = []; var walls = []; var level = 1; var totalParticles = 0; var collectedParticles = 0; var dragNode = null; // UI elements var levelText = new Text2('Level 1', { size: 80, fill: 0x00FFFF }); levelText.anchor.set(0.5, 0); LK.gui.top.addChild(levelText); var scoreText = new Text2('0', { size: 60, fill: 0xFFFFFF }); scoreText.anchor.set(1, 0); LK.gui.topRight.addChild(scoreText); // Initialize orb orb = game.addChild(new OrbOMalley()); orb.x = 1024; orb.y = 1366; // Level generation function generateLevel() { // Clear existing level for (var i = energyParticles.length - 1; i >= 0; i--) { energyParticles[i].destroy(); energyParticles.splice(i, 1); } for (var i = resonanceCores.length - 1; i >= 0; i--) { resonanceCores[i].destroy(); resonanceCores.splice(i, 1); } for (var i = spectralEntities.length - 1; i >= 0; i--) { spectralEntities[i].destroy(); spectralEntities.splice(i, 1); } // Generate energy particles var particleCount = 15 + level * 3; for (var i = 0; i < particleCount; i++) { var particle = game.addChild(new EnergyParticle()); particle.x = 150 + Math.random() * 1748; particle.y = 150 + Math.random() * 2432; energyParticles.push(particle); } // Generate resonance cores var coreCount = 2 + Math.floor(level / 3); for (var i = 0; i < coreCount; i++) { var core = game.addChild(new ResonanceCore()); core.x = 200 + Math.random() * 1648; core.y = 200 + Math.random() * 2332; resonanceCores.push(core); } // Generate spectral entities var entityTypes = ['flicker', 'shade', 'drift', 'wisp']; var entityCount = 2 + Math.floor(level / 2); for (var i = 0; i < entityCount; i++) { var entityType = entityTypes[i % entityTypes.length]; var entity = game.addChild(new SpectralEntity(entityType)); entity.x = 100 + Math.random() * 1848; entity.y = 100 + Math.random() * 2532; spectralEntities.push(entity); } totalParticles = particleCount; collectedParticles = 0; levelText.setText('Level ' + level); scoreText.setText(LK.getScore()); } // Touch controls function handleMove(x, y, obj) { if (dragNode) { var targetX = Math.max(50, Math.min(1998, x)); var targetY = Math.max(50, Math.min(2682, y)); // Smooth movement var dx = targetX - orb.x; var dy = targetY - orb.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > orb.speed) { orb.x += dx / distance * orb.speed; orb.y += dy / distance * orb.speed; } else { orb.x = targetX; orb.y = targetY; } } } game.move = handleMove; game.down = function (x, y, obj) { dragNode = orb; handleMove(x, y, obj); }; game.up = function (x, y, obj) { dragNode = null; }; // Main game loop game.update = function () { // Check energy particle collection for (var i = energyParticles.length - 1; i >= 0; i--) { var particle = energyParticles[i]; if (!particle.collected && orb.intersects(particle)) { particle.collected = true; collectedParticles++; LK.setScore(LK.getScore() + 10); scoreText.setText(LK.getScore()); // Ripple effect tween(particle, { scaleX: 2, scaleY: 2, alpha: 0 }, { duration: 300, easing: tween.easeOut, onFinish: function onFinish() { particle.destroy(); } }); energyParticles.splice(i, 1); LK.getSound('absorb').play(); // Check level completion if (collectedParticles >= totalParticles) { level++; LK.setTimeout(function () { generateLevel(); }, 1000); } } } // Check resonance core collection for (var i = resonanceCores.length - 1; i >= 0; i--) { var core = resonanceCores[i]; if (!core.collected && orb.intersects(core)) { core.collected = true; orb.activate(); LK.setScore(LK.getScore() + 50); scoreText.setText(LK.getScore()); // Power-up effect tween(core, { scaleX: 3, scaleY: 3, alpha: 0 }, { duration: 500, easing: tween.easeOut, onFinish: function onFinish() { core.destroy(); } }); resonanceCores.splice(i, 1); LK.getSound('powerUp').play(); } } // Check spectral entity collisions for (var i = 0; i < spectralEntities.length; i++) { var entity = spectralEntities[i]; if (!entity.dispersed && orb.intersects(entity)) { if (orb.isPowered) { entity.disperse(); } else { // Game over LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); return; } } } }; // Start first level generateLevel(); // Play ambient music LK.playMusic('ambientMusic');
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var EnergyParticle = Container.expand(function () {
var self = Container.call(this);
var particleGraphics = self.attachAsset('energyParticle', {
anchorX: 0.5,
anchorY: 0.5
});
self.collected = false;
self.update = function () {
// Gentle pulsing effect
var pulse = 1 + Math.sin(LK.ticks * 0.15) * 0.2;
particleGraphics.scaleX = pulse;
particleGraphics.scaleY = pulse;
};
return self;
});
var OrbOMalley = Container.expand(function () {
var self = Container.call(this);
var orbGraphics = self.attachAsset('orb', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 8;
self.energyField = 60;
self.isPowered = false;
self.powerTimer = 0;
self.update = function () {
if (self.isPowered) {
self.powerTimer--;
if (self.powerTimer <= 0) {
self.isPowered = false;
self.energyField = 60;
orbGraphics.scaleX = 1;
orbGraphics.scaleY = 1;
orbGraphics.tint = 0x00ffff;
}
}
// Pulsating glow effect
var pulseScale = 1 + Math.sin(LK.ticks * 0.2) * 0.1;
orbGraphics.scaleX = self.isPowered ? 1.5 * pulseScale : pulseScale;
orbGraphics.scaleY = self.isPowered ? 1.5 * pulseScale : pulseScale;
};
self.activate = function () {
self.isPowered = true;
self.powerTimer = 300; // 5 seconds at 60fps
self.energyField = 120;
orbGraphics.tint = 0xffffff;
};
return self;
});
var ResonanceCore = Container.expand(function () {
var self = Container.call(this);
var coreGraphics = self.attachAsset('resonanceCore', {
anchorX: 0.5,
anchorY: 0.5
});
self.collected = false;
self.update = function () {
// Rotating glow effect
coreGraphics.rotation += 0.05;
var pulse = 1 + Math.sin(LK.ticks * 0.1) * 0.3;
coreGraphics.scaleX = pulse;
coreGraphics.scaleY = pulse;
};
return self;
});
var SpectralEntity = Container.expand(function (entityType) {
var self = Container.call(this);
var entityGraphics = self.attachAsset(entityType, {
anchorX: 0.5,
anchorY: 0.5
});
self.entityType = entityType;
self.speed = 2;
self.direction = Math.random() * Math.PI * 2;
self.changeTimer = 0;
self.dispersed = false;
self.disperseTimer = 0;
self.update = function () {
if (self.dispersed) {
self.disperseTimer--;
if (self.disperseTimer <= 0) {
self.dispersed = false;
entityGraphics.alpha = 1;
}
return;
}
// Different movement patterns based on entity type
if (self.entityType === 'flicker') {
// Flicker: erratic movement with sudden direction changes
self.changeTimer--;
if (self.changeTimer <= 0) {
self.direction = Math.random() * Math.PI * 2;
self.changeTimer = 30 + Math.random() * 60;
}
} else if (self.entityType === 'shade') {
// Shade: slow, methodical movement toward orb
var dx = orb.x - self.x;
var dy = orb.y - self.y;
self.direction = Math.atan2(dy, dx);
self.speed = 1.5;
} else if (self.entityType === 'drift') {
// Drift: smooth curved movement
self.direction += 0.02;
self.speed = 2.5;
} else if (self.entityType === 'wisp') {
// Wisp: fast, straight line movement with periodic direction changes
self.changeTimer--;
if (self.changeTimer <= 0) {
self.direction = Math.random() * Math.PI * 2;
self.changeTimer = 90 + Math.random() * 120;
}
self.speed = 3;
}
// Move entity
var newX = self.x + Math.cos(self.direction) * self.speed;
var newY = self.y + Math.sin(self.direction) * self.speed;
// Check boundaries and reverse direction if needed
if (newX < 100 || newX > 1948 || newY < 100 || newY > 2632) {
self.direction = self.direction + Math.PI;
} else {
self.x = newX;
self.y = newY;
}
// Ghostly effect
entityGraphics.alpha = 0.8 + Math.sin(LK.ticks * 0.1) * 0.2;
};
self.disperse = function () {
self.dispersed = true;
self.disperseTimer = 180; // 3 seconds
entityGraphics.alpha = 0.3;
LK.getSound('disperse').play();
};
return self;
});
var Wall = Container.expand(function () {
var self = Container.call(this);
var wallGraphics = self.attachAsset('wall', {
anchorX: 0.5,
anchorY: 0.5
});
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000022
});
/****
* Game Code
****/
// Game state variables
var orb;
var energyParticles = [];
var resonanceCores = [];
var spectralEntities = [];
var walls = [];
var level = 1;
var totalParticles = 0;
var collectedParticles = 0;
var dragNode = null;
// UI elements
var levelText = new Text2('Level 1', {
size: 80,
fill: 0x00FFFF
});
levelText.anchor.set(0.5, 0);
LK.gui.top.addChild(levelText);
var scoreText = new Text2('0', {
size: 60,
fill: 0xFFFFFF
});
scoreText.anchor.set(1, 0);
LK.gui.topRight.addChild(scoreText);
// Initialize orb
orb = game.addChild(new OrbOMalley());
orb.x = 1024;
orb.y = 1366;
// Level generation
function generateLevel() {
// Clear existing level
for (var i = energyParticles.length - 1; i >= 0; i--) {
energyParticles[i].destroy();
energyParticles.splice(i, 1);
}
for (var i = resonanceCores.length - 1; i >= 0; i--) {
resonanceCores[i].destroy();
resonanceCores.splice(i, 1);
}
for (var i = spectralEntities.length - 1; i >= 0; i--) {
spectralEntities[i].destroy();
spectralEntities.splice(i, 1);
}
// Generate energy particles
var particleCount = 15 + level * 3;
for (var i = 0; i < particleCount; i++) {
var particle = game.addChild(new EnergyParticle());
particle.x = 150 + Math.random() * 1748;
particle.y = 150 + Math.random() * 2432;
energyParticles.push(particle);
}
// Generate resonance cores
var coreCount = 2 + Math.floor(level / 3);
for (var i = 0; i < coreCount; i++) {
var core = game.addChild(new ResonanceCore());
core.x = 200 + Math.random() * 1648;
core.y = 200 + Math.random() * 2332;
resonanceCores.push(core);
}
// Generate spectral entities
var entityTypes = ['flicker', 'shade', 'drift', 'wisp'];
var entityCount = 2 + Math.floor(level / 2);
for (var i = 0; i < entityCount; i++) {
var entityType = entityTypes[i % entityTypes.length];
var entity = game.addChild(new SpectralEntity(entityType));
entity.x = 100 + Math.random() * 1848;
entity.y = 100 + Math.random() * 2532;
spectralEntities.push(entity);
}
totalParticles = particleCount;
collectedParticles = 0;
levelText.setText('Level ' + level);
scoreText.setText(LK.getScore());
}
// Touch controls
function handleMove(x, y, obj) {
if (dragNode) {
var targetX = Math.max(50, Math.min(1998, x));
var targetY = Math.max(50, Math.min(2682, y));
// Smooth movement
var dx = targetX - orb.x;
var dy = targetY - orb.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance > orb.speed) {
orb.x += dx / distance * orb.speed;
orb.y += dy / distance * orb.speed;
} else {
orb.x = targetX;
orb.y = targetY;
}
}
}
game.move = handleMove;
game.down = function (x, y, obj) {
dragNode = orb;
handleMove(x, y, obj);
};
game.up = function (x, y, obj) {
dragNode = null;
};
// Main game loop
game.update = function () {
// Check energy particle collection
for (var i = energyParticles.length - 1; i >= 0; i--) {
var particle = energyParticles[i];
if (!particle.collected && orb.intersects(particle)) {
particle.collected = true;
collectedParticles++;
LK.setScore(LK.getScore() + 10);
scoreText.setText(LK.getScore());
// Ripple effect
tween(particle, {
scaleX: 2,
scaleY: 2,
alpha: 0
}, {
duration: 300,
easing: tween.easeOut,
onFinish: function onFinish() {
particle.destroy();
}
});
energyParticles.splice(i, 1);
LK.getSound('absorb').play();
// Check level completion
if (collectedParticles >= totalParticles) {
level++;
LK.setTimeout(function () {
generateLevel();
}, 1000);
}
}
}
// Check resonance core collection
for (var i = resonanceCores.length - 1; i >= 0; i--) {
var core = resonanceCores[i];
if (!core.collected && orb.intersects(core)) {
core.collected = true;
orb.activate();
LK.setScore(LK.getScore() + 50);
scoreText.setText(LK.getScore());
// Power-up effect
tween(core, {
scaleX: 3,
scaleY: 3,
alpha: 0
}, {
duration: 500,
easing: tween.easeOut,
onFinish: function onFinish() {
core.destroy();
}
});
resonanceCores.splice(i, 1);
LK.getSound('powerUp').play();
}
}
// Check spectral entity collisions
for (var i = 0; i < spectralEntities.length; i++) {
var entity = spectralEntities[i];
if (!entity.dispersed && orb.intersects(entity)) {
if (orb.isPowered) {
entity.disperse();
} else {
// Game over
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
return;
}
}
}
};
// Start first level
generateLevel();
// Play ambient music
LK.playMusic('ambientMusic');
8bit energyParticle. In-Game asset. 2d. High contrast. No shadows
8bit orb. In-Game asset. 2d. High contrast. No shadows
8bit wisp. In-Game asset. 2d. High contrast. No shadows
8bit flicker. In-Game asset. 2d. High contrast. No shadows
8bit wall. In-Game asset. 2d. High contrast. No shadows
8bit shade. In-Game asset. 2d. High contrast. No shadows
8bit resonanceCore. In-Game asset. 2d. High contrast. No shadows