User prompt
If yellow paint trucks donāt exist to make them
User prompt
The yellow button on the pallet yellow that isnāt working it isnāt changing the brush color. Itās just a figure and itās not changing the color to yellow. Please fix it the brush of paint stroke, brush, stroke, paint stroke, fix that fix the paint stroke to be yellow.
User prompt
Oh my God, make the yellow spawn in yellow paint strokes of course that only happens when you dry your finger while yellow is selected
User prompt
The yellow one doesnāt change the color fix the silver brushstroke becomes yellow when the yellow is clicked
User prompt
Make new assets for like green brushstrokes, and red brushstrokes, and any color that you added to the lip strokes
User prompt
On click of the pallet color, the brushstrokes change color accordingly to the color that you pressed āŖš” Consider importing and using the following plugins: @upit/tween.v1
User prompt
JO Add colors to the paint pallet and make them work on clicked make new assets for this if you have to and sort them accordingly on the pallet
User prompt
When art mode makes summer appear under the canvas when you select from the main Game
User prompt
Make it so the art studio is accessible in the main game
User prompt
Fix everything like can possibly be a script error
User prompt
Please fix the bug: 'TypeError: null is not an object (evaluating 'artBrush.rotation')' in or related to this line: 'tween(artBrush, {' Line Number: 1740 āŖš” Consider importing and using the following plugins: @upit/tween.v1
User prompt
Art studio mode
User prompt
Ten summers float in menu āŖš” Consider importing and using the following plugins: @upit/tween.v1
User prompt
Thereās a bug where the music starts on tap
User prompt
The music starts playing right when the black screen fades āŖš” Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make it so it starts at A black screen with a text saying summer productions presents with the logo on top of the text make logo in assets and this screen last 4 seconds when the start menu appears and the name raise a summer flies in and the music starts playing āŖš” Consider importing and using the following plugins: @upit/tween.v1
User prompt
Fix literally everything in the code that can be a script error āŖš” Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'tween(groomButton, {' Line Number: 1147 āŖš” Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'tween(playButton, {' Line Number: 1078 āŖš” Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'tween(playButton, {' Line Number: 1073 āŖš” Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'tween(playButton, {' Line Number: 1073 āŖš” Consider importing and using the following plugins: @upit/tween.v1
User prompt
Improve the animation of literally everything so the game looks amazing and polished āŖš” Consider importing and using the following plugins: @upit/tween.v1 āŖš” Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make more stuff happen on the title screen it kinda looks a little bland āŖš” Consider importing and using the following plugins: @upit/tween.v1
User prompt
Just make everything over one song and forget the fading out stuff. I choose the background music over the menu music.
User prompt
Make the music play on start not on click of the dog
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Food = Container.expand(function () { var self = Container.call(this); var foodGraphics = self.attachAsset('food', { anchorX: 0.5, anchorY: 0.5 }); self.down = function (x, y, obj) { self.feed(); }; self.feed = function () { // Create food next to Summer var foodToEat = new Food(); foodToEat.x = summer.x + 60; foodToEat.y = summer.y - 50; game.addChild(foodToEat); // Animate food moving to Summer's mouth and shrinking tween(foodToEat, { x: summer.x, y: summer.y - 80, scaleX: 0.3, scaleY: 0.3 }, { duration: 800, easing: tween.easeInOut, onFinish: function onFinish() { // Make food disappear with eating animation tween(foodToEat, { alpha: 0, scaleX: 0, scaleY: 0 }, { duration: 300, easing: tween.easeIn, onFinish: function onFinish() { foodToEat.destroy(); } }); } }); hunger = Math.min(100, hunger + 20); happiness = Math.min(100, happiness + 10); updateHungerBar(); updateHappinessBar(); LK.getSound('eat').play(); LK.setTimeout(function () { LK.getSound('yummy').play(); summer.showSpeechBubble("Yummy!"); }, 500); // Remove from foods array var index = foods.indexOf(self); if (index > -1) { foods.splice(index, 1); } self.destroy(); }; return self; }); var GroomBrush = Container.expand(function () { var self = Container.call(this); var brushGraphics = self.attachAsset('groomBrush', { anchorX: 0.5, anchorY: 0.5 }); self.performGrooming = function () { // Start grooming animation - move brush back and forth tween(self, { x: self.x + 50, rotation: 0.3 }, { duration: 300, easing: tween.easeInOut, onFinish: function onFinish() { tween(self, { x: self.x - 100, rotation: -0.3 }, { duration: 400, easing: tween.easeInOut, onFinish: function onFinish() { tween(self, { x: self.x + 50, rotation: 0, alpha: 0, scaleX: 0.5, scaleY: 0.5 }, { duration: 500, easing: tween.easeOut, onFinish: function onFinish() { self.destroy(); } }); } }); } }); }; return self; }); var Heart = Container.expand(function () { var self = Container.call(this); var heartGraphics = self.attachAsset('heart', { anchorX: 0.5, anchorY: 0.5 }); self.floatUp = function () { tween(self, { y: self.y - 150, alpha: 0 }, { duration: 1500, easing: tween.easeOut, onFinish: function onFinish() { var index = hearts.indexOf(self); if (index > -1) { hearts.splice(index, 1); } self.destroy(); } }); }; return self; }); var Summer = Container.expand(function () { var self = Container.call(this); var summerGraphics = self.attachAsset('summer', { anchorX: 0.5, anchorY: 1.0 }); self.originalScale = 1.0; self.isAnimating = false; self.down = function (x, y, obj) { if (!self.isAnimating) { self.pet(); } }; self.pet = function () { happiness = Math.min(100, happiness + 5); updateHappinessBar(); LK.getSound('bark').play(); self.createHeart(); self.bounce(); self.showSpeechBubble("Woof!"); }; self.createHeart = function () { var heart = new Heart(); heart.x = self.x + (Math.random() - 0.5) * 100; heart.y = self.y - 50; game.addChild(heart); hearts.push(heart); }; self.bounce = function () { if (self.isAnimating) return; self.isAnimating = true; tween(self, { scaleX: 1.2, scaleY: 1.2 }, { duration: 200, easing: tween.easeOut, onFinish: function onFinish() { tween(self, { scaleX: self.originalScale, scaleY: self.originalScale }, { duration: 200, easing: tween.easeIn, onFinish: function onFinish() { self.isAnimating = false; } }); } }); }; self.playAnimation = function () { if (self.isAnimating) return; self.isAnimating = true; tween(self, { rotation: 0.2 }, { duration: 300, easing: tween.easeInOut, onFinish: function onFinish() { tween(self, { rotation: -0.2 }, { duration: 300, easing: tween.easeInOut, onFinish: function onFinish() { tween(self, { rotation: 0 }, { duration: 300, easing: tween.easeInOut, onFinish: function onFinish() { self.isAnimating = false; } }); } }); } }); }; self.showSpeechBubble = function (text) { var speechBubble = new Text2(text, { size: 40, fill: 0x000000 }); speechBubble.anchor.set(0.5, 1); speechBubble.x = self.x; speechBubble.y = self.y - summerGraphics.height / 2 - 20; // Position above Summer's head game.addChild(speechBubble); tween(speechBubble, { alpha: 0, y: speechBubble.y - 50 }, { duration: 1500, easing: tween.easeOut, onFinish: function onFinish() { speechBubble.destroy(); } }); }; return self; }); var Toy = Container.expand(function () { var self = Container.call(this); var toyGraphics = self.attachAsset('toy', { anchorX: 0.5, anchorY: 0.5 }); self.isDragging = false; self.down = function (x, y, obj) { self.isDragging = true; self.startDragX = x; self.startDragY = y; }; self.checkPlayInteraction = function () { var distance = Math.sqrt(Math.pow(self.x - summer.x, 2) + Math.pow(self.y - summer.y, 2)); if (distance < 150) { happiness = Math.min(100, happiness + 15); updateHappinessBar(); LK.getSound('play').play(); summer.playAnimation(); summer.showSpeechBubble("Zoomies!"); // Remove from toys array var index = toys.indexOf(self); if (index > -1) { toys.splice(index, 1); } self.destroy(); } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0xFFB6C1 }); /**** * Game Code ****/ var gameState = 'menu'; // 'menu' or 'playing' var menuSummer = null; var gamePlayElements = []; var happiness = 100; var hunger = 100; var foods = []; var toys = []; var hearts = []; var draggedToy = null; var summer = null; var happinessBarFill = null; var hungerBarFill = null; var happinessText = null; var hungerText = null; // Create main menu function createMainMenu() { // Play menu music LK.playMusic('menumusic', { loop: true }); // Game title var titleText = new Text2('RAISE A SUMMER', { size: 120, fill: 0xFFFFFF }); titleText.anchor.set(0.5, 0.5); titleText.x = 1024; titleText.y = 800; game.addChild(titleText); // Play button var playButton = game.addChild(LK.getAsset('barBackground', { anchorX: 0.5, anchorY: 0.5 })); playButton.width = 400; playButton.height = 150; playButton.x = 1024; playButton.y = 1400; playButton.tint = 0x32CD32; var playButtonText = new Text2('PLAY', { size: 80, fill: 0xFFFFFF }); playButtonText.anchor.set(0.5, 0.5); playButtonText.x = playButton.x; playButtonText.y = playButton.y; game.addChild(playButtonText); // Floating Summer in background menuSummer = game.addChild(new Summer()); menuSummer.x = 1024; menuSummer.y = 2000; // Start floating animation startFloatingAnimation(); // Store menu elements for cleanup gamePlayElements = [titleText, playButton, playButtonText]; } function startFloatingAnimation() { if (!menuSummer) return; // Random floating movement - use full screen dimensions with boundaries // Screen is 2048x2732, leave margin for Summer's size (200px) var margin = 100; var targetX = margin + Math.random() * (2048 - 2 * margin); var targetY = margin + Math.random() * (2732 - 2 * margin); tween(menuSummer, { x: targetX, y: targetY, rotation: (Math.random() - 0.5) * 0.5 }, { duration: 3000 + Math.random() * 2000, easing: tween.easeInOut, onFinish: function onFinish() { // Do a flip if (!menuSummer) return; tween(menuSummer, { rotation: menuSummer.rotation + Math.PI * 2 }, { duration: 800, easing: tween.easeInOut, onFinish: function onFinish() { // Continue floating startFloatingAnimation(); } }); } }); } function startGame() { // Stop menu music and start game music LK.stopMusic(); LK.playMusic('bgmusic', { loop: true }); // Remove menu elements for (var i = 0; i < gamePlayElements.length; i++) { gamePlayElements[i].destroy(); } gamePlayElements = []; // Remove menu Summer if (menuSummer) { menuSummer.destroy(); menuSummer = null; } // Create game Summer summer = game.addChild(new Summer()); summer.x = 1024; summer.y = 2200; // Create game UI and elements createGameUI(); gameState = 'playing'; } function createGameUI() { // Create UI bars var happinessBarBg = game.addChild(LK.getAsset('barBackground', { anchorX: 0, anchorY: 0 })); happinessBarBg.x = 200; happinessBarBg.y = 150; happinessBarFill = game.addChild(LK.getAsset('happinessBar', { anchorX: 0, anchorY: 0 })); happinessBarFill.x = 200; happinessBarFill.y = 150; var hungerBarBg = game.addChild(LK.getAsset('barBackground', { anchorX: 0, anchorY: 0 })); hungerBarBg.x = 200; hungerBarBg.y = 250; hungerBarFill = game.addChild(LK.getAsset('hungerBar', { anchorX: 0, anchorY: 0 })); hungerBarFill.x = 200; hungerBarFill.y = 250; // Create UI text happinessText = new Text2('Happiness: 100', { size: 50, fill: 0x000000 }); happinessText.anchor.set(0, 0.5); happinessText.x = 650; happinessText.y = 170; game.addChild(happinessText); hungerText = new Text2('Hunger: 100', { size: 50, fill: 0x000000 }); hungerText.anchor.set(0, 0.5); hungerText.x = 650; hungerText.y = 270; game.addChild(hungerText); var instructionText = new Text2('Use buttons below to care for Summer!', { size: 40, fill: 0x333333 }); instructionText.anchor.set(0.5, 1); instructionText.x = 1024; instructionText.y = 2680; game.addChild(instructionText); // Create command buttons var buttonWidth = 300; var buttonHeight = 120; var buttonY = 2400; var buttonSpacing = 400; // Pet button var petButton = game.addChild(LK.getAsset('barBackground', { anchorX: 0.5, anchorY: 0.5 })); petButton.width = buttonWidth; petButton.height = buttonHeight; petButton.x = 300; petButton.y = buttonY; petButton.tint = 0xFF69B4; var petButtonText = new Text2('PET', { size: 50, fill: 0xFFFFFF }); petButtonText.anchor.set(0.5, 0.5); petButtonText.x = petButton.x; petButtonText.y = petButton.y; game.addChild(petButtonText); // Feed button var feedButton = game.addChild(LK.getAsset('barBackground', { anchorX: 0.5, anchorY: 0.5 })); feedButton.width = buttonWidth; feedButton.height = buttonHeight; feedButton.x = 700; feedButton.y = buttonY; feedButton.tint = 0x32CD32; var feedButtonText = new Text2('FEED', { size: 50, fill: 0xFFFFFF }); feedButtonText.anchor.set(0.5, 0.5); feedButtonText.x = feedButton.x; feedButtonText.y = feedButton.y; game.addChild(feedButtonText); // Play button var playButton = game.addChild(LK.getAsset('barBackground', { anchorX: 0.5, anchorY: 0.5 })); playButton.width = buttonWidth; playButton.height = buttonHeight; playButton.x = 1100; playButton.y = buttonY; playButton.tint = 0x4169E1; var playButtonText = new Text2('PLAY', { size: 50, fill: 0xFFFFFF }); playButtonText.anchor.set(0.5, 0.5); playButtonText.x = playButton.x; playButtonText.y = playButton.y; game.addChild(playButtonText); // Groom button var groomButton = game.addChild(LK.getAsset('barBackground', { anchorX: 0.5, anchorY: 0.5 })); groomButton.width = buttonWidth; groomButton.height = buttonHeight; groomButton.x = 1500; groomButton.y = buttonY; groomButton.tint = 0x9370DB; var groomButtonText = new Text2('GROOM', { size: 50, fill: 0xFFFFFF }); groomButtonText.anchor.set(0.5, 0.5); groomButtonText.x = groomButton.x; groomButtonText.y = groomButton.y; game.addChild(groomButtonText); // Initial spawn spawnFood(); spawnToy(); } // Timers var hungerTimer = 0; var happinessTimer = 0; var foodSpawnTimer = 0; var toySpawnTimer = 0; // Initialize main menu createMainMenu(); // Ensure menu music starts playing immediately LK.playMusic('menumusic', { loop: true }); function updateHappinessBar() { var percentage = happiness / 100; if (happinessBarFill) { happinessBarFill.width = 400 * percentage; if (happiness > 60) { happinessBarFill.tint = 0x00FF00; } else if (happiness > 30) { happinessBarFill.tint = 0xFFFF00; } else { happinessBarFill.tint = 0xFF0000; } } if (happinessText) { happinessText.setText('Happiness: ' + happiness); } } function updateHungerBar() { var percentage = hunger / 100; if (hungerBarFill) { hungerBarFill.width = 400 * percentage; if (hunger > 60) { hungerBarFill.tint = 0x00FF00; } else if (hunger > 30) { hungerBarFill.tint = 0xFFFF00; } else { hungerBarFill.tint = 0xFF0000; } } if (hungerText) { hungerText.setText('Hunger: ' + hunger); } } function spawnFood() { if (foods.length < 4) { var food = new Food(); food.x = Math.random() * 1800 + 124; food.y = Math.random() * 1000 + 400; foods.push(food); game.addChild(food); } } function spawnToy() { if (toys.length < 2) { var toy = new Toy(); toy.x = Math.random() * 1800 + 124; toy.y = Math.random() * 1000 + 400; toys.push(toy); game.addChild(toy); } } game.move = function (x, y, obj) { if (draggedToy) { draggedToy.x = x; draggedToy.y = y; } }; game.down = function (x, y, obj) { // Handle menu state if (gameState === 'menu') { // Check for play button click (centered at 1024, 1400) if (x >= 824 && x <= 1224 && y >= 1325 && y <= 1475) { startGame(); return; } return; } // Handle gameplay state if (gameState === 'playing') { // Check button clicks var buttonY = 2400; var buttonHeight = 120; var buttonWidth = 300; // Check if clicking in button area if (y >= buttonY - buttonHeight / 2 && y <= buttonY + buttonHeight / 2) { // Pet button if (x >= 300 - buttonWidth / 2 && x <= 300 + buttonWidth / 2) { summer.pet(); return; } // Feed button if (x >= 700 - buttonWidth / 2 && x <= 700 + buttonWidth / 2) { // Create food next to Summer var foodToEat = new Food(); foodToEat.x = summer.x + 60; foodToEat.y = summer.y - 50; game.addChild(foodToEat); // Animate food moving to Summer's mouth and shrinking tween(foodToEat, { x: summer.x, y: summer.y - 80, scaleX: 0.3, scaleY: 0.3 }, { duration: 800, easing: tween.easeInOut, onFinish: function onFinish() { // Make food disappear with eating animation tween(foodToEat, { alpha: 0, scaleX: 0, scaleY: 0 }, { duration: 300, easing: tween.easeIn, onFinish: function onFinish() { foodToEat.destroy(); } }); } }); hunger = Math.min(100, hunger + 20); happiness = Math.min(100, happiness + 10); updateHungerBar(); updateHappinessBar(); LK.getSound('eat').play(); LK.setTimeout(function () { LK.getSound('yummy').play(); summer.showSpeechBubble("Yummy!"); }, 500); return; } // Play button if (x >= 1100 - buttonWidth / 2 && x <= 1100 + buttonWidth / 2) { happiness = Math.min(100, happiness + 15); updateHappinessBar(); LK.getSound('play').play(); // Find nearest toy to chase var nearestToy = null; var nearestDistance = Infinity; for (var i = 0; i < toys.length; i++) { var toy = toys[i]; var distance = Math.sqrt(Math.pow(summer.x - toy.x, 2) + Math.pow(summer.y - toy.y, 2)); if (distance < nearestDistance) { nearestDistance = distance; nearestToy = toy; } } // Chase the nearest toy if one exists if (nearestToy && !summer.isAnimating) { summer.isAnimating = true; // Store original position var originalX = summer.x; var originalY = summer.y; // Chase animation - move Summer towards the toy tween(summer, { x: nearestToy.x, y: nearestToy.y }, { duration: 1000, easing: tween.easeInOut, onFinish: function onFinish() { // Play animation when reaching the toy summer.playAnimation(); // Return to original position after play animation LK.setTimeout(function () { tween(summer, { x: originalX, y: originalY }, { duration: 1000, easing: tween.easeInOut, onFinish: function onFinish() { summer.isAnimating = false; } }); }, 900); // Wait for play animation to finish } }); } else { summer.playAnimation(); } return; } // Groom button if (x >= 1500 - buttonWidth / 2 && x <= 1500 + buttonWidth / 2) { happiness = Math.min(100, happiness + 8); updateHappinessBar(); LK.getSound('groom').play(); summer.bounce(); summer.showSpeechBubble("So fresh!"); // Spawn grooming brush near Summer var groomBrush = new GroomBrush(); groomBrush.x = summer.x - 80; groomBrush.y = summer.y - 100; game.addChild(groomBrush); groomBrush.performGrooming(); return; } } // Check if clicking on a toy for (var i = 0; i < toys.length; i++) { var toy = toys[i]; var distance = Math.sqrt(Math.pow(x - toy.x, 2) + Math.pow(y - toy.y, 2)); if (distance < 50) { draggedToy = toy; break; } } } }; game.up = function (x, y, obj) { if (draggedToy) { draggedToy.checkPlayInteraction(); draggedToy = null; } }; game.update = function () { // Only run game logic during gameplay if (gameState === 'playing') { // Update timers hungerTimer++; happinessTimer++; foodSpawnTimer++; toySpawnTimer++; // Hunger decreases every 5 seconds (300 ticks) if (hungerTimer >= 300) { hunger = Math.max(0, hunger - 1); updateHungerBar(); hungerTimer = 0; } // Happiness decreases every 10 seconds (600 ticks) or faster when hungry var happinessDecayRate = hunger < 30 ? 300 : 600; if (happinessTimer >= happinessDecayRate) { happiness = Math.max(0, happiness - 1); updateHappinessBar(); happinessTimer = 0; } // Spawn food every 30 seconds (1800 ticks) if (foodSpawnTimer >= 1800) { spawnFood(); foodSpawnTimer = 0; } // Spawn toys every 45 seconds (2700 ticks) if (toySpawnTimer >= 2700) { spawnToy(); toySpawnTimer = 0; } // Update floating hearts for (var i = hearts.length - 1; i >= 0; i--) { var heart = hearts[i]; if (heart.alpha === 1) { heart.floatUp(); } } // Check game over condition if (happiness <= 0 && hunger <= 0) { LK.showGameOver(); } } };
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Food = Container.expand(function () {
var self = Container.call(this);
var foodGraphics = self.attachAsset('food', {
anchorX: 0.5,
anchorY: 0.5
});
self.down = function (x, y, obj) {
self.feed();
};
self.feed = function () {
// Create food next to Summer
var foodToEat = new Food();
foodToEat.x = summer.x + 60;
foodToEat.y = summer.y - 50;
game.addChild(foodToEat);
// Animate food moving to Summer's mouth and shrinking
tween(foodToEat, {
x: summer.x,
y: summer.y - 80,
scaleX: 0.3,
scaleY: 0.3
}, {
duration: 800,
easing: tween.easeInOut,
onFinish: function onFinish() {
// Make food disappear with eating animation
tween(foodToEat, {
alpha: 0,
scaleX: 0,
scaleY: 0
}, {
duration: 300,
easing: tween.easeIn,
onFinish: function onFinish() {
foodToEat.destroy();
}
});
}
});
hunger = Math.min(100, hunger + 20);
happiness = Math.min(100, happiness + 10);
updateHungerBar();
updateHappinessBar();
LK.getSound('eat').play();
LK.setTimeout(function () {
LK.getSound('yummy').play();
summer.showSpeechBubble("Yummy!");
}, 500);
// Remove from foods array
var index = foods.indexOf(self);
if (index > -1) {
foods.splice(index, 1);
}
self.destroy();
};
return self;
});
var GroomBrush = Container.expand(function () {
var self = Container.call(this);
var brushGraphics = self.attachAsset('groomBrush', {
anchorX: 0.5,
anchorY: 0.5
});
self.performGrooming = function () {
// Start grooming animation - move brush back and forth
tween(self, {
x: self.x + 50,
rotation: 0.3
}, {
duration: 300,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(self, {
x: self.x - 100,
rotation: -0.3
}, {
duration: 400,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(self, {
x: self.x + 50,
rotation: 0,
alpha: 0,
scaleX: 0.5,
scaleY: 0.5
}, {
duration: 500,
easing: tween.easeOut,
onFinish: function onFinish() {
self.destroy();
}
});
}
});
}
});
};
return self;
});
var Heart = Container.expand(function () {
var self = Container.call(this);
var heartGraphics = self.attachAsset('heart', {
anchorX: 0.5,
anchorY: 0.5
});
self.floatUp = function () {
tween(self, {
y: self.y - 150,
alpha: 0
}, {
duration: 1500,
easing: tween.easeOut,
onFinish: function onFinish() {
var index = hearts.indexOf(self);
if (index > -1) {
hearts.splice(index, 1);
}
self.destroy();
}
});
};
return self;
});
var Summer = Container.expand(function () {
var self = Container.call(this);
var summerGraphics = self.attachAsset('summer', {
anchorX: 0.5,
anchorY: 1.0
});
self.originalScale = 1.0;
self.isAnimating = false;
self.down = function (x, y, obj) {
if (!self.isAnimating) {
self.pet();
}
};
self.pet = function () {
happiness = Math.min(100, happiness + 5);
updateHappinessBar();
LK.getSound('bark').play();
self.createHeart();
self.bounce();
self.showSpeechBubble("Woof!");
};
self.createHeart = function () {
var heart = new Heart();
heart.x = self.x + (Math.random() - 0.5) * 100;
heart.y = self.y - 50;
game.addChild(heart);
hearts.push(heart);
};
self.bounce = function () {
if (self.isAnimating) return;
self.isAnimating = true;
tween(self, {
scaleX: 1.2,
scaleY: 1.2
}, {
duration: 200,
easing: tween.easeOut,
onFinish: function onFinish() {
tween(self, {
scaleX: self.originalScale,
scaleY: self.originalScale
}, {
duration: 200,
easing: tween.easeIn,
onFinish: function onFinish() {
self.isAnimating = false;
}
});
}
});
};
self.playAnimation = function () {
if (self.isAnimating) return;
self.isAnimating = true;
tween(self, {
rotation: 0.2
}, {
duration: 300,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(self, {
rotation: -0.2
}, {
duration: 300,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(self, {
rotation: 0
}, {
duration: 300,
easing: tween.easeInOut,
onFinish: function onFinish() {
self.isAnimating = false;
}
});
}
});
}
});
};
self.showSpeechBubble = function (text) {
var speechBubble = new Text2(text, {
size: 40,
fill: 0x000000
});
speechBubble.anchor.set(0.5, 1);
speechBubble.x = self.x;
speechBubble.y = self.y - summerGraphics.height / 2 - 20; // Position above Summer's head
game.addChild(speechBubble);
tween(speechBubble, {
alpha: 0,
y: speechBubble.y - 50
}, {
duration: 1500,
easing: tween.easeOut,
onFinish: function onFinish() {
speechBubble.destroy();
}
});
};
return self;
});
var Toy = Container.expand(function () {
var self = Container.call(this);
var toyGraphics = self.attachAsset('toy', {
anchorX: 0.5,
anchorY: 0.5
});
self.isDragging = false;
self.down = function (x, y, obj) {
self.isDragging = true;
self.startDragX = x;
self.startDragY = y;
};
self.checkPlayInteraction = function () {
var distance = Math.sqrt(Math.pow(self.x - summer.x, 2) + Math.pow(self.y - summer.y, 2));
if (distance < 150) {
happiness = Math.min(100, happiness + 15);
updateHappinessBar();
LK.getSound('play').play();
summer.playAnimation();
summer.showSpeechBubble("Zoomies!");
// Remove from toys array
var index = toys.indexOf(self);
if (index > -1) {
toys.splice(index, 1);
}
self.destroy();
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0xFFB6C1
});
/****
* Game Code
****/
var gameState = 'menu'; // 'menu' or 'playing'
var menuSummer = null;
var gamePlayElements = [];
var happiness = 100;
var hunger = 100;
var foods = [];
var toys = [];
var hearts = [];
var draggedToy = null;
var summer = null;
var happinessBarFill = null;
var hungerBarFill = null;
var happinessText = null;
var hungerText = null;
// Create main menu
function createMainMenu() {
// Play menu music
LK.playMusic('menumusic', {
loop: true
});
// Game title
var titleText = new Text2('RAISE A SUMMER', {
size: 120,
fill: 0xFFFFFF
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 1024;
titleText.y = 800;
game.addChild(titleText);
// Play button
var playButton = game.addChild(LK.getAsset('barBackground', {
anchorX: 0.5,
anchorY: 0.5
}));
playButton.width = 400;
playButton.height = 150;
playButton.x = 1024;
playButton.y = 1400;
playButton.tint = 0x32CD32;
var playButtonText = new Text2('PLAY', {
size: 80,
fill: 0xFFFFFF
});
playButtonText.anchor.set(0.5, 0.5);
playButtonText.x = playButton.x;
playButtonText.y = playButton.y;
game.addChild(playButtonText);
// Floating Summer in background
menuSummer = game.addChild(new Summer());
menuSummer.x = 1024;
menuSummer.y = 2000;
// Start floating animation
startFloatingAnimation();
// Store menu elements for cleanup
gamePlayElements = [titleText, playButton, playButtonText];
}
function startFloatingAnimation() {
if (!menuSummer) return;
// Random floating movement - use full screen dimensions with boundaries
// Screen is 2048x2732, leave margin for Summer's size (200px)
var margin = 100;
var targetX = margin + Math.random() * (2048 - 2 * margin);
var targetY = margin + Math.random() * (2732 - 2 * margin);
tween(menuSummer, {
x: targetX,
y: targetY,
rotation: (Math.random() - 0.5) * 0.5
}, {
duration: 3000 + Math.random() * 2000,
easing: tween.easeInOut,
onFinish: function onFinish() {
// Do a flip
if (!menuSummer) return;
tween(menuSummer, {
rotation: menuSummer.rotation + Math.PI * 2
}, {
duration: 800,
easing: tween.easeInOut,
onFinish: function onFinish() {
// Continue floating
startFloatingAnimation();
}
});
}
});
}
function startGame() {
// Stop menu music and start game music
LK.stopMusic();
LK.playMusic('bgmusic', {
loop: true
});
// Remove menu elements
for (var i = 0; i < gamePlayElements.length; i++) {
gamePlayElements[i].destroy();
}
gamePlayElements = [];
// Remove menu Summer
if (menuSummer) {
menuSummer.destroy();
menuSummer = null;
}
// Create game Summer
summer = game.addChild(new Summer());
summer.x = 1024;
summer.y = 2200;
// Create game UI and elements
createGameUI();
gameState = 'playing';
}
function createGameUI() {
// Create UI bars
var happinessBarBg = game.addChild(LK.getAsset('barBackground', {
anchorX: 0,
anchorY: 0
}));
happinessBarBg.x = 200;
happinessBarBg.y = 150;
happinessBarFill = game.addChild(LK.getAsset('happinessBar', {
anchorX: 0,
anchorY: 0
}));
happinessBarFill.x = 200;
happinessBarFill.y = 150;
var hungerBarBg = game.addChild(LK.getAsset('barBackground', {
anchorX: 0,
anchorY: 0
}));
hungerBarBg.x = 200;
hungerBarBg.y = 250;
hungerBarFill = game.addChild(LK.getAsset('hungerBar', {
anchorX: 0,
anchorY: 0
}));
hungerBarFill.x = 200;
hungerBarFill.y = 250;
// Create UI text
happinessText = new Text2('Happiness: 100', {
size: 50,
fill: 0x000000
});
happinessText.anchor.set(0, 0.5);
happinessText.x = 650;
happinessText.y = 170;
game.addChild(happinessText);
hungerText = new Text2('Hunger: 100', {
size: 50,
fill: 0x000000
});
hungerText.anchor.set(0, 0.5);
hungerText.x = 650;
hungerText.y = 270;
game.addChild(hungerText);
var instructionText = new Text2('Use buttons below to care for Summer!', {
size: 40,
fill: 0x333333
});
instructionText.anchor.set(0.5, 1);
instructionText.x = 1024;
instructionText.y = 2680;
game.addChild(instructionText);
// Create command buttons
var buttonWidth = 300;
var buttonHeight = 120;
var buttonY = 2400;
var buttonSpacing = 400;
// Pet button
var petButton = game.addChild(LK.getAsset('barBackground', {
anchorX: 0.5,
anchorY: 0.5
}));
petButton.width = buttonWidth;
petButton.height = buttonHeight;
petButton.x = 300;
petButton.y = buttonY;
petButton.tint = 0xFF69B4;
var petButtonText = new Text2('PET', {
size: 50,
fill: 0xFFFFFF
});
petButtonText.anchor.set(0.5, 0.5);
petButtonText.x = petButton.x;
petButtonText.y = petButton.y;
game.addChild(petButtonText);
// Feed button
var feedButton = game.addChild(LK.getAsset('barBackground', {
anchorX: 0.5,
anchorY: 0.5
}));
feedButton.width = buttonWidth;
feedButton.height = buttonHeight;
feedButton.x = 700;
feedButton.y = buttonY;
feedButton.tint = 0x32CD32;
var feedButtonText = new Text2('FEED', {
size: 50,
fill: 0xFFFFFF
});
feedButtonText.anchor.set(0.5, 0.5);
feedButtonText.x = feedButton.x;
feedButtonText.y = feedButton.y;
game.addChild(feedButtonText);
// Play button
var playButton = game.addChild(LK.getAsset('barBackground', {
anchorX: 0.5,
anchorY: 0.5
}));
playButton.width = buttonWidth;
playButton.height = buttonHeight;
playButton.x = 1100;
playButton.y = buttonY;
playButton.tint = 0x4169E1;
var playButtonText = new Text2('PLAY', {
size: 50,
fill: 0xFFFFFF
});
playButtonText.anchor.set(0.5, 0.5);
playButtonText.x = playButton.x;
playButtonText.y = playButton.y;
game.addChild(playButtonText);
// Groom button
var groomButton = game.addChild(LK.getAsset('barBackground', {
anchorX: 0.5,
anchorY: 0.5
}));
groomButton.width = buttonWidth;
groomButton.height = buttonHeight;
groomButton.x = 1500;
groomButton.y = buttonY;
groomButton.tint = 0x9370DB;
var groomButtonText = new Text2('GROOM', {
size: 50,
fill: 0xFFFFFF
});
groomButtonText.anchor.set(0.5, 0.5);
groomButtonText.x = groomButton.x;
groomButtonText.y = groomButton.y;
game.addChild(groomButtonText);
// Initial spawn
spawnFood();
spawnToy();
}
// Timers
var hungerTimer = 0;
var happinessTimer = 0;
var foodSpawnTimer = 0;
var toySpawnTimer = 0;
// Initialize main menu
createMainMenu();
// Ensure menu music starts playing immediately
LK.playMusic('menumusic', {
loop: true
});
function updateHappinessBar() {
var percentage = happiness / 100;
if (happinessBarFill) {
happinessBarFill.width = 400 * percentage;
if (happiness > 60) {
happinessBarFill.tint = 0x00FF00;
} else if (happiness > 30) {
happinessBarFill.tint = 0xFFFF00;
} else {
happinessBarFill.tint = 0xFF0000;
}
}
if (happinessText) {
happinessText.setText('Happiness: ' + happiness);
}
}
function updateHungerBar() {
var percentage = hunger / 100;
if (hungerBarFill) {
hungerBarFill.width = 400 * percentage;
if (hunger > 60) {
hungerBarFill.tint = 0x00FF00;
} else if (hunger > 30) {
hungerBarFill.tint = 0xFFFF00;
} else {
hungerBarFill.tint = 0xFF0000;
}
}
if (hungerText) {
hungerText.setText('Hunger: ' + hunger);
}
}
function spawnFood() {
if (foods.length < 4) {
var food = new Food();
food.x = Math.random() * 1800 + 124;
food.y = Math.random() * 1000 + 400;
foods.push(food);
game.addChild(food);
}
}
function spawnToy() {
if (toys.length < 2) {
var toy = new Toy();
toy.x = Math.random() * 1800 + 124;
toy.y = Math.random() * 1000 + 400;
toys.push(toy);
game.addChild(toy);
}
}
game.move = function (x, y, obj) {
if (draggedToy) {
draggedToy.x = x;
draggedToy.y = y;
}
};
game.down = function (x, y, obj) {
// Handle menu state
if (gameState === 'menu') {
// Check for play button click (centered at 1024, 1400)
if (x >= 824 && x <= 1224 && y >= 1325 && y <= 1475) {
startGame();
return;
}
return;
}
// Handle gameplay state
if (gameState === 'playing') {
// Check button clicks
var buttonY = 2400;
var buttonHeight = 120;
var buttonWidth = 300;
// Check if clicking in button area
if (y >= buttonY - buttonHeight / 2 && y <= buttonY + buttonHeight / 2) {
// Pet button
if (x >= 300 - buttonWidth / 2 && x <= 300 + buttonWidth / 2) {
summer.pet();
return;
}
// Feed button
if (x >= 700 - buttonWidth / 2 && x <= 700 + buttonWidth / 2) {
// Create food next to Summer
var foodToEat = new Food();
foodToEat.x = summer.x + 60;
foodToEat.y = summer.y - 50;
game.addChild(foodToEat);
// Animate food moving to Summer's mouth and shrinking
tween(foodToEat, {
x: summer.x,
y: summer.y - 80,
scaleX: 0.3,
scaleY: 0.3
}, {
duration: 800,
easing: tween.easeInOut,
onFinish: function onFinish() {
// Make food disappear with eating animation
tween(foodToEat, {
alpha: 0,
scaleX: 0,
scaleY: 0
}, {
duration: 300,
easing: tween.easeIn,
onFinish: function onFinish() {
foodToEat.destroy();
}
});
}
});
hunger = Math.min(100, hunger + 20);
happiness = Math.min(100, happiness + 10);
updateHungerBar();
updateHappinessBar();
LK.getSound('eat').play();
LK.setTimeout(function () {
LK.getSound('yummy').play();
summer.showSpeechBubble("Yummy!");
}, 500);
return;
}
// Play button
if (x >= 1100 - buttonWidth / 2 && x <= 1100 + buttonWidth / 2) {
happiness = Math.min(100, happiness + 15);
updateHappinessBar();
LK.getSound('play').play();
// Find nearest toy to chase
var nearestToy = null;
var nearestDistance = Infinity;
for (var i = 0; i < toys.length; i++) {
var toy = toys[i];
var distance = Math.sqrt(Math.pow(summer.x - toy.x, 2) + Math.pow(summer.y - toy.y, 2));
if (distance < nearestDistance) {
nearestDistance = distance;
nearestToy = toy;
}
}
// Chase the nearest toy if one exists
if (nearestToy && !summer.isAnimating) {
summer.isAnimating = true;
// Store original position
var originalX = summer.x;
var originalY = summer.y;
// Chase animation - move Summer towards the toy
tween(summer, {
x: nearestToy.x,
y: nearestToy.y
}, {
duration: 1000,
easing: tween.easeInOut,
onFinish: function onFinish() {
// Play animation when reaching the toy
summer.playAnimation();
// Return to original position after play animation
LK.setTimeout(function () {
tween(summer, {
x: originalX,
y: originalY
}, {
duration: 1000,
easing: tween.easeInOut,
onFinish: function onFinish() {
summer.isAnimating = false;
}
});
}, 900); // Wait for play animation to finish
}
});
} else {
summer.playAnimation();
}
return;
}
// Groom button
if (x >= 1500 - buttonWidth / 2 && x <= 1500 + buttonWidth / 2) {
happiness = Math.min(100, happiness + 8);
updateHappinessBar();
LK.getSound('groom').play();
summer.bounce();
summer.showSpeechBubble("So fresh!");
// Spawn grooming brush near Summer
var groomBrush = new GroomBrush();
groomBrush.x = summer.x - 80;
groomBrush.y = summer.y - 100;
game.addChild(groomBrush);
groomBrush.performGrooming();
return;
}
}
// Check if clicking on a toy
for (var i = 0; i < toys.length; i++) {
var toy = toys[i];
var distance = Math.sqrt(Math.pow(x - toy.x, 2) + Math.pow(y - toy.y, 2));
if (distance < 50) {
draggedToy = toy;
break;
}
}
}
};
game.up = function (x, y, obj) {
if (draggedToy) {
draggedToy.checkPlayInteraction();
draggedToy = null;
}
};
game.update = function () {
// Only run game logic during gameplay
if (gameState === 'playing') {
// Update timers
hungerTimer++;
happinessTimer++;
foodSpawnTimer++;
toySpawnTimer++;
// Hunger decreases every 5 seconds (300 ticks)
if (hungerTimer >= 300) {
hunger = Math.max(0, hunger - 1);
updateHungerBar();
hungerTimer = 0;
}
// Happiness decreases every 10 seconds (600 ticks) or faster when hungry
var happinessDecayRate = hunger < 30 ? 300 : 600;
if (happinessTimer >= happinessDecayRate) {
happiness = Math.max(0, happiness - 1);
updateHappinessBar();
happinessTimer = 0;
}
// Spawn food every 30 seconds (1800 ticks)
if (foodSpawnTimer >= 1800) {
spawnFood();
foodSpawnTimer = 0;
}
// Spawn toys every 45 seconds (2700 ticks)
if (toySpawnTimer >= 2700) {
spawnToy();
toySpawnTimer = 0;
}
// Update floating hearts
for (var i = hearts.length - 1; i >= 0; i--) {
var heart = hearts[i];
if (heart.alpha === 1) {
heart.floatUp();
}
}
// Check game over condition
if (happiness <= 0 && hunger <= 0) {
LK.showGameOver();
}
}
};
Pink heart no outline or shine. In-Game asset. 2d. High contrast. No shadows
Dog food. In-Game asset. 2d. High contrast. No shadows
Dog groom brush. In-Game asset. 2d. High contrast. No shadows
Pink tennis ball. In-Game asset. 2d. High contrast. No shadows
Car. In-Game asset. 2d. High contrast. No shadows
Full body person. In-Game asset. 2d. High contrast. No shadows