Code edit (1 edits merged)
Please save this source code
User prompt
Powerpuff Girls: Bing Bunny Snow Story
Initial prompt
Toca powerpuff girls in storytime (2001). The powerpuff girls have a tv to watch. Tap on the green play or continue or again button to make the tv come to life or continue the story or start again. It will be “Bing bunny: snow month”. They be sula holding an envelope that snow is coming soon scene at scene 1, sula having a dream scene at scene 2, sula is awake in bed scene at scene 3, sula says she can’t go to school today scene at scene 4, Bing pando and sula seeing the snowfall at the window scene at scene 5, Bing pando and sula sledding down the big hill scene at scene 6, sula made an ice ramp scene at scene 7, Bing pando and sula flying high scene at scene 8, Bing pando and sula fell down in a pile of snow scene at scene 9 for end.
/**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB // Sky blue background }); /**** * Game Code ****/ // Game dimensions are 2048x2732 var currentScene = 0; var totalScenes = 9; var storyActive = false; // Initialize assets // Powerpuff Girls characters // Story scene shapes // Sound effects // Create TV setup var tvFrame = game.addChild(LK.getAsset('tvFrame', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 800 })); var tvScreen = game.addChild(LK.getAsset('tvScreen', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 800 })); // Create Powerpuff Girls var blossom = game.addChild(LK.getAsset('blossom', { anchorX: 0.5, anchorY: 0.5, x: 600, y: 2200 })); var bubbles = game.addChild(LK.getAsset('bubbles', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 2200 })); var buttercup = game.addChild(LK.getAsset('buttercup', { anchorX: 0.5, anchorY: 0.5, x: 1448, y: 2200 })); // Create initial play button var playButton = game.addChild(LK.getAsset('playButton', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 800 })); var playButtonText = new Text2('Play', { size: 60, fill: 0x000000 }); playButtonText.anchor.set(0.5, 0.5); playButtonText.x = 1024; playButtonText.y = 800; game.addChild(playButtonText); // Create next button (initially hidden) var nextButton = game.addChild(LK.getAsset('nextButton', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1500, alpha: 0 })); var nextButtonText = new Text2('Next', { size: 40, fill: 0x000000 }); nextButtonText.anchor.set(0.5, 0.5); nextButtonText.x = 1024; nextButtonText.y = 1500; nextButtonText.alpha = 0; game.addChild(nextButtonText); // Create again button (initially hidden) var againButton = game.addChild(LK.getAsset('againButton', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1500, alpha: 0 })); var againButtonText = new Text2('Again', { size: 60, fill: 0x000000 }); againButtonText.anchor.set(0.5, 0.5); againButtonText.x = 1024; againButtonText.y = 1500; againButtonText.alpha = 0; game.addChild(againButtonText); // Story elements (initially hidden) var storyElements = []; // Scene descriptions var sceneDescriptions = ["Sula holds an envelope announcing snow is coming soon!", "Sula dreams about beautiful white snow falling...", "Sula wakes up excited in her cozy bed!", "Sula declares she can't go to school today!", "Bing, Pando, and Sula watch snowfall through the window!", "The trio goes sledding down a big snowy hill!", "Sula creates an exciting ice ramp!", "Bing, Pando, and Sula fly high off the ramp!", "All three fall into a pile of fluffy snow!"]; var sceneText = new Text2('', { size: 50, fill: 0xFFFFFF }); sceneText.anchor.set(0.5, 0.5); sceneText.x = 1024; sceneText.y = 1600; sceneText.alpha = 0; game.addChild(sceneText); function clearStoryElements() { for (var i = 0; i < storyElements.length; i++) { if (storyElements[i].destroy) { storyElements[i].destroy(); } } storyElements = []; } function createScene(sceneNumber) { clearStoryElements(); sceneText.setText(sceneDescriptions[sceneNumber]); sceneText.alpha = 1; switch (sceneNumber) { case 0: // Sula holds envelope var sula = game.addChild(LK.getAsset('sula', { anchorX: 0.5, anchorY: 0.5, x: 900, y: 700 })); var envelope = game.addChild(LK.getAsset('envelope', { anchorX: 0.5, anchorY: 0.5, x: 1100, y: 650 })); storyElements.push(sula, envelope); break; case 1: // Sula dreams var sula = game.addChild(LK.getAsset('sula', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 800 })); // Add dream snowflakes for (var i = 0; i < 8; i++) { var snowflake = game.addChild(LK.getAsset('snowflake', { anchorX: 0.5, anchorY: 0.5, x: 800 + i * 60, y: 500 + i % 2 * 100 })); storyElements.push(snowflake); } storyElements.push(sula); break; case 2: // Sula wakes up var bed = game.addChild(LK.getAsset('bed', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 900 })); var sula = game.addChild(LK.getAsset('sula', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 800 })); storyElements.push(bed, sula); break; case 3: // Can't go to school var sula = game.addChild(LK.getAsset('sula', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 800 })); storyElements.push(sula); break; case 4: // Watching snowfall var window = game.addChild(LK.getAsset('window', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 600 })); var bing = game.addChild(LK.getAsset('bing', { anchorX: 0.5, anchorY: 0.5, x: 800, y: 900 })); var pando = game.addChild(LK.getAsset('pando', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 900 })); var sula = game.addChild(LK.getAsset('sula', { anchorX: 0.5, anchorY: 0.5, x: 1248, y: 900 })); // Add falling snow for (var i = 0; i < 6; i++) { var snowflake = game.addChild(LK.getAsset('snowflake', { anchorX: 0.5, anchorY: 0.5, x: 900 + i * 40, y: 550 + i % 3 * 30 })); storyElements.push(snowflake); } storyElements.push(window, bing, pando, sula); break; case 5: // Sledding var hill = game.addChild(LK.getAsset('hill', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1000 })); var sled = game.addChild(LK.getAsset('sled', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 850 })); var bing = game.addChild(LK.getAsset('bing', { anchorX: 0.5, anchorY: 0.5, x: 900, y: 800 })); var pando = game.addChild(LK.getAsset('pando', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 800 })); var sula = game.addChild(LK.getAsset('sula', { anchorX: 0.5, anchorY: 0.5, x: 1148, y: 800 })); storyElements.push(hill, sled, bing, pando, sula); break; case 6: // Ice ramp var ramp = game.addChild(LK.getAsset('ramp', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 900 })); var sula = game.addChild(LK.getAsset('sula', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 800 })); storyElements.push(ramp, sula); break; case 7: // Flying high var ramp = game.addChild(LK.getAsset('ramp', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1000 })); var bing = game.addChild(LK.getAsset('bing', { anchorX: 0.5, anchorY: 0.5, x: 800, y: 600 })); var pando = game.addChild(LK.getAsset('pando', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 600 })); var sula = game.addChild(LK.getAsset('sula', { anchorX: 0.5, anchorY: 0.5, x: 1248, y: 600 })); storyElements.push(ramp, bing, pando, sula); break; case 8: // Falling into snow var snowPile = game.addChild(LK.getAsset('snowPile', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1000 })); var bing = game.addChild(LK.getAsset('bing', { anchorX: 0.5, anchorY: 0.5, x: 900, y: 950 })); var pando = game.addChild(LK.getAsset('pando', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 950 })); var sula = game.addChild(LK.getAsset('sula', { anchorX: 0.5, anchorY: 0.5, x: 1148, y: 950 })); storyElements.push(snowPile, bing, pando, sula); break; } } function startStory() { storyActive = true; currentScene = 0; playButton.alpha = 0; playButtonText.alpha = 0; nextButton.alpha = 1; nextButtonText.alpha = 1; createScene(currentScene); LK.getSound('buttonClick').play(); } function nextScene() { if (currentScene < totalScenes - 1) { currentScene++; createScene(currentScene); LK.getSound('buttonClick').play(); if (currentScene === totalScenes - 1) { // Last scene, show "Again" button nextButton.alpha = 0; nextButtonText.alpha = 0; againButton.alpha = 1; againButtonText.alpha = 1; } } } function restartStory() { clearStoryElements(); storyActive = false; currentScene = 0; sceneText.alpha = 0; playButton.alpha = 1; playButtonText.alpha = 1; nextButton.alpha = 0; nextButtonText.alpha = 0; againButton.alpha = 0; againButtonText.alpha = 0; LK.getSound('buttonClick').play(); } game.down = function (x, y, obj) { var gamePos = game.toLocal(obj.parent.toGlobal(obj.position)); // Check if play button was clicked if (!storyActive && playButton.alpha > 0) { if (gamePos.x >= playButton.x - 150 && gamePos.x <= playButton.x + 150 && gamePos.y >= playButton.y - 60 && gamePos.y <= playButton.y + 60) { startStory(); } } // Check if next button was clicked if (storyActive && nextButton.alpha > 0) { if (gamePos.x >= nextButton.x - 100 && gamePos.x <= nextButton.x + 100 && gamePos.y >= nextButton.y - 40 && gamePos.y <= nextButton.y + 40) { nextScene(); } } // Check if again button was clicked if (storyActive && againButton.alpha > 0) { if (gamePos.x >= againButton.x - 150 && gamePos.x <= againButton.x + 150 && gamePos.y >= againButton.y - 60 && gamePos.y <= againButton.y + 60) { restartStory(); } } }; game.update = function () { // Add subtle animation to snowflakes if they exist for (var i = 0; i < storyElements.length; i++) { if (storyElements[i] && storyElements[i].width === 20 && storyElements[i].height === 20) { // This is likely a snowflake storyElements[i].y += Math.sin(LK.ticks * 0.1 + i) * 0.5; } } };
===================================================================
--- original.js
+++ change.js
@@ -1,6 +1,400 @@
-/****
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000
-});
\ No newline at end of file
+ backgroundColor: 0x87CEEB // Sky blue background
+});
+
+/****
+* Game Code
+****/
+// Game dimensions are 2048x2732
+var currentScene = 0;
+var totalScenes = 9;
+var storyActive = false;
+// Initialize assets
+// Powerpuff Girls characters
+// Story scene shapes
+// Sound effects
+// Create TV setup
+var tvFrame = game.addChild(LK.getAsset('tvFrame', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 800
+}));
+var tvScreen = game.addChild(LK.getAsset('tvScreen', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 800
+}));
+// Create Powerpuff Girls
+var blossom = game.addChild(LK.getAsset('blossom', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 600,
+ y: 2200
+}));
+var bubbles = game.addChild(LK.getAsset('bubbles', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 2200
+}));
+var buttercup = game.addChild(LK.getAsset('buttercup', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1448,
+ y: 2200
+}));
+// Create initial play button
+var playButton = game.addChild(LK.getAsset('playButton', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 800
+}));
+var playButtonText = new Text2('Play', {
+ size: 60,
+ fill: 0x000000
+});
+playButtonText.anchor.set(0.5, 0.5);
+playButtonText.x = 1024;
+playButtonText.y = 800;
+game.addChild(playButtonText);
+// Create next button (initially hidden)
+var nextButton = game.addChild(LK.getAsset('nextButton', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 1500,
+ alpha: 0
+}));
+var nextButtonText = new Text2('Next', {
+ size: 40,
+ fill: 0x000000
+});
+nextButtonText.anchor.set(0.5, 0.5);
+nextButtonText.x = 1024;
+nextButtonText.y = 1500;
+nextButtonText.alpha = 0;
+game.addChild(nextButtonText);
+// Create again button (initially hidden)
+var againButton = game.addChild(LK.getAsset('againButton', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 1500,
+ alpha: 0
+}));
+var againButtonText = new Text2('Again', {
+ size: 60,
+ fill: 0x000000
+});
+againButtonText.anchor.set(0.5, 0.5);
+againButtonText.x = 1024;
+againButtonText.y = 1500;
+againButtonText.alpha = 0;
+game.addChild(againButtonText);
+// Story elements (initially hidden)
+var storyElements = [];
+// Scene descriptions
+var sceneDescriptions = ["Sula holds an envelope announcing snow is coming soon!", "Sula dreams about beautiful white snow falling...", "Sula wakes up excited in her cozy bed!", "Sula declares she can't go to school today!", "Bing, Pando, and Sula watch snowfall through the window!", "The trio goes sledding down a big snowy hill!", "Sula creates an exciting ice ramp!", "Bing, Pando, and Sula fly high off the ramp!", "All three fall into a pile of fluffy snow!"];
+var sceneText = new Text2('', {
+ size: 50,
+ fill: 0xFFFFFF
+});
+sceneText.anchor.set(0.5, 0.5);
+sceneText.x = 1024;
+sceneText.y = 1600;
+sceneText.alpha = 0;
+game.addChild(sceneText);
+function clearStoryElements() {
+ for (var i = 0; i < storyElements.length; i++) {
+ if (storyElements[i].destroy) {
+ storyElements[i].destroy();
+ }
+ }
+ storyElements = [];
+}
+function createScene(sceneNumber) {
+ clearStoryElements();
+ sceneText.setText(sceneDescriptions[sceneNumber]);
+ sceneText.alpha = 1;
+ switch (sceneNumber) {
+ case 0:
+ // Sula holds envelope
+ var sula = game.addChild(LK.getAsset('sula', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 900,
+ y: 700
+ }));
+ var envelope = game.addChild(LK.getAsset('envelope', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1100,
+ y: 650
+ }));
+ storyElements.push(sula, envelope);
+ break;
+ case 1:
+ // Sula dreams
+ var sula = game.addChild(LK.getAsset('sula', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 800
+ }));
+ // Add dream snowflakes
+ for (var i = 0; i < 8; i++) {
+ var snowflake = game.addChild(LK.getAsset('snowflake', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 800 + i * 60,
+ y: 500 + i % 2 * 100
+ }));
+ storyElements.push(snowflake);
+ }
+ storyElements.push(sula);
+ break;
+ case 2:
+ // Sula wakes up
+ var bed = game.addChild(LK.getAsset('bed', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 900
+ }));
+ var sula = game.addChild(LK.getAsset('sula', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 800
+ }));
+ storyElements.push(bed, sula);
+ break;
+ case 3:
+ // Can't go to school
+ var sula = game.addChild(LK.getAsset('sula', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 800
+ }));
+ storyElements.push(sula);
+ break;
+ case 4:
+ // Watching snowfall
+ var window = game.addChild(LK.getAsset('window', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 600
+ }));
+ var bing = game.addChild(LK.getAsset('bing', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 800,
+ y: 900
+ }));
+ var pando = game.addChild(LK.getAsset('pando', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 900
+ }));
+ var sula = game.addChild(LK.getAsset('sula', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1248,
+ y: 900
+ }));
+ // Add falling snow
+ for (var i = 0; i < 6; i++) {
+ var snowflake = game.addChild(LK.getAsset('snowflake', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 900 + i * 40,
+ y: 550 + i % 3 * 30
+ }));
+ storyElements.push(snowflake);
+ }
+ storyElements.push(window, bing, pando, sula);
+ break;
+ case 5:
+ // Sledding
+ var hill = game.addChild(LK.getAsset('hill', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 1000
+ }));
+ var sled = game.addChild(LK.getAsset('sled', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 850
+ }));
+ var bing = game.addChild(LK.getAsset('bing', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 900,
+ y: 800
+ }));
+ var pando = game.addChild(LK.getAsset('pando', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 800
+ }));
+ var sula = game.addChild(LK.getAsset('sula', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1148,
+ y: 800
+ }));
+ storyElements.push(hill, sled, bing, pando, sula);
+ break;
+ case 6:
+ // Ice ramp
+ var ramp = game.addChild(LK.getAsset('ramp', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 900
+ }));
+ var sula = game.addChild(LK.getAsset('sula', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 800
+ }));
+ storyElements.push(ramp, sula);
+ break;
+ case 7:
+ // Flying high
+ var ramp = game.addChild(LK.getAsset('ramp', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 1000
+ }));
+ var bing = game.addChild(LK.getAsset('bing', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 800,
+ y: 600
+ }));
+ var pando = game.addChild(LK.getAsset('pando', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 600
+ }));
+ var sula = game.addChild(LK.getAsset('sula', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1248,
+ y: 600
+ }));
+ storyElements.push(ramp, bing, pando, sula);
+ break;
+ case 8:
+ // Falling into snow
+ var snowPile = game.addChild(LK.getAsset('snowPile', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 1000
+ }));
+ var bing = game.addChild(LK.getAsset('bing', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 900,
+ y: 950
+ }));
+ var pando = game.addChild(LK.getAsset('pando', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 950
+ }));
+ var sula = game.addChild(LK.getAsset('sula', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1148,
+ y: 950
+ }));
+ storyElements.push(snowPile, bing, pando, sula);
+ break;
+ }
+}
+function startStory() {
+ storyActive = true;
+ currentScene = 0;
+ playButton.alpha = 0;
+ playButtonText.alpha = 0;
+ nextButton.alpha = 1;
+ nextButtonText.alpha = 1;
+ createScene(currentScene);
+ LK.getSound('buttonClick').play();
+}
+function nextScene() {
+ if (currentScene < totalScenes - 1) {
+ currentScene++;
+ createScene(currentScene);
+ LK.getSound('buttonClick').play();
+ if (currentScene === totalScenes - 1) {
+ // Last scene, show "Again" button
+ nextButton.alpha = 0;
+ nextButtonText.alpha = 0;
+ againButton.alpha = 1;
+ againButtonText.alpha = 1;
+ }
+ }
+}
+function restartStory() {
+ clearStoryElements();
+ storyActive = false;
+ currentScene = 0;
+ sceneText.alpha = 0;
+ playButton.alpha = 1;
+ playButtonText.alpha = 1;
+ nextButton.alpha = 0;
+ nextButtonText.alpha = 0;
+ againButton.alpha = 0;
+ againButtonText.alpha = 0;
+ LK.getSound('buttonClick').play();
+}
+game.down = function (x, y, obj) {
+ var gamePos = game.toLocal(obj.parent.toGlobal(obj.position));
+ // Check if play button was clicked
+ if (!storyActive && playButton.alpha > 0) {
+ if (gamePos.x >= playButton.x - 150 && gamePos.x <= playButton.x + 150 && gamePos.y >= playButton.y - 60 && gamePos.y <= playButton.y + 60) {
+ startStory();
+ }
+ }
+ // Check if next button was clicked
+ if (storyActive && nextButton.alpha > 0) {
+ if (gamePos.x >= nextButton.x - 100 && gamePos.x <= nextButton.x + 100 && gamePos.y >= nextButton.y - 40 && gamePos.y <= nextButton.y + 40) {
+ nextScene();
+ }
+ }
+ // Check if again button was clicked
+ if (storyActive && againButton.alpha > 0) {
+ if (gamePos.x >= againButton.x - 150 && gamePos.x <= againButton.x + 150 && gamePos.y >= againButton.y - 60 && gamePos.y <= againButton.y + 60) {
+ restartStory();
+ }
+ }
+};
+game.update = function () {
+ // Add subtle animation to snowflakes if they exist
+ for (var i = 0; i < storyElements.length; i++) {
+ if (storyElements[i] && storyElements[i].width === 20 && storyElements[i].height === 20) {
+ // This is likely a snowflake
+ storyElements[i].y += Math.sin(LK.ticks * 0.1 + i) * 0.5;
+ }
+ }
+};
\ No newline at end of file