User prompt
add three human asset as well
User prompt
score should written below of the distance. and score should be based on collecting of dream orbits. distance mention only distance no bonus for it. make the texts bold and snail effect ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
remove fall sound effect, instead of that add a sound effect for collecting moments of dream orbits
User prompt
remove background layer
User prompt
give snail a walking sound effect
User prompt
add background layer
User prompt
add dream orbits a transparent smooth glow. add them a fall sound effect. add snail a walking effect non stop. make ground longer to left ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
dream orbits should fall every time when they seen
User prompt
dream orbits should add bonus point to distance and make them more rare
User prompt
bonus dream orbs sometimes falling from sky, and if snail collect them it give bonus point to distance
User prompt
remove moon beam mechanics, dream mode. add dream orbs and when they are collected, give distance bonus points
User prompt
use dream orbs instead of human mechanic in dream mode, and when they are collected, give distance bonus points
User prompt
dreams orbs should be seen and when they are collected, give distance bonus points
User prompt
camera track continue in dream mode and goal is collecting dream orbs for bonus for distance
User prompt
in moon beam, sky should be purple. dream orbs should be ready for collecting but game should continue without humans
User prompt
try moon beam in the beginning phase
User prompt
max 3 human at the same time on the screen, no more
User prompt
fix it.
User prompt
make humans faster
User prompt
make it more less
User prompt
decrease %10 humans effect area
User prompt
remove score and put there distance. make humans bigger by x2. but humans spawn rate increase
User prompt
remove time limit for shell. and make humans more rare
User prompt
ground background should be infinite. humans should come to left
User prompt
camera should track snail. game should continue infinite to right. humans should be shown randomly and in less frequently
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var DreamOrb = Container.expand(function () {
var self = Container.call(this);
var orbGraphics = self.attachAsset('dreamOrb', {
anchorX: 0.5,
anchorY: 0.5
});
self.collected = false;
self.update = function () {
// Gentle floating animation
self.y += Math.sin(LK.ticks * 0.05 + self.x * 0.01) * 0.3;
orbGraphics.rotation += 0.02;
// Glow effect
orbGraphics.alpha = 0.7 + Math.sin(LK.ticks * 0.1) * 0.3;
};
return self;
});
var Human = Container.expand(function () {
var self = Container.call(this);
var humanTypes = ['human1', 'human2', 'human3'];
var randomType = humanTypes[Math.floor(Math.random() * humanTypes.length)];
var humanGraphics = self.attachAsset(randomType, {
anchorX: 0.5,
anchorY: 1,
scaleX: 1.8,
scaleY: 1.8
});
self.speed = 3;
self.update = function () {
// Humans move left relative to world
self.x -= self.speed;
};
// Add walking animation when human is created
self.startWalkingAnimation = function () {
// Create a subtle walking bob animation
tween(humanGraphics, {
y: humanGraphics.y - 10
}, {
duration: 800,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(humanGraphics, {
y: humanGraphics.y + 10
}, {
duration: 800,
easing: tween.easeInOut,
onFinish: function onFinish() {
if (self.parent) {
// Only continue if human still exists
self.startWalkingAnimation();
}
}
});
}
});
// Add slight horizontal sway
tween(humanGraphics, {
rotation: 0.05
}, {
duration: 1200,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(humanGraphics, {
rotation: -0.05
}, {
duration: 1200,
easing: tween.easeInOut,
onFinish: function onFinish() {
if (self.parent) {
// Only continue if human still exists
tween(humanGraphics, {
rotation: 0
}, {
duration: 600,
easing: tween.easeInOut
});
}
}
});
}
});
};
// Start the walking animation immediately
self.startWalkingAnimation();
return self;
});
var Snail = Container.expand(function () {
var self = Container.call(this);
var snailBody = self.attachAsset('snail', {
anchorX: 0.5,
anchorY: 1
});
var shell = self.attachAsset('shell', {
anchorX: 0.5,
anchorY: 1,
alpha: 0
});
self.isHidden = false;
self.speed = 2;
self.hide = function () {
if (!self.isHidden) {
self.isHidden = true;
snailBody.alpha = 0;
shell.alpha = 1;
hideTimer = 0; // Reset timer when hiding
LK.getSound('hide').play();
}
};
self.emerge = function () {
if (self.isHidden) {
self.isHidden = false;
snailBody.alpha = 1;
shell.alpha = 0;
hideTimer = 0; // Reset timer when emerging
}
};
self.update = function () {
// In dream mode, snail floats
if (isDreamMode) {
self.y += Math.sin(LK.ticks * 0.1) * 0.5;
} else if (!self.isHidden) {
// Normal movement - snail moves right
self.x += self.speed;
distance += self.speed;
}
};
return self;
});
var Star = Container.expand(function () {
var self = Container.call(this);
var starGraphics = self.attachAsset('star', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
// Stars don't move - they stay in world position for parallax effect
starGraphics.alpha = 0.5 + Math.sin(LK.ticks * 0.05 + self.x * 0.01) * 0.5;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x191970
});
/****
* Game Code
****/
var snail;
var humans = [];
var dreamOrbs = [];
var stars = [];
var ground;
var scrollSpeed = 2;
var distance = 0;
var cameraX = 0;
var worldOffset = 0;
var isDreamMode = false;
var dreamModeTimer = 0;
var dreamModeMaxTime = 900; // 15 seconds at 60fps
var moonbeamTimer = 0;
var moonbeam = null;
var isPressed = false;
var hideTimer = 0;
var maxHideTime = 180; // 3 seconds at 60fps
// UI
var distanceText = new Text2('Distance: 0m', {
size: 60,
fill: 0xFFFFFF
});
distanceText.anchor.set(0.5, 0);
LK.gui.top.addChild(distanceText);
// Create ground array for infinite scrolling
var grounds = [];
// Create initial ground segments
for (var i = 0; i < 3; i++) {
var groundSegment = game.addChild(LK.getAsset('ground', {
anchorX: 0,
anchorY: 1,
x: i * 2048,
y: 2732
}));
grounds.push(groundSegment);
}
// Create snail
snail = game.addChild(new Snail());
snail.x = 300;
snail.y = 2732 - 500; // Moved much higher above ground
// Create initial stars
for (var i = 0; i < 30; i++) {
var star = game.addChild(new Star());
star.x = Math.random() * 4096;
star.y = Math.random() * 1500;
stars.push(star);
}
function spawnHuman() {
var human = game.addChild(new Human());
human.x = cameraX + 2048 + Math.random() * 500; // Spawn from right side of screen
human.y = 2732 - 500; // Moved much higher above ground
humans.push(human);
}
function spawnDreamOrb() {
var orb = game.addChild(new DreamOrb());
orb.x = Math.random() * 1800 + 124;
orb.y = Math.random() * 2000 + 200;
dreamOrbs.push(orb);
}
function enterDreamMode() {
if (!isDreamMode) {
isDreamMode = true;
dreamModeTimer = 0;
// Change background color
tween(game, {
backgroundColor: 0x4B0082
}, {
duration: 1000
});
// Create moonbeam
moonbeam = game.addChild(LK.getAsset('moonbeam', {
anchorX: 0.5,
anchorY: 0,
x: snail.x,
y: 0,
alpha: 0.3
}));
// Spawn dream orbs
for (var i = 0; i < 8; i++) {
spawnDreamOrb();
}
}
}
function exitDreamMode() {
if (isDreamMode) {
isDreamMode = false;
// Change background back
tween(game, {
backgroundColor: 0x191970
}, {
duration: 1000
});
// Remove moonbeam
if (moonbeam) {
moonbeam.destroy();
moonbeam = null;
}
// Remove remaining dream orbs
for (var i = dreamOrbs.length - 1; i >= 0; i--) {
dreamOrbs[i].destroy();
dreamOrbs.splice(i, 1);
}
}
}
game.down = function (x, y, obj) {
isPressed = true;
snail.hide();
};
game.up = function (x, y, obj) {
isPressed = false;
snail.emerge();
};
game.update = function () {
// No hide timer - snail can stay hidden indefinitely
// Update distance display
distanceText.setText('Distance: ' + Math.floor(distance / 50) + 'm');
// Check for moonlight beam trigger (random chance)
if (!isDreamMode && LK.ticks % 60 === 0 && Math.random() < 0.005) {
enterDreamMode();
}
// Handle dream mode
if (isDreamMode) {
dreamModeTimer++;
if (dreamModeTimer >= dreamModeMaxTime) {
exitDreamMode();
}
}
// Spawn humans more rarely, but increase rate with distance
var spawnRate = 0.0005 + Math.floor(distance / 50) * 0.0002; // Increase spawn rate every 50 distance units
if (!isDreamMode && Math.random() < spawnRate) {
spawnHuman();
}
// Update and check humans
for (var i = humans.length - 1; i >= 0; i--) {
var human = humans[i];
// Check collision with snail
if (!snail.isHidden && snail.intersects(human)) {
LK.showGameOver();
return;
}
// Remove off-screen humans (behind camera)
if (human.x < cameraX - 500) {
// Stop any running animations before destroying
tween.stop(human.children[0]); // Stop animations on the human graphics
human.destroy();
humans.splice(i, 1);
}
}
// Update and check dream orbs
for (var i = dreamOrbs.length - 1; i >= 0; i--) {
var orb = dreamOrbs[i];
if (!orb.collected && snail.intersects(orb)) {
orb.collected = true;
LK.setScore(LK.getScore() + 10);
LK.getSound('collect').play();
// Visual effect
tween(orb, {
alpha: 0,
scaleX: 2,
scaleY: 2
}, {
duration: 300,
onFinish: function onFinish() {
orb.destroy();
}
});
dreamOrbs.splice(i, 1);
}
}
// Camera tracking - follow snail
var targetCameraX = snail.x - 1024; // Keep snail in left-center of screen
cameraX += (targetCameraX - cameraX) * 0.1; // Smooth camera movement
// Update all game objects position relative to camera
game.x = -cameraX;
// Infinite world generation - add new stars ahead
if (LK.ticks % 300 === 0) {
var star = game.addChild(new Star());
star.x = snail.x + 2000 + Math.random() * 1000; // Spawn ahead of snail
star.y = Math.random() * 1500;
stars.push(star);
}
// Remove off-screen stars (behind camera)
for (var i = stars.length - 1; i >= 0; i--) {
if (stars[i].x < cameraX - 500) {
stars[i].destroy();
stars.splice(i, 1);
}
}
// Infinite ground generation
var rightmostGroundX = -Infinity;
for (var i = 0; i < grounds.length; i++) {
if (grounds[i].x > rightmostGroundX) {
rightmostGroundX = grounds[i].x;
}
}
// Add new ground segments ahead of camera
while (rightmostGroundX < cameraX + 4096) {
var newGround = game.addChild(LK.getAsset('ground', {
anchorX: 0,
anchorY: 1,
x: rightmostGroundX + 2048,
y: 2732
}));
grounds.push(newGround);
rightmostGroundX += 2048;
}
// Remove ground segments behind camera
for (var i = grounds.length - 1; i >= 0; i--) {
if (grounds[i].x < cameraX - 2048) {
grounds[i].destroy();
grounds.splice(i, 1);
}
}
// Distance is tracked automatically through snail movement
};
// Start background music
LK.playMusic('ambient'); ===================================================================
--- original.js
+++ change.js
@@ -31,9 +31,9 @@
anchorY: 1,
scaleX: 1.8,
scaleY: 1.8
});
- self.speed = 1;
+ self.speed = 3;
self.update = function () {
// Humans move left relative to world
self.x -= self.speed;
};
2048x100 pixel ground layer with grass. In-Game asset. 2d. High contrast. No shadows
white shiny little star 2d pixel art. In-Game asset. 2d. High contrast. No shadows
bad regular casual middle aged man full body 2d pixel art. In-Game asset. 2d. High contrast. No shadows
bad regular casual middle aged woman full body 2d pixel art. In-Game asset. 2d. High contrast. No shadows
bad regular casual kid full body 2d pixel art. In-Game asset. 2d. High contrast. No shadows
desperate depressive cute snail 2d pixel art. In-Game asset. 2d. High contrast. No shadows
dream orb 2d pixel art. In-Game asset. 2d. High contrast. No shadows
desperate depressive cute snail is hiding in shell 2d pixel art. In-Game asset. 2d. High contrast. No shadows
bad regular frown casual old woman full body 2d pixel art. In-Game asset. 2d. High contrast. No shadows
bad regular frown casual old man full body 2d pixel art. In-Game asset. 2d. High contrast. No shadows
bad regular frown casual girl kid blonde hair braided full body 2d pixel art. In-Game asset. 2d. High contrast. No shadows