User prompt
Make the sound effect, part, way more intense and chaotic
User prompt
Make it randomly play, cash register sound effect, and meditation sound effect
User prompt
MORE CHAOS ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
MORE ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make this game feel like you are high and in a fever dream ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make the UI look less like a standard clicker and just make it look like it’s the own original thing
User prompt
Please fix the bug: 'TypeError: target is not an Object. (evaluating 'key in target')' in or related to this line: 'tween(elements[i], {' Line Number: 3070 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
EVEN MORE CHOAS ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Just make the game as chaotic as you possibly can. I don’t want this to be a serious game. Also don’t make it look like a template of other clickers ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make a tutorial text in the empty space
User prompt
Now make it so the UI or Other words aren’t in the way of everything
User prompt
I have bad eyes increase the UI size so I can see it
User prompt
Remove the effect when you get a critical
User prompt
Add a really good update on The clicker aspect and not just focus on the zen add Something good to clicker ↪💡 Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1
User prompt
Make a REALLY good update ↪💡 Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1
User prompt
Make the main game more, relaxing outside of the relax button ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
I want this game to be the most relaxing experience ever ↪💡 Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1
User prompt
Make this game really relaxing ↪💡 Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1
User prompt
Compilation error[L1318]: Unterminated regular expression. (1318:4)
User prompt
Fix the script error
User prompt
Make stuff to fit the Zen vibe of this game ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Add more cool BG Effects ↪💡 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 Achievement = Container.expand(function (achievementData) {
var self = Container.call(this);
var badgeGraphics = self.attachAsset('achievementBadge', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.8,
scaleY: 0.8
});
self.achievementData = achievementData;
var nameText = new Text2(achievementData.name, {
size: 24,
fill: 0xFFFFFF
});
nameText.anchor.set(0.5, 0.5);
nameText.y = 60;
self.addChild(nameText);
var progressText = new Text2('0/' + achievementData.target, {
size: 20,
fill: 0xCCCCCC
});
progressText.anchor.set(0.5, 0.5);
progressText.y = 85;
self.addChild(progressText);
self.updateProgress = function () {
var progress = Math.min(achievementData.current, achievementData.target);
progressText.setText(progress + '/' + achievementData.target);
if (achievementData.completed && !achievementData.claimed) {
badgeGraphics.tint = 0xFFD700; // Gold when ready to claim
tween(badgeGraphics, {
rotation: badgeGraphics.rotation + Math.PI * 2
}, {
duration: 2000,
easing: tween.linear
});
} else if (achievementData.claimed) {
badgeGraphics.tint = 0x888888; // Gray when claimed
} else {
badgeGraphics.tint = 0xFFFFFF; // White when in progress
}
};
self.down = function (x, y, obj) {
if (achievementData.completed && !achievementData.claimed) {
claimAchievement(achievementData);
}
};
return self;
});
var BoostButton = Container.expand(function (boostData) {
var self = Container.call(this);
var buttonGraphics = self.attachAsset('boostButton', {
anchorX: 0.5,
anchorY: 0.5
});
self.boostData = boostData;
var nameText = new Text2(boostData.name, {
size: 32,
fill: 0xFFFFFF
});
nameText.anchor.set(0.5, 0.5);
nameText.y = -15;
self.addChild(nameText);
var costText = new Text2('Cost: ' + boostData.cost, {
size: 24,
fill: 0xFFFF00
});
costText.anchor.set(0.5, 0.5);
costText.y = 15;
self.addChild(costText);
self.updateDisplay = function () {
if (points >= boostData.cost && !activeBoosts[boostData.type]) {
buttonGraphics.tint = 0xFFFFFF;
} else {
buttonGraphics.tint = 0x666666;
}
if (activeBoosts[boostData.type]) {
var timeLeft = Math.ceil((activeBoosts[boostData.type].endTime - Date.now()) / 1000);
costText.setText('Active: ' + timeLeft + 's');
} else {
costText.setText('Cost: ' + boostData.cost);
}
};
self.down = function (x, y, obj) {
if (points >= boostData.cost && !activeBoosts[boostData.type]) {
points -= boostData.cost;
activateBoost(boostData);
updateUI();
saveGame();
}
};
return self;
});
var BreathingGuide = Container.expand(function () {
var self = Container.call(this);
var guideGraphics = self.attachAsset('multiplierOrb', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.3,
scaleX: 2,
scaleY: 2
});
guideGraphics.tint = 0xE6E6FA; // Lavender for calming effect
var breathingText = new Text2('Breathe with the circle', {
size: 36,
fill: 0xF0F8FF
});
breathingText.anchor.set(0.5, 0.5);
breathingText.y = -150;
self.addChild(breathingText);
self.breathingCycle = 0;
self.isBreathingIn = true;
self.startBreathingGuide = function () {
// 4-7-8 breathing technique: inhale 4, hold 7, exhale 8
if (self.isBreathingIn) {
breathingText.setText('Breathe In Slowly...');
breathingText.tint = 0x98FB98;
tween(guideGraphics, {
scaleX: 4,
scaleY: 4,
alpha: 0.6
}, {
duration: 4000,
easing: tween.easeInOut,
onFinish: function onFinish() {
breathingText.setText('Hold...');
breathingText.tint = 0xFFE4B5;
LK.setTimeout(function () {
self.isBreathingIn = false;
self.startBreathingGuide();
}, 7000);
}
});
} else {
breathingText.setText('Breathe Out Slowly...');
breathingText.tint = 0x87CEEB;
tween(guideGraphics, {
scaleX: 2,
scaleY: 2,
alpha: 0.2
}, {
duration: 8000,
easing: tween.easeInOut,
onFinish: function onFinish() {
self.isBreathingIn = true;
self.startBreathingGuide();
}
});
}
};
return self;
});
var ClickEffect = Container.expand(function () {
var self = Container.call(this);
var effectGraphics = self.attachAsset('clickEffect', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.8,
scaleX: 0.3,
scaleY: 0.3
});
self.animate = function () {
tween(effectGraphics, {
scaleX: 1.5,
scaleY: 1.5,
alpha: 0
}, {
duration: 400,
easing: tween.easeOut,
onFinish: function onFinish() {
self.destroy();
}
});
};
return self;
});
var DogPark = Container.expand(function () {
var self = Container.call(this);
var dogParkGraphics = self.attachAsset('dogPark', {
anchorX: 0.5,
anchorY: 0.5
});
self.updateSkin = function () {
// Skin system exists but no visual changes needed
};
self.bounce = function () {
tween(dogParkGraphics, {
scaleX: 1.2,
scaleY: 1.2
}, {
duration: 100,
easing: tween.easeOut,
onFinish: function onFinish() {
tween(dogParkGraphics, {
scaleX: 1,
scaleY: 1
}, {
duration: 100,
easing: tween.easeOut
});
}
});
};
self.down = function (x, y, obj) {
updateBoostMultiplier();
var clickBoost = activeBoosts.click ? activeBoosts.click.multiplier : 1;
var allBoost = activeBoosts.all ? activeBoosts.all.multiplier : 1;
var basePoints = (1 + pointsPerClick) * prestigeMultiplier * clickBoost * allBoost;
points += basePoints;
totalPointsEarned += basePoints;
totalClicks += 1;
clicksInLastSecond++;
checkSkinUnlock();
self.bounce();
LK.getSound('click').play();
// Create zen ripple effect
var ripple = new ZenRipple();
ripple.x = self.x;
ripple.y = self.y;
game.addChild(ripple);
ripple.animate();
var effect = new ClickEffect();
effect.x = x;
effect.y = y;
game.addChild(effect);
effect.animate();
updateAchievements();
updateUI();
saveGame();
};
return self;
});
var FloatingParticle = Container.expand(function () {
var self = Container.call(this);
var colors = [0xff6b35, 0x00ffff, 0xffd700, 0xff69b4, 0x98fb98, 0xffa500];
var randomColor = colors[Math.floor(Math.random() * colors.length)];
var particleGraphics = self.attachAsset('multiplierOrb', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.3,
scaleX: 0.2 + Math.random() * 0.4,
scaleY: 0.2 + Math.random() * 0.4
});
particleGraphics.tint = randomColor;
self.speed = 0.5 + Math.random() * 2;
self.floatDirection = Math.random() * Math.PI * 2;
self.rotationSpeed = (Math.random() - 0.5) * 0.1;
self.pulsePhase = Math.random() * Math.PI * 2;
self.startFloat = function () {
var targetX = self.x + Math.cos(self.floatDirection) * (200 + Math.random() * 400);
var targetY = self.y + Math.sin(self.floatDirection) * (200 + Math.random() * 400);
tween(self, {
x: targetX,
y: targetY
}, {
duration: 8000 + Math.random() * 4000,
easing: tween.easeInOut,
onFinish: function onFinish() {
self.floatDirection = Math.random() * Math.PI * 2;
self.startFloat();
}
});
};
self.update = function () {
particleGraphics.rotation += self.rotationSpeed;
self.pulsePhase += 0.05;
particleGraphics.alpha = 0.2 + Math.sin(self.pulsePhase) * 0.2;
};
return self;
});
var FloatingStar = Container.expand(function () {
var self = Container.call(this);
var starGraphics = self.attachAsset('clickEffect', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.6,
scaleX: 0.3 + Math.random() * 0.2,
scaleY: 0.3 + Math.random() * 0.2
});
starGraphics.tint = 0xFFFFFF;
self.speed = 0.2 + Math.random() * 0.8;
self.direction = Math.random() * Math.PI * 2;
self.twinklePhase = Math.random() * Math.PI * 2;
self.rotationSpeed = (Math.random() - 0.5) * 0.05;
self.startTwinkle = function () {
tween(starGraphics, {
alpha: 0.9,
scaleX: starGraphics.scaleX * 1.5,
scaleY: starGraphics.scaleY * 1.5
}, {
duration: 1000 + Math.random() * 2000,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(starGraphics, {
alpha: 0.2,
scaleX: starGraphics.scaleX * 0.7,
scaleY: starGraphics.scaleY * 0.7
}, {
duration: 1000 + Math.random() * 2000,
easing: tween.easeInOut,
onFinish: function onFinish() {
self.startTwinkle();
}
});
}
});
};
self.update = function () {
self.x += Math.cos(self.direction) * self.speed;
self.y += Math.sin(self.direction) * self.speed;
starGraphics.rotation += self.rotationSpeed;
// Wrap around screen edges
if (self.x < -50) self.x = 2098;
if (self.x > 2098) self.x = -50;
if (self.y < -50) self.y = 2782;
if (self.y > 2782) self.y = -50;
};
return self;
});
var MeditationBubble = Container.expand(function () {
var self = Container.call(this);
var bubbleGraphics = self.attachAsset('multiplierOrb', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.1,
scaleX: 0.3 + Math.random() * 0.4,
scaleY: 0.3 + Math.random() * 0.4
});
// Soft meditation colors
var meditationColors = [0xE6E6FA, 0xF0F8FF, 0xFDF5E6, 0xF5FFFA, 0xFFF8DC];
bubbleGraphics.tint = meditationColors[Math.floor(Math.random() * meditationColors.length)];
self.floatSpeed = 0.3 + Math.random() * 0.5;
self.pulsePhase = Math.random() * Math.PI * 2;
self.startFloating = function () {
tween(self, {
y: self.y - 300 - Math.random() * 200
}, {
duration: 15000 + Math.random() * 10000,
easing: tween.easeInOut,
onFinish: function onFinish() {
self.destroy();
}
});
};
self.update = function () {
self.pulsePhase += 0.02;
bubbleGraphics.alpha = 0.05 + Math.sin(self.pulsePhase) * 0.1;
bubbleGraphics.scaleX += Math.sin(self.pulsePhase * 0.7) * 0.001;
bubbleGraphics.scaleY += Math.cos(self.pulsePhase * 0.5) * 0.001;
};
return self;
});
var MultiplierOrb = Container.expand(function () {
var self = Container.call(this);
var orbGraphics = self.attachAsset('multiplierOrb', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.8
});
self["float"] = function () {
tween(orbGraphics, {
y: orbGraphics.y - 20
}, {
duration: 1500,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(orbGraphics, {
y: orbGraphics.y + 20
}, {
duration: 1500,
easing: tween.easeInOut,
onFinish: function onFinish() {
self["float"]();
}
});
}
});
};
return self;
});
var PrestigeButton = Container.expand(function () {
var self = Container.call(this);
var buttonGraphics = self.attachAsset('prestigeButton', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.95,
scaleY: 1.0
});
var titleText = new Text2('PRESTIGE', {
size: 48,
fill: 0x000000
});
titleText.anchor.set(0.5, 0.5);
titleText.y = -25;
self.addChild(titleText);
var rewardText = new Text2('Reset for +' + calculatePrestigeReward() + 'x multiplier', {
size: 32,
fill: 0x8B0000
});
rewardText.anchor.set(0.5, 0.5);
rewardText.y = 15;
self.addChild(rewardText);
var costText = new Text2('Requires: 1M total clicks', {
size: 28,
fill: 0x444444
});
costText.anchor.set(0.5, 0.5);
costText.y = 45;
self.addChild(costText);
self.updateDisplay = function () {
var reward = calculatePrestigeReward();
rewardText.setText('Reset for +' + reward + 'x multiplier');
if (totalClicks >= 1000000) {
buttonGraphics.tint = 0xFFFFFF;
titleText.tint = 0x000000;
} else {
buttonGraphics.tint = 0x666666;
titleText.tint = 0x999999;
}
};
self.down = function (x, y, obj) {
if (totalClicks >= 1000000) {
performPrestige();
}
};
return self;
});
var PrestigeParticle = Container.expand(function () {
var self = Container.call(this);
var particleGraphics = self.attachAsset('prestigeParticle', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 1.0,
scaleX: 0.5,
scaleY: 0.5
});
self.animate = function () {
var randomX = (Math.random() - 0.5) * 800;
var randomY = -Math.random() * 400 - 200;
tween(self, {
x: self.x + randomX,
y: self.y + randomY
}, {
duration: 2000,
easing: tween.easeOut
});
tween(particleGraphics, {
scaleX: 1.5,
scaleY: 1.5,
alpha: 0
}, {
duration: 2000,
easing: tween.easeOut,
onFinish: function onFinish() {
self.destroy();
}
});
};
return self;
});
var RelaxationMode = Container.expand(function () {
var self = Container.call(this);
var overlayGraphics = self.attachAsset('statisticsPanel', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.8,
scaleX: 4,
scaleY: 6
});
overlayGraphics.tint = 0x2E2E4F;
var titleText = new Text2('RELAXATION MODE', {
size: 72,
fill: 0xE6E6FA
});
titleText.anchor.set(0.5, 0.5);
titleText.y = -300;
self.addChild(titleText);
var instructionText = new Text2('Take deep breaths and focus on the gentle movements\nClick anywhere to exit', {
size: 40,
fill: 0xF0F8FF
});
instructionText.anchor.set(0.5, 0.5);
instructionText.y = 250;
self.addChild(instructionText);
self.breathingCycle = 0;
var breathingText = new Text2('Breathe In...', {
size: 60,
fill: 0x98FB98
});
breathingText.anchor.set(0.5, 0.5);
breathingText.y = 0;
self.addChild(breathingText);
self.startRelaxation = function () {
self.breathingCycle = 0;
self.updateBreathingText();
// Play multiple ambient sounds for deep relaxation
if (relaxationPreferences.meditationSoundEnabled) {
LK.getSound('gentleWaves').play();
LK.setTimeout(function () {
LK.getSound('windChimes').play();
}, 2000);
LK.setTimeout(function () {
LK.getSound('softRain').play();
}, 4000);
}
// Start gentle background pulse with slower, deeper breathing rhythm
tween(overlayGraphics, {
alpha: 0.95,
scaleX: 4.1,
scaleY: 6.1
}, {
duration: 6000,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(overlayGraphics, {
alpha: 0.65,
scaleX: 3.9,
scaleY: 5.9
}, {
duration: 8000,
easing: tween.easeInOut,
onFinish: function onFinish() {
self.startRelaxation();
}
});
}
});
};
self.updateBreathingText = function () {
var cycle = Math.floor(self.breathingCycle / 240); // 4 second cycles at 60fps
var phase = cycle % 2;
if (phase === 0) {
breathingText.setText('Breathe In...');
breathingText.tint = 0x98FB98;
} else {
breathingText.setText('Breathe Out...');
breathingText.tint = 0x87CEEB;
}
};
self.update = function () {
self.breathingCycle += 1;
if (self.breathingCycle % 240 === 0) {
self.updateBreathingText();
}
// Gentle breathing animation
var breathPhase = self.breathingCycle % 240 / 240;
var breathScale = 1 + Math.sin(breathPhase * Math.PI) * 0.1;
breathingText.scaleX = breathScale;
breathingText.scaleY = breathScale;
};
self.down = function (x, y, obj) {
exitRelaxationMode();
};
return self;
});
var RelaxingAffirmation = Container.expand(function () {
var self = Container.call(this);
var affirmations = ['You are at peace', 'Breathe and let go', 'This moment is perfect', 'You are calm and centered', 'Feel the tranquility', 'Let peace flow through you', 'You are exactly where you need to be', 'Embrace this peaceful moment'];
var affirmationText = new Text2(affirmations[Math.floor(Math.random() * affirmations.length)], {
size: 48,
fill: 0xE6E6FA
});
affirmationText.anchor.set(0.5, 0.5);
affirmationText.alpha = 0;
self.addChild(affirmationText);
self.showAffirmation = function () {
tween(affirmationText, {
alpha: 0.8,
scaleX: 1.1,
scaleY: 1.1
}, {
duration: 2000,
easing: tween.easeInOut,
onFinish: function onFinish() {
LK.setTimeout(function () {
tween(affirmationText, {
alpha: 0,
scaleX: 1,
scaleY: 1
}, {
duration: 2000,
easing: tween.easeInOut,
onFinish: function onFinish() {
self.destroy();
}
});
}, 3000);
}
});
};
return self;
});
var SoothingWave = Container.expand(function () {
var self = Container.call(this);
var waveGraphics = self.attachAsset('multiplierOrb', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.1,
scaleX: 0.5,
scaleY: 0.1
});
var waveColors = [0xE0FFFF, 0xF0FFFF, 0xF5FFFA, 0xF0F8FF];
waveGraphics.tint = waveColors[Math.floor(Math.random() * waveColors.length)];
self.wavePhase = Math.random() * Math.PI * 2;
self.startWave = function () {
tween(self, {
scaleX: 8 + Math.random() * 4,
scaleY: 0.3 + Math.random() * 0.2,
alpha: 0
}, {
duration: 6000 + Math.random() * 4000,
easing: tween.easeOut,
onFinish: function onFinish() {
self.destroy();
}
});
};
return self;
});
var StatisticsPanel = Container.expand(function () {
var self = Container.call(this);
var panelGraphics = self.attachAsset('statisticsPanel', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.9
});
var titleText = new Text2('STATISTICS', {
size: 48,
fill: 0xFFD700
});
titleText.anchor.set(0.5, 0.5);
titleText.y = -200;
self.addChild(titleText);
var statsText = new Text2('', {
size: 28,
fill: 0xFFFFFF
});
statsText.anchor.set(0, 0.5);
statsText.x = -300;
statsText.y = -50;
self.addChild(statsText);
self.updateStats = function () {
var stats = ['Total Clicks: ' + totalClicks, 'Total Points Earned: ' + Math.floor(totalPointsEarned), 'Time Played: ' + Math.floor(timePlayed / 60) + ' minutes', 'Highest CPS: ' + Math.floor(highestCPS), 'Upgrades Purchased: ' + totalUpgradesPurchased, 'Prestiges: ' + prestigeLevel, 'Achievements: ' + completedAchievements + '/' + achievements.length];
statsText.setText(stats.join('\n'));
};
return self;
});
var UpgradeButton = Container.expand(function (upgradeData) {
var self = Container.call(this);
var buttonGraphics = self.attachAsset('upgradeButton', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.8,
scaleY: 0.9
});
self.upgradeData = upgradeData;
var nameText = new Text2(upgradeData.name, {
size: 28,
fill: 0xFFFFFF
});
nameText.anchor.set(0, 0.5);
nameText.x = -160;
nameText.y = -15;
self.addChild(nameText);
var costText = new Text2('Cost: ' + upgradeData.cost, {
size: 22,
fill: 0xFFFF00
});
costText.anchor.set(0, 0.5);
costText.x = -160;
costText.y = 8;
self.addChild(costText);
var countText = new Text2('Owned: ' + upgradeData.owned, {
size: 20,
fill: 0xCCCCCC
});
countText.anchor.set(1, 0.5);
countText.x = 160;
countText.y = 0;
self.addChild(countText);
self.updateDisplay = function () {
costText.setText('Cost: ' + upgradeData.cost);
countText.setText('Owned: ' + upgradeData.owned);
if (points >= upgradeData.cost) {
buttonGraphics.tint = 0xFFFFFF; // Bright white when affordable
} else {
buttonGraphics.tint = 0x666666; // Dark gray when not affordable
}
};
self.down = function (x, y, obj) {
if (points >= upgradeData.cost) {
points -= upgradeData.cost;
upgradeData.owned++;
totalUpgradesPurchased++;
if (upgradeData.type === 'click') {
pointsPerClick += upgradeData.power;
} else if (upgradeData.type === 'auto') {
pointsPerSecond += upgradeData.power;
}
// Exponential cost increase formula
upgradeData.cost = Math.floor(upgradeData.baseCost * Math.pow(1.15, upgradeData.owned));
// Play cash register sound
LK.getSound('cashRegister').play();
// Flash button pink
tween(buttonGraphics, {
tint: 0xFF69B4
}, {
duration: 200,
easing: tween.easeOut,
onFinish: function onFinish() {
updateAchievements();
updateUI();
}
});
saveGame();
}
};
return self;
});
var ZenBreathingOrb = Container.expand(function () {
var self = Container.call(this);
var orbGraphics = self.attachAsset('multiplierOrb', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.15,
scaleX: 0.8,
scaleY: 0.8
});
// Soft zen colors
var zenColors = [0x87CEEB, 0x98FB98, 0xDDA0DD, 0xF0E68C, 0xFFB6C1];
orbGraphics.tint = zenColors[Math.floor(Math.random() * zenColors.length)];
self.breathingPhase = Math.random() * Math.PI * 2;
self.baseScale = 0.6 + Math.random() * 0.4;
self.startBreathing = function () {
// Slow breathing cycle like meditation
tween(orbGraphics, {
scaleX: self.baseScale * 1.8,
scaleY: self.baseScale * 1.8,
alpha: 0.25
}, {
duration: 4000,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(orbGraphics, {
scaleX: self.baseScale,
scaleY: self.baseScale,
alpha: 0.1
}, {
duration: 4000,
easing: tween.easeInOut,
onFinish: function onFinish() {
self.startBreathing();
}
});
}
});
};
self.update = function () {
// Gentle floating movement
self.breathingPhase += 0.01;
self.y += Math.sin(self.breathingPhase) * 0.3;
self.x += Math.cos(self.breathingPhase * 0.7) * 0.2;
};
return self;
});
var ZenRipple = Container.expand(function () {
var self = Container.call(this);
var rippleGraphics = self.attachAsset('multiplierOrb', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.4,
scaleX: 0.1,
scaleY: 0.1
});
rippleGraphics.tint = 0x87CEEB; // Sky blue for peaceful ripples
self.animate = function () {
tween(rippleGraphics, {
scaleX: 8,
scaleY: 8,
alpha: 0
}, {
duration: 2500,
easing: tween.easeOut,
onFinish: function onFinish() {
self.destroy();
}
});
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x8B4B9C
});
/****
* Game Code
****/
// Game state variables
var points = 0;
var pointsPerClick = 0; // Always start at 0, will be calculated from upgrades
var pointsPerSecond = 0; // Always start at 0, will be calculated from upgrades
var totalClicks = storage.totalClicks || 0;
var currentSkin = storage.currentSkin || 0;
var skinMilestones = [0, 100, 500, 1000, 2500, 5000, 10000, 25000, 50000, 100000];
// Prestige system variables
var prestigeLevel = storage.prestigeLevel || 0;
var prestigeMultiplier = 1 + prestigeLevel * 1; // +100% per prestige level (each prestige = +1x multiplier)
var multiplierOrbs = [];
// Achievement system variables
var achievements = [];
var completedAchievements = storage.completedAchievements || 0;
var totalPointsEarned = storage.totalPointsEarned || 0;
var timePlayed = storage.timePlayed || 0;
var gameStartTime = Date.now();
var highestCPS = storage.highestCPS || 0;
var totalUpgradesPurchased = storage.totalUpgradesPurchased || 0;
// Boost system variables
var activeBoosts = {};
var boostMultiplier = 1;
// Statistics tracking
var clicksInLastSecond = 0;
var lastSecondTime = Date.now();
// Achievement definitions
var achievementDefinitions = [{
id: 'first_click',
name: 'First Click',
target: 1,
type: 'clicks',
reward: 10
}, {
id: 'hundred_clicks',
name: 'Clicking Master',
target: 100,
type: 'clicks',
reward: 100
}, {
id: 'thousand_clicks',
name: 'Click Champion',
target: 1000,
type: 'clicks',
reward: 1000
}, {
id: 'first_upgrade',
name: 'First Purchase',
target: 1,
type: 'upgrades',
reward: 50
}, {
id: 'ten_upgrades',
name: 'Shopping Spree',
target: 10,
type: 'upgrades',
reward: 500
}, {
id: 'first_prestige',
name: 'Prestige Master',
target: 1,
type: 'prestiges',
reward: 10000
}, {
id: 'million_points',
name: 'Millionaire',
target: 1000000,
type: 'points',
reward: 5000
}, {
id: 'speed_demon',
name: 'Speed Demon',
target: 10,
type: 'cps',
reward: 2000
}, {
id: 'time_played',
name: 'Dedicated Player',
target: 3600,
type: 'time',
reward: 1500
}];
// Initialize achievements from definitions and load saved progress
for (var i = 0; i < achievementDefinitions.length; i++) {
var def = achievementDefinitions[i];
var keyPrefix = 'achievement_' + def.id + '_';
achievements.push({
id: def.id,
name: def.name,
target: def.target,
type: def.type,
reward: def.reward,
current: storage[keyPrefix + 'current'] || 0,
completed: storage[keyPrefix + 'completed'] || false,
claimed: storage[keyPrefix + 'claimed'] || false
});
}
;
// Boost definitions
var boostDefinitions = [{
name: '2x Click',
type: 'click',
multiplier: 2,
duration: 30000,
cost: 1000
}, {
name: '3x Auto',
type: 'auto',
multiplier: 3,
duration: 60000,
cost: 5000
}, {
name: '5x All',
type: 'all',
multiplier: 5,
duration: 15000,
cost: 10000
}];
// Floating particles system
var floatingParticles = [];
function createFloatingParticles() {
var particleCount = 15;
for (var i = 0; i < particleCount; i++) {
var particle = new FloatingParticle();
particle.x = Math.random() * 2048;
particle.y = Math.random() * 2732;
floatingParticles.push(particle);
game.addChild(particle);
particle.startFloat();
}
}
function calculatePrestigeReward() {
return Math.floor(totalClicks / 1000000) * 0.5;
}
function createPrestigeParticles(centerX, centerY) {
for (var i = 0; i < 15; i++) {
var particle = new PrestigeParticle();
particle.x = centerX + (Math.random() - 0.5) * 100;
particle.y = centerY + (Math.random() - 0.5) * 100;
game.addChild(particle);
particle.animate();
}
}
function performPrestige() {
var reward = calculatePrestigeReward();
prestigeLevel += reward;
prestigeMultiplier = 1 + prestigeLevel * 1;
// Create particle explosion
createPrestigeParticles(summer.x, summer.y);
// Flash screen gold
LK.effects.flashScreen(0xffd700, 1500);
// Reset game state but keep prestige bonuses
points = 0;
pointsPerClick = 0;
pointsPerSecond = 0;
totalClicks = 0;
currentSkin = 0;
// Reset all upgrades
for (var i = 0; i < upgrades.length; i++) {
upgrades[i].owned = 0;
upgrades[i].cost = upgrades[i].baseCost;
}
// Create multiplier orbs around dog
createMultiplierOrbs();
// Update everything
updateUI();
summer.updateSkin();
saveGame();
}
function updateAchievements() {
for (var i = 0; i < achievements.length; i++) {
var achievement = achievements[i];
if (achievement.completed) continue;
var oldCurrent = achievement.current;
switch (achievement.type) {
case 'clicks':
achievement.current = totalClicks;
break;
case 'upgrades':
achievement.current = totalUpgradesPurchased;
break;
case 'prestiges':
achievement.current = prestigeLevel;
break;
case 'points':
achievement.current = totalPointsEarned;
break;
case 'cps':
achievement.current = highestCPS;
break;
case 'time':
achievement.current = timePlayed;
break;
}
if (achievement.current >= achievement.target && !achievement.completed) {
achievement.completed = true;
LK.effects.flashScreen(0x00FF00, 1000);
// Show achievement notification
if (achievementButtons[i]) {
achievementButtons[i].updateProgress();
}
}
}
}
function claimAchievement(achievement) {
if (achievement.completed && !achievement.claimed) {
achievement.claimed = true;
points += achievement.reward;
completedAchievements++;
LK.effects.flashScreen(0xFFD700, 500);
updateUI();
saveGame();
}
}
function activateBoost(boostData) {
activeBoosts[boostData.type] = {
multiplier: boostData.multiplier,
endTime: Date.now() + boostData.duration,
type: boostData.type
};
updateBoostMultiplier();
}
function updateBoostMultiplier() {
boostMultiplier = 1;
var currentTime = Date.now();
for (var type in activeBoosts) {
var boost = activeBoosts[type];
if (boost.endTime > currentTime) {
if (type === 'all' || type === 'click' || type === 'auto') {
boostMultiplier *= boost.multiplier;
}
} else {
delete activeBoosts[type];
}
}
}
function createMultiplierOrbs() {
// Clear existing orbs
for (var i = 0; i < multiplierOrbs.length; i++) {
multiplierOrbs[i].destroy();
}
multiplierOrbs = [];
// Create new orbs based on prestige level
var orbCount = Math.min(prestigeLevel, 8);
for (var i = 0; i < orbCount; i++) {
var orb = new MultiplierOrb();
var angle = i / orbCount * Math.PI * 2;
orb.x = summer.x + Math.cos(angle) * 300;
orb.y = summer.y + Math.sin(angle) * 200;
multiplierOrbs.push(orb);
game.addChild(orb);
orb["float"]();
// Animate orb appearance
orb.alpha = 0;
orb.scaleX = 0;
orb.scaleY = 0;
tween(orb, {
alpha: 0.8,
scaleX: 1,
scaleY: 1
}, {
duration: 800,
easing: tween.elasticOut
});
}
}
// Upgrade definitions with exponential growth - ordered from cheapest to most expensive
var upgrades = [{
name: 'Squeaky Toy',
type: 'click',
cost: storage.squeakyToyCost || 15,
baseCost: 15,
power: 1,
owned: storage.squeakyToyOwned || 0
}, {
name: 'Dog Walker',
type: 'auto',
cost: storage.dogWalkerCost || 50,
baseCost: 50,
power: 1,
owned: storage.dogWalkerOwned || 0
}, {
name: 'Tennis Ball',
type: 'click',
cost: storage.tennisBallCost || 100,
baseCost: 100,
power: 5,
owned: storage.tennisBallOwned || 0
}, {
name: 'Poop Bag Station',
type: 'auto',
cost: storage.poopBagStationCost || 500,
baseCost: 500,
power: 8,
owned: storage.poopBagStationOwned || 0
}, {
name: 'Premium Treats',
type: 'click',
cost: storage.premiumTreatsCost || 1200,
baseCost: 1200,
power: 47,
owned: storage.premiumTreatsOwned || 0
}, {
name: 'Dog Fountain',
type: 'auto',
cost: storage.dogFountainCost || 8000,
baseCost: 8000,
power: 47,
owned: storage.dogFountainOwned || 0
}, {
name: 'Chew Bone',
type: 'click',
cost: storage.chewBoneCost || 15000,
baseCost: 15000,
power: 260,
owned: storage.chewBoneOwned || 0
}, {
name: 'Agility Course',
type: 'auto',
cost: storage.agilityCourseC || 90000,
baseCost: 90000,
power: 260,
owned: storage.agilityCourseo || 0
}, {
name: 'Diamond Collar',
type: 'click',
cost: storage.diamondCollarCost || 180000,
baseCost: 180000,
power: 1400,
owned: storage.diamondCollarOwned || 0
}, {
name: 'Dog Daycare',
type: 'auto',
cost: storage.dogDaycareCost || 900000,
baseCost: 900000,
power: 1400,
owned: storage.dogDaycareOwned || 0
}, {
name: 'Golden Leash',
type: 'click',
cost: storage.goldenLeashCost || 1800000,
baseCost: 1800000,
power: 7800,
owned: storage.goldenLeashOwned || 0
}, {
name: 'Mobile Grooming Van',
type: 'auto',
cost: storage.mobileGroomingVanCost || 9000000,
baseCost: 9000000,
power: 7800,
owned: storage.mobileGroomingVanOwned || 0
}, {
name: 'Laser Pointer',
type: 'click',
cost: storage.laserPointerCost || 27000000,
baseCost: 27000000,
power: 44000,
owned: storage.laserPointerOwned || 0
}, {
name: 'Dog Hotel',
type: 'auto',
cost: storage.dogHotelCost || 135000000,
baseCost: 135000000,
power: 44000,
owned: storage.dogHotelOwned || 0
}, {
name: 'Robotic Paw',
type: 'click',
cost: storage.roboticPawCost || 540000000,
baseCost: 540000000,
power: 260000,
owned: storage.roboticPawOwned || 0
}, {
name: 'Bark Park',
type: 'auto',
cost: storage.barkParkCost || 2700000000,
baseCost: 2700000000,
power: 260000,
owned: storage.barkParkOwned || 0
}, {
name: 'Tail Wag Generator',
type: 'click',
cost: storage.tailWagGeneratorCost || 8100000000,
baseCost: 8100000000,
power: 1600000,
owned: storage.tailWagGeneratorOwned || 0
}, {
name: 'Doggy Resort Chain',
type: 'auto',
cost: storage.doggyResortChainCost || 40500000000,
baseCost: 40500000000,
power: 1600000,
owned: storage.doggyResortChainOwned || 0
}, {
name: 'Frisbee Factory',
type: 'click',
cost: storage.frisbeeFactoryCost || 121500000000,
baseCost: 121500000000,
power: 10000000,
owned: storage.frisbeeFactoryOwned || 0
}, {
name: 'Canine Island',
type: 'auto',
cost: storage.canineIslandCost || 607500000000,
baseCost: 607500000000,
power: 10000000,
owned: storage.canineIslandOwned || 0
}, {
name: 'Doghouse Empire',
type: 'click',
cost: storage.doghouseEmpireCost || 1822500000000,
baseCost: 1822500000000,
power: 65000000,
owned: storage.doghouseEmpireOwned || 0
}, {
name: 'Puppy Planet',
type: 'auto',
cost: storage.puppyPlanetCost || 9112500000000,
baseCost: 9112500000000,
power: 65000000,
owned: storage.puppyPlanetOwned || 0
}, {
name: 'Biscuit Factory',
type: 'auto',
cost: storage.biscuitFactoryCost || 136687500000000,
baseCost: 136687500000000,
power: 430000000,
owned: storage.biscuitFactoryOwned || 0
}, {
name: 'Fetch Robot Workshop',
type: 'auto',
cost: storage.fetchRobotWorkshopCost || 2733750000000000,
baseCost: 2733750000000000,
power: 2900000000,
owned: storage.fetchRobotWorkshopOwned || 0
}, {
name: 'Treat Plantation',
type: 'auto',
cost: storage.treatPlantationCost || 41006250000000000,
baseCost: 41006250000000000,
power: 21000000000,
owned: storage.treatPlantationOwned || 0
}, {
name: 'Doggy Spa Chain',
type: 'auto',
cost: storage.doggySpaChainCost || 615093750000000000,
baseCost: 615093750000000000,
power: 150000000000,
owned: storage.doggySpaChainOwned || 0
}, {
name: 'Canine Universe',
type: 'auto',
cost: storage.canineUniverseCost || 9226406250000000000,
baseCost: 9226406250000000000,
power: 1100000000000,
owned: storage.canineUniverseOwned || 0
}];
// Sort upgrades from cheapest to most expensive
upgrades.sort(function (a, b) {
return a.baseCost - b.baseCost;
});
// Load saved upgrade states
for (var i = 0; i < upgrades.length; i++) {
var upgrade = upgrades[i];
if (upgrade.type === 'click') {
pointsPerClick += upgrade.owned * upgrade.power;
} else if (upgrade.type === 'auto') {
pointsPerSecond += upgrade.owned * upgrade.power;
}
}
// UI Elements
var pointsDisplay = new Text2('Points: ' + Math.floor(points), {
size: 90,
fill: 0xFFFFFF
});
pointsDisplay.anchor.set(0.5, 0);
LK.gui.top.addChild(pointsDisplay);
var displayPerSecond = pointsPerSecond; // Track the displayed value for animation
var perSecondDisplay = new Text2('Per Second: ' + displayPerSecond, {
size: 70,
fill: 0xFFFF00
});
perSecondDisplay.anchor.set(0.5, 0);
perSecondDisplay.y = 110;
LK.gui.top.addChild(perSecondDisplay);
// Dog Park title - moved to top center to avoid overlapping with game assets
var dogParkTitle = new Text2('Summer Clicker', {
size: 80,
fill: 0x000000
});
dogParkTitle.anchor.set(0.5, 0);
dogParkTitle.x = -100;
dogParkTitle.y = 270;
LK.gui.top.addChild(dogParkTitle);
// Prestige display
var prestigeDisplay = new Text2('Prestige Level: ' + prestigeLevel + ' (x' + prestigeMultiplier.toFixed(1) + ')', {
size: 60,
fill: 0xffd700
});
prestigeDisplay.anchor.set(0.5, 0);
prestigeDisplay.y = 190;
LK.gui.top.addChild(prestigeDisplay);
// Prestige button
var prestigeButton = new PrestigeButton();
prestigeButton.x = 400;
prestigeButton.y = 950;
game.addChild(prestigeButton);
// Achievement panel
var achievementContainer = new Container();
achievementContainer.x = 50;
achievementContainer.y = 450;
game.addChild(achievementContainer);
var achievementButtons = [];
for (var i = 0; i < achievements.length; i++) {
var achievementButton = new Achievement(achievements[i]);
achievementButton.x = i % 3 * 120;
achievementButton.y = Math.floor(i / 3) * 150;
achievementButtons.push(achievementButton);
achievementContainer.addChild(achievementButton);
achievementButton.updateProgress();
}
// Boost buttons
var boostContainer = new Container();
boostContainer.x = 100;
boostContainer.y = 1150;
game.addChild(boostContainer);
var boostButtons = [];
for (var i = 0; i < boostDefinitions.length; i++) {
var boostButton = new BoostButton(boostDefinitions[i]);
boostButton.x = i * 450;
boostButton.y = 0;
boostButtons.push(boostButton);
boostContainer.addChild(boostButton);
}
// Statistics panel (initially hidden)
var statsPanel = new StatisticsPanel();
statsPanel.x = 1024;
statsPanel.y = 1366;
statsPanel.alpha = 0;
game.addChild(statsPanel);
// Statistics button
var statsButton = new Text2('STATS', {
size: 40,
fill: 0xFFFFFF
});
statsButton.anchor.set(1, 0);
statsButton.x = -20;
statsButton.y = 300;
var showingStats = false;
LK.gui.topRight.addChild(statsButton);
// Relaxation mode button
var relaxButton = new Text2('RELAX', {
size: 40,
fill: 0xE6E6FA
});
relaxButton.anchor.set(1, 0);
relaxButton.x = -20;
relaxButton.y = 360;
LK.gui.topRight.addChild(relaxButton);
relaxButton.down = function (x, y, obj) {
if (!isInRelaxationMode) {
enterRelaxationMode();
}
};
// Main summer (the dog)
var summer = game.addChild(new DogPark());
summer.x = 700; // Move further to the left
summer.y = 1500; // Move down even more
// Initialize current skin
summer.updateSkin();
// Create scrollable upgrade container
var upgradeContainer = new Container();
upgradeContainer.x = 1550; // Move further to the right
upgradeContainer.y = 450;
game.addChild(upgradeContainer);
// Upgrade buttons
var upgradeButtons = [];
for (var i = 0; i < upgrades.length; i++) {
var button = new UpgradeButton(upgrades[i]);
button.x = 0;
button.y = i * 140;
upgradeButtons.push(button);
upgradeContainer.addChild(button);
}
// Scroll variables
var scrollY = 0;
var maxScroll = Math.max(0, upgrades.length * 140 - 1600);
var lastTouchY = 0;
var isDragging = false;
// Auto-clicker timer
var autoClickTimer = 0;
function updateUI() {
pointsDisplay.setText('Points: ' + Math.floor(points));
prestigeDisplay.setText('Prestige Level: ' + prestigeLevel + ' (x' + prestigeMultiplier.toFixed(1) + ')');
// Animate per second display if value changed
var adjustedPerSecond = Math.floor(pointsPerSecond * prestigeMultiplier);
if (displayPerSecond !== adjustedPerSecond) {
tween.stop({
displayPerSecond: true
}); // Stop any existing tween
tween({
displayPerSecond: displayPerSecond
}, {
displayPerSecond: adjustedPerSecond
}, {
duration: 800,
easing: tween.easeOut,
onUpdate: function onUpdate() {
perSecondDisplay.setText('Per Second: ' + Math.floor(displayPerSecond));
},
onFinish: function onFinish() {
displayPerSecond = adjustedPerSecond;
perSecondDisplay.setText('Per Second: ' + adjustedPerSecond);
}
});
} else {
perSecondDisplay.setText('Per Second: ' + adjustedPerSecond);
}
for (var i = 0; i < upgradeButtons.length; i++) {
upgradeButtons[i].updateDisplay();
}
prestigeButton.updateDisplay();
}
function checkSkinUnlock() {
for (var i = skinMilestones.length - 1; i >= 0; i--) {
if (totalClicks >= skinMilestones[i] && currentSkin < i) {
currentSkin = i;
summer.updateSkin();
// Flash effect for skin unlock
LK.effects.flashScreen(0x00ff00, 500);
break;
}
}
}
function saveGame() {
storage.points = points;
storage.totalClicks = totalClicks;
storage.currentSkin = currentSkin;
storage.prestigeLevel = prestigeLevel;
// Save achievement data as individual keys to avoid nested objects in arrays
for (var i = 0; i < achievements.length; i++) {
var achievement = achievements[i];
var keyPrefix = 'achievement_' + achievement.id + '_';
storage[keyPrefix + 'current'] = achievement.current;
storage[keyPrefix + 'completed'] = achievement.completed;
storage[keyPrefix + 'claimed'] = achievement.claimed;
}
storage.completedAchievements = completedAchievements;
storage.totalPointsEarned = totalPointsEarned;
storage.timePlayed = timePlayed;
storage.highestCPS = highestCPS;
storage.totalUpgradesPurchased = totalUpgradesPurchased;
// Don't save pointsPerClick or pointsPerSecond - they should be calculated from upgrades
for (var i = 0; i < upgrades.length; i++) {
var upgrade = upgrades[i];
var baseName = upgrade.name.replace(/\s+/g, '');
storage[baseName.toLowerCase() + 'Cost'] = upgrade.cost;
storage[baseName.toLowerCase() + 'Owned'] = upgrade.owned;
}
// Save relaxation preferences
storage.relaxationPreferences = relaxationPreferences;
}
// Statistics button interaction
statsButton.down = function (x, y, obj) {
showingStats = !showingStats;
if (showingStats) {
statsPanel.updateStats();
tween(statsPanel, {
alpha: 1
}, {
duration: 300,
easing: tween.easeOut
});
} else {
tween(statsPanel, {
alpha: 0
}, {
duration: 300,
easing: tween.easeOut
});
}
};
// Initialize prestige orbs if player has prestige levels
if (prestigeLevel > 0) {
createMultiplierOrbs();
}
// Create floating particles for visual appeal
createFloatingParticles();
// Meditation and relaxation features
var meditationBubbles = [];
var relaxationMode = null;
var isInRelaxationMode = false;
var relaxationPreferences = storage.relaxationPreferences || {
autoRelaxationReminder: true,
bubbleIntensity: 1,
meditationSoundEnabled: true
};
function createMeditationBubbles() {
var bubbleCount = Math.floor(3 * relaxationPreferences.bubbleIntensity);
for (var i = 0; i < bubbleCount; i++) {
var bubble = new MeditationBubble();
bubble.x = Math.random() * 2048;
bubble.y = 2732 + Math.random() * 200;
meditationBubbles.push(bubble);
game.addChild(bubble);
bubble.startFloating();
}
}
function enterRelaxationMode() {
if (isInRelaxationMode) return;
isInRelaxationMode = true;
relaxationMode = new RelaxationMode();
relaxationMode.x = 1024;
relaxationMode.y = 1366;
game.addChild(relaxationMode);
relaxationMode.startRelaxation();
if (relaxationPreferences.meditationSoundEnabled) {
LK.getSound('meditation').play();
}
// Slow down all animations
for (var i = 0; i < zenBreathingOrbs.length; i++) {
tween.stop(zenBreathingOrbs[i]);
}
}
function exitRelaxationMode() {
if (!isInRelaxationMode) return;
isInRelaxationMode = false;
if (relaxationMode) {
relaxationMode.destroy();
relaxationMode = null;
}
// Resume normal zen breathing
for (var i = 0; i < zenBreathingOrbs.length; i++) {
zenBreathingOrbs[i].startBreathing();
}
}
// Create zen breathing orbs system with enhanced tranquility
var zenBreathingOrbs = [];
function createZenBreathingOrbs() {
var orbCount = 12; // More orbs for deeper zen atmosphere
for (var i = 0; i < orbCount; i++) {
var orb = new ZenBreathingOrb();
orb.x = 150 + Math.random() * 1748; // Wider distribution
orb.y = 350 + Math.random() * 2032; // Cover more area
zenBreathingOrbs.push(orb);
game.addChild(orb);
orb.startBreathing();
// Add gentle rotation for extra mesmerizing effect
tween(orb, {
rotation: orb.rotation + Math.PI * 2
}, {
duration: 30000 + Math.random() * 20000,
// Very slow rotation
easing: tween.linear,
onFinish: function onFinish() {
// Continue rotating indefinitely
tween(orb, {
rotation: orb.rotation + Math.PI * 2
}, {
duration: 30000,
easing: tween.linear
});
}
});
}
}
// Initialize zen breathing orbs
createZenBreathingOrbs();
// Create breathing guide for ultimate relaxation
var breathingGuide = new BreathingGuide();
breathingGuide.x = 1024;
breathingGuide.y = 800;
game.addChild(breathingGuide);
breathingGuide.startBreathingGuide();
// Soothing waves system
var soothingWaves = [];
function createSoothingWave() {
var wave = new SoothingWave();
wave.x = Math.random() * 2048;
wave.y = 1200 + Math.random() * 800;
soothingWaves.push(wave);
game.addChild(wave);
wave.startWave();
}
// Relaxing affirmations system
var affirmationTimer = 0;
function showRelaxingAffirmation() {
var affirmation = new RelaxingAffirmation();
affirmation.x = 1024;
affirmation.y = 600 + Math.random() * 400;
game.addChild(affirmation);
affirmation.showAffirmation();
}
// Create floating stars system
var floatingStars = [];
function createFloatingStars() {
var starCount = 20;
for (var i = 0; i < starCount; i++) {
var star = new FloatingStar();
star.x = Math.random() * 2048;
star.y = Math.random() * 2732;
floatingStars.push(star);
game.addChild(star);
star.startTwinkle();
}
}
// Zen background color wave effect
var zenColorWave = 0;
var zenColors = [0x8B4B9C,
// Original purple
0x9370DB,
// Medium slate blue
0x7B68EE,
// Medium slate blue
0x6A5ACD,
// Slate blue
0x8A2BE2 // Blue violet
];
var currentZenColorIndex = 0;
function updateZenBackgroundWave() {
zenColorWave += 0.008; // Very slow transition for zen feeling
// Transition between zen colors very slowly
if (zenColorWave >= Math.PI * 2) {
zenColorWave = 0;
currentZenColorIndex = (currentZenColorIndex + 1) % zenColors.length;
}
var nextColorIndex = (currentZenColorIndex + 1) % zenColors.length;
var currentColor = zenColors[currentZenColorIndex];
var nextColor = zenColors[nextColorIndex];
// Smooth transition between colors
var transition = (Math.sin(zenColorWave) + 1) * 0.5;
var currentRed = currentColor >> 16 & 0xFF;
var currentGreen = currentColor >> 8 & 0xFF;
var currentBlue = currentColor & 0xFF;
var nextRed = nextColor >> 16 & 0xFF;
var nextGreen = nextColor >> 8 & 0xFF;
var nextBlue = nextColor & 0xFF;
var red = Math.floor(currentRed + (nextRed - currentRed) * transition);
var green = Math.floor(currentGreen + (nextGreen - currentGreen) * transition);
var blue = Math.floor(currentBlue + (nextBlue - currentBlue) * transition);
var finalColor = red << 16 | green << 8 | blue;
game.setBackgroundColor(finalColor);
}
// Initialize floating stars
createFloatingStars();
// Initial UI update
updateUI();
// Start peaceful background music
LK.playMusic('peacefulBgMusic');
// Touch controls for scrolling
game.down = function (x, y, obj) {
if (x > 1400) {
// Adjust for new upgrade container position
isDragging = true;
lastTouchY = y;
}
};
game.up = function (x, y, obj) {
isDragging = false;
};
game.move = function (x, y, obj) {
if (isDragging && x > 1400) {
// Adjust for new upgrade container position
var deltaY = y - lastTouchY;
scrollY = Math.max(0, Math.min(maxScroll, scrollY - deltaY));
upgradeContainer.y = 400 - scrollY;
lastTouchY = y;
}
};
game.update = function () {
// Update time played
var currentTime = Date.now();
timePlayed += (currentTime - gameStartTime) / 1000;
gameStartTime = currentTime;
// Track clicks per second
if (currentTime - lastSecondTime >= 1000) {
var currentCPS = clicksInLastSecond;
if (currentCPS > highestCPS) {
highestCPS = currentCPS;
}
clicksInLastSecond = 0;
lastSecondTime = currentTime;
}
// Update active boosts
updateBoostMultiplier();
// Auto-clicker logic
autoClickTimer++;
if (autoClickTimer >= 60) {
// Every second at 60 FPS
var autoBoost = activeBoosts.auto ? activeBoosts.auto.multiplier : 1;
var allBoost = activeBoosts.all ? activeBoosts.all.multiplier : 1;
var autoPoints = pointsPerSecond * prestigeMultiplier * autoBoost * allBoost;
points += autoPoints;
totalPointsEarned += autoPoints;
autoClickTimer = 0;
updateAchievements();
updateUI();
if (pointsPerSecond > 0) {
saveGame();
}
}
// Update boost buttons
for (var i = 0; i < boostButtons.length; i++) {
boostButtons[i].updateDisplay();
}
// Update zen background wave effect
updateZenBackgroundWave();
// Update zen breathing orbs
for (var i = 0; i < zenBreathingOrbs.length; i++) {
zenBreathingOrbs[i].update();
}
// Regenerate particles that go off screen
for (var i = floatingParticles.length - 1; i >= 0; i--) {
var particle = floatingParticles[i];
if (particle.x < -100 || particle.x > 2148 || particle.y < -100 || particle.y > 2832) {
particle.destroy();
floatingParticles.splice(i, 1);
// Create new particle to replace it
var newParticle = new FloatingParticle();
newParticle.x = Math.random() * 2048;
newParticle.y = Math.random() * 2732;
floatingParticles.push(newParticle);
game.addChild(newParticle);
newParticle.startFloat();
}
}
// Regenerate stars that drift off screen
for (var i = floatingStars.length - 1; i >= 0; i--) {
var star = floatingStars[i];
// Stars wrap around automatically in their update, so no need to recreate
}
// Create occasional rainbow particle burst around summer
if (LK.ticks % 180 === 0) {
// Every 3 seconds
for (var i = 0; i < 5; i++) {
var rainbowParticle = new FloatingParticle();
rainbowParticle.x = summer.x + (Math.random() - 0.5) * 200;
rainbowParticle.y = summer.y + (Math.random() - 0.5) * 200;
floatingParticles.push(rainbowParticle);
game.addChild(rainbowParticle);
rainbowParticle.startFloat();
}
}
// Create meditation bubbles periodically
if (LK.ticks % 300 === 0) {
// Every 5 seconds
createMeditationBubbles();
}
// Create soothing waves periodically for ultimate relaxation
if (LK.ticks % 240 === 0) {
// Every 4 seconds
createSoothingWave();
}
// Show peaceful affirmations periodically
affirmationTimer++;
if (affirmationTimer >= 1800) {
// Every 30 seconds
showRelaxingAffirmation();
affirmationTimer = 0;
}
// Ambient sound cycling for deep relaxation
if (LK.ticks % 900 === 0) {
// Every 15 seconds
var ambientSounds = ['windChimes', 'gentleWaves', 'softRain'];
var randomSound = ambientSounds[Math.floor(Math.random() * ambientSounds.length)];
if (relaxationPreferences.meditationSoundEnabled) {
LK.getSound(randomSound).play();
}
}
// Switch to deeper meditation music occasionally
if (LK.ticks % 3600 === 0) {
// Every minute
if (Math.random() < 0.3) {
// 30% chance
LK.playMusic('tibetanBowls', {
fade: {
start: 0,
end: 0.2,
duration: 2000
}
});
}
}
// Update meditation bubbles
for (var i = meditationBubbles.length - 1; i >= 0; i--) {
var bubble = meditationBubbles[i];
if (bubble.y < -100) {
bubble.destroy();
meditationBubbles.splice(i, 1);
}
}
// Update relaxation mode
if (isInRelaxationMode && relaxationMode) {
relaxationMode.update();
}
// Save periodically
if (LK.ticks % 300 === 0) {
// Every 5 seconds
saveGame();
}
}; ===================================================================
--- original.js
+++ change.js
@@ -97,8 +97,67 @@
}
};
return self;
});
+var BreathingGuide = Container.expand(function () {
+ var self = Container.call(this);
+ var guideGraphics = self.attachAsset('multiplierOrb', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ alpha: 0.3,
+ scaleX: 2,
+ scaleY: 2
+ });
+ guideGraphics.tint = 0xE6E6FA; // Lavender for calming effect
+ var breathingText = new Text2('Breathe with the circle', {
+ size: 36,
+ fill: 0xF0F8FF
+ });
+ breathingText.anchor.set(0.5, 0.5);
+ breathingText.y = -150;
+ self.addChild(breathingText);
+ self.breathingCycle = 0;
+ self.isBreathingIn = true;
+ self.startBreathingGuide = function () {
+ // 4-7-8 breathing technique: inhale 4, hold 7, exhale 8
+ if (self.isBreathingIn) {
+ breathingText.setText('Breathe In Slowly...');
+ breathingText.tint = 0x98FB98;
+ tween(guideGraphics, {
+ scaleX: 4,
+ scaleY: 4,
+ alpha: 0.6
+ }, {
+ duration: 4000,
+ easing: tween.easeInOut,
+ onFinish: function onFinish() {
+ breathingText.setText('Hold...');
+ breathingText.tint = 0xFFE4B5;
+ LK.setTimeout(function () {
+ self.isBreathingIn = false;
+ self.startBreathingGuide();
+ }, 7000);
+ }
+ });
+ } else {
+ breathingText.setText('Breathe Out Slowly...');
+ breathingText.tint = 0x87CEEB;
+ tween(guideGraphics, {
+ scaleX: 2,
+ scaleY: 2,
+ alpha: 0.2
+ }, {
+ duration: 8000,
+ easing: tween.easeInOut,
+ onFinish: function onFinish() {
+ self.isBreathingIn = true;
+ self.startBreathingGuide();
+ }
+ });
+ }
+ };
+ return self;
+});
var ClickEffect = Container.expand(function () {
var self = Container.call(this);
var effectGraphics = self.attachAsset('clickEffect', {
anchorX: 0.5,
@@ -440,19 +499,33 @@
self.addChild(breathingText);
self.startRelaxation = function () {
self.breathingCycle = 0;
self.updateBreathingText();
- // Start gentle background pulse
+ // Play multiple ambient sounds for deep relaxation
+ if (relaxationPreferences.meditationSoundEnabled) {
+ LK.getSound('gentleWaves').play();
+ LK.setTimeout(function () {
+ LK.getSound('windChimes').play();
+ }, 2000);
+ LK.setTimeout(function () {
+ LK.getSound('softRain').play();
+ }, 4000);
+ }
+ // Start gentle background pulse with slower, deeper breathing rhythm
tween(overlayGraphics, {
- alpha: 0.9
+ alpha: 0.95,
+ scaleX: 4.1,
+ scaleY: 6.1
}, {
- duration: 4000,
+ duration: 6000,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(overlayGraphics, {
- alpha: 0.7
+ alpha: 0.65,
+ scaleX: 3.9,
+ scaleY: 5.9
}, {
- duration: 4000,
+ duration: 8000,
easing: tween.easeInOut,
onFinish: function onFinish() {
self.startRelaxation();
}
@@ -486,8 +559,72 @@
exitRelaxationMode();
};
return self;
});
+var RelaxingAffirmation = Container.expand(function () {
+ var self = Container.call(this);
+ var affirmations = ['You are at peace', 'Breathe and let go', 'This moment is perfect', 'You are calm and centered', 'Feel the tranquility', 'Let peace flow through you', 'You are exactly where you need to be', 'Embrace this peaceful moment'];
+ var affirmationText = new Text2(affirmations[Math.floor(Math.random() * affirmations.length)], {
+ size: 48,
+ fill: 0xE6E6FA
+ });
+ affirmationText.anchor.set(0.5, 0.5);
+ affirmationText.alpha = 0;
+ self.addChild(affirmationText);
+ self.showAffirmation = function () {
+ tween(affirmationText, {
+ alpha: 0.8,
+ scaleX: 1.1,
+ scaleY: 1.1
+ }, {
+ duration: 2000,
+ easing: tween.easeInOut,
+ onFinish: function onFinish() {
+ LK.setTimeout(function () {
+ tween(affirmationText, {
+ alpha: 0,
+ scaleX: 1,
+ scaleY: 1
+ }, {
+ duration: 2000,
+ easing: tween.easeInOut,
+ onFinish: function onFinish() {
+ self.destroy();
+ }
+ });
+ }, 3000);
+ }
+ });
+ };
+ return self;
+});
+var SoothingWave = Container.expand(function () {
+ var self = Container.call(this);
+ var waveGraphics = self.attachAsset('multiplierOrb', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ alpha: 0.1,
+ scaleX: 0.5,
+ scaleY: 0.1
+ });
+ var waveColors = [0xE0FFFF, 0xF0FFFF, 0xF5FFFA, 0xF0F8FF];
+ waveGraphics.tint = waveColors[Math.floor(Math.random() * waveColors.length)];
+ self.wavePhase = Math.random() * Math.PI * 2;
+ self.startWave = function () {
+ tween(self, {
+ scaleX: 8 + Math.random() * 4,
+ scaleY: 0.3 + Math.random() * 0.2,
+ alpha: 0
+ }, {
+ duration: 6000 + Math.random() * 4000,
+ easing: tween.easeOut,
+ onFinish: function onFinish() {
+ self.destroy();
+ }
+ });
+ };
+ return self;
+});
var StatisticsPanel = Container.expand(function () {
var self = Container.call(this);
var panelGraphics = self.attachAsset('statisticsPanel', {
anchorX: 0.5,
@@ -1403,23 +1540,65 @@
for (var i = 0; i < zenBreathingOrbs.length; i++) {
zenBreathingOrbs[i].startBreathing();
}
}
-// Create zen breathing orbs system
+// Create zen breathing orbs system with enhanced tranquility
var zenBreathingOrbs = [];
function createZenBreathingOrbs() {
- var orbCount = 8;
+ var orbCount = 12; // More orbs for deeper zen atmosphere
for (var i = 0; i < orbCount; i++) {
var orb = new ZenBreathingOrb();
- orb.x = 200 + Math.random() * 1648; // Avoid edges
- orb.y = 400 + Math.random() * 1932; // Avoid top UI
+ orb.x = 150 + Math.random() * 1748; // Wider distribution
+ orb.y = 350 + Math.random() * 2032; // Cover more area
zenBreathingOrbs.push(orb);
game.addChild(orb);
orb.startBreathing();
+ // Add gentle rotation for extra mesmerizing effect
+ tween(orb, {
+ rotation: orb.rotation + Math.PI * 2
+ }, {
+ duration: 30000 + Math.random() * 20000,
+ // Very slow rotation
+ easing: tween.linear,
+ onFinish: function onFinish() {
+ // Continue rotating indefinitely
+ tween(orb, {
+ rotation: orb.rotation + Math.PI * 2
+ }, {
+ duration: 30000,
+ easing: tween.linear
+ });
+ }
+ });
}
}
// Initialize zen breathing orbs
createZenBreathingOrbs();
+// Create breathing guide for ultimate relaxation
+var breathingGuide = new BreathingGuide();
+breathingGuide.x = 1024;
+breathingGuide.y = 800;
+game.addChild(breathingGuide);
+breathingGuide.startBreathingGuide();
+// Soothing waves system
+var soothingWaves = [];
+function createSoothingWave() {
+ var wave = new SoothingWave();
+ wave.x = Math.random() * 2048;
+ wave.y = 1200 + Math.random() * 800;
+ soothingWaves.push(wave);
+ game.addChild(wave);
+ wave.startWave();
+}
+// Relaxing affirmations system
+var affirmationTimer = 0;
+function showRelaxingAffirmation() {
+ var affirmation = new RelaxingAffirmation();
+ affirmation.x = 1024;
+ affirmation.y = 600 + Math.random() * 400;
+ game.addChild(affirmation);
+ affirmation.showAffirmation();
+}
// Create floating stars system
var floatingStars = [];
function createFloatingStars() {
var starCount = 20;
@@ -1573,8 +1752,43 @@
if (LK.ticks % 300 === 0) {
// Every 5 seconds
createMeditationBubbles();
}
+ // Create soothing waves periodically for ultimate relaxation
+ if (LK.ticks % 240 === 0) {
+ // Every 4 seconds
+ createSoothingWave();
+ }
+ // Show peaceful affirmations periodically
+ affirmationTimer++;
+ if (affirmationTimer >= 1800) {
+ // Every 30 seconds
+ showRelaxingAffirmation();
+ affirmationTimer = 0;
+ }
+ // Ambient sound cycling for deep relaxation
+ if (LK.ticks % 900 === 0) {
+ // Every 15 seconds
+ var ambientSounds = ['windChimes', 'gentleWaves', 'softRain'];
+ var randomSound = ambientSounds[Math.floor(Math.random() * ambientSounds.length)];
+ if (relaxationPreferences.meditationSoundEnabled) {
+ LK.getSound(randomSound).play();
+ }
+ }
+ // Switch to deeper meditation music occasionally
+ if (LK.ticks % 3600 === 0) {
+ // Every minute
+ if (Math.random() < 0.3) {
+ // 30% chance
+ LK.playMusic('tibetanBowls', {
+ fade: {
+ start: 0,
+ end: 0.2,
+ duration: 2000
+ }
+ });
+ }
+ }
// Update meditation bubbles
for (var i = meditationBubbles.length - 1; i >= 0; i--) {
var bubble = meditationBubbles[i];
if (bubble.y < -100) {