Code edit (1 edits merged)
Please save this source code
User prompt
Talking Plushies Adventure
Initial prompt
Toca toys (2005). The powerpuff girls have some Bing š° and sula š talking plushies. Tap on Bingās belly or Sulaās belly to make it talk āhi Iām Bing!ā Or āIām a fairy queenā or āšµpretty purple indigo blue and green and bright yellow thatās the way the colors go climbing up the rainybowšµā
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var BingPlushie = Container.expand(function () { var self = Container.call(this); // Create main body var body = self.attachAsset('bing', { anchorX: 0.5, anchorY: 0.5 }); // Create belly (interactive area) var belly = self.attachAsset('bingBelly', { anchorX: 0.5, anchorY: 0.5, y: 50 }); // Create eyes var leftEye = self.attachAsset('bingEye', { anchorX: 0.5, anchorY: 0.5, x: -60, y: -80 }); var rightEye = self.attachAsset('bingEye', { anchorX: 0.5, anchorY: 0.5, x: 60, y: -80 }); // Create mouth var mouth = self.attachAsset('bingMouth', { anchorX: 0.5, anchorY: 0.5, y: -20 }); self.voiceLines = ['bingHello', 'bingIntro', 'bingFun']; self.currentLineIndex = 0; self.speak = function () { var soundId = self.voiceLines[self.currentLineIndex]; LK.getSound(soundId).play(); // Animate speaking tween(mouth, { scaleY: 1.3 }, { duration: 300 }); tween(mouth, { scaleY: 1.0 }, { duration: 300 }); // Bounce effect tween(self, { scaleX: 1.1, scaleY: 1.1 }, { duration: 150 }); tween(self, { scaleX: 1.0, scaleY: 1.0 }, { duration: 150 }); // Cycle through voice lines self.currentLineIndex = (self.currentLineIndex + 1) % self.voiceLines.length; }; self.down = function (x, y, obj) { self.speak(); }; return self; }); var SulaPlushie = Container.expand(function () { var self = Container.call(this); // Create main body var body = self.attachAsset('sula', { anchorX: 0.5, anchorY: 0.5 }); // Create belly (interactive area) var belly = self.attachAsset('sulaBelly', { anchorX: 0.5, anchorY: 0.5, y: 50 }); // Create eyes var leftEye = self.attachAsset('sulaEye', { anchorX: 0.5, anchorY: 0.5, x: -60, y: -80 }); var rightEye = self.attachAsset('sulaEye', { anchorX: 0.5, anchorY: 0.5, x: 60, y: -80 }); // Create mouth var mouth = self.attachAsset('sulaMouth', { anchorX: 0.5, anchorY: 0.5, y: -20 }); self.voiceLines = ['sulaFairy', 'sulaRainbow', 'sulaMagic']; self.currentLineIndex = 0; self.speak = function () { var soundId = self.voiceLines[self.currentLineIndex]; LK.getSound(soundId).play(); // Animate speaking tween(mouth, { scaleY: 1.3 }, { duration: 300 }); tween(mouth, { scaleY: 1.0 }, { duration: 300 }); // Sparkle effect for fairy character tween(self, { scaleX: 1.1, scaleY: 1.1 }, { duration: 150, easing: tween.easeOut }); tween(self, { scaleX: 1.0, scaleY: 1.0 }, { duration: 150, easing: tween.easeIn }); // Cycle through voice lines self.currentLineIndex = (self.currentLineIndex + 1) % self.voiceLines.length; }; self.down = function (x, y, obj) { self.speak(); }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0xfff8dc }); /**** * Game Code ****/ game.setBackgroundColor(0xfff8dc); // Soft cream background // Create title text var titleText = new Text2('Talking Plushies Adventure', { size: 80, fill: 0x8B4513 }); titleText.anchor.set(0.5, 0); LK.gui.top.addChild(titleText); // Create instruction text var instructionText = new Text2('Tap their bellies to hear them talk!', { size: 50, fill: 0x4A4A4A }); instructionText.anchor.set(0.5, 1); LK.gui.bottom.addChild(instructionText); // Create Bing plushie var bing = game.addChild(new BingPlushie()); bing.x = 2048 / 4; bing.y = 2732 / 2; // Create Sula plushie var sula = game.addChild(new SulaPlushie()); sula.x = 2048 / 4 * 3; sula.y = 2732 / 2; // Add character labels var bingLabel = new Text2('Bing', { size: 60, fill: 0x4A90E2 }); bingLabel.anchor.set(0.5, 0); bingLabel.x = bing.x; bingLabel.y = bing.y + 300; game.addChild(bingLabel); var sulaLabel = new Text2('Sula', { size: 60, fill: 0xE24A90 }); sulaLabel.anchor.set(0.5, 0); sulaLabel.x = sula.x; sulaLabel.y = sula.y + 300; game.addChild(sulaLabel); // Idle animation for plushies var idleTimer = 0; game.update = function () { idleTimer++; // Gentle breathing animation if (idleTimer % 120 === 0) { tween(bing, { scaleY: 1.05 }, { duration: 1000, easing: tween.easeInOut }); tween(bing, { scaleY: 1.0 }, { duration: 1000, easing: tween.easeInOut }); } if (idleTimer % 140 === 0) { tween(sula, { scaleY: 1.05 }, { duration: 1000, easing: tween.easeInOut }); tween(sula, { scaleY: 1.0 }, { duration: 1000, easing: tween.easeInOut }); } };
===================================================================
--- original.js
+++ change.js
@@ -1,6 +1,233 @@
-/****
+/****
+* Plugins
+****/
+var tween = LK.import("@upit/tween.v1");
+
+/****
+* Classes
+****/
+var BingPlushie = Container.expand(function () {
+ var self = Container.call(this);
+ // Create main body
+ var body = self.attachAsset('bing', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ // Create belly (interactive area)
+ var belly = self.attachAsset('bingBelly', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ y: 50
+ });
+ // Create eyes
+ var leftEye = self.attachAsset('bingEye', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: -60,
+ y: -80
+ });
+ var rightEye = self.attachAsset('bingEye', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 60,
+ y: -80
+ });
+ // Create mouth
+ var mouth = self.attachAsset('bingMouth', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ y: -20
+ });
+ self.voiceLines = ['bingHello', 'bingIntro', 'bingFun'];
+ self.currentLineIndex = 0;
+ self.speak = function () {
+ var soundId = self.voiceLines[self.currentLineIndex];
+ LK.getSound(soundId).play();
+ // Animate speaking
+ tween(mouth, {
+ scaleY: 1.3
+ }, {
+ duration: 300
+ });
+ tween(mouth, {
+ scaleY: 1.0
+ }, {
+ duration: 300
+ });
+ // Bounce effect
+ tween(self, {
+ scaleX: 1.1,
+ scaleY: 1.1
+ }, {
+ duration: 150
+ });
+ tween(self, {
+ scaleX: 1.0,
+ scaleY: 1.0
+ }, {
+ duration: 150
+ });
+ // Cycle through voice lines
+ self.currentLineIndex = (self.currentLineIndex + 1) % self.voiceLines.length;
+ };
+ self.down = function (x, y, obj) {
+ self.speak();
+ };
+ return self;
+});
+var SulaPlushie = Container.expand(function () {
+ var self = Container.call(this);
+ // Create main body
+ var body = self.attachAsset('sula', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ // Create belly (interactive area)
+ var belly = self.attachAsset('sulaBelly', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ y: 50
+ });
+ // Create eyes
+ var leftEye = self.attachAsset('sulaEye', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: -60,
+ y: -80
+ });
+ var rightEye = self.attachAsset('sulaEye', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 60,
+ y: -80
+ });
+ // Create mouth
+ var mouth = self.attachAsset('sulaMouth', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ y: -20
+ });
+ self.voiceLines = ['sulaFairy', 'sulaRainbow', 'sulaMagic'];
+ self.currentLineIndex = 0;
+ self.speak = function () {
+ var soundId = self.voiceLines[self.currentLineIndex];
+ LK.getSound(soundId).play();
+ // Animate speaking
+ tween(mouth, {
+ scaleY: 1.3
+ }, {
+ duration: 300
+ });
+ tween(mouth, {
+ scaleY: 1.0
+ }, {
+ duration: 300
+ });
+ // Sparkle effect for fairy character
+ tween(self, {
+ scaleX: 1.1,
+ scaleY: 1.1
+ }, {
+ duration: 150,
+ easing: tween.easeOut
+ });
+ tween(self, {
+ scaleX: 1.0,
+ scaleY: 1.0
+ }, {
+ duration: 150,
+ easing: tween.easeIn
+ });
+ // Cycle through voice lines
+ self.currentLineIndex = (self.currentLineIndex + 1) % self.voiceLines.length;
+ };
+ self.down = function (x, y, obj) {
+ self.speak();
+ };
+ return self;
+});
+
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000
-});
\ No newline at end of file
+ backgroundColor: 0xfff8dc
+});
+
+/****
+* Game Code
+****/
+game.setBackgroundColor(0xfff8dc); // Soft cream background
+// Create title text
+var titleText = new Text2('Talking Plushies Adventure', {
+ size: 80,
+ fill: 0x8B4513
+});
+titleText.anchor.set(0.5, 0);
+LK.gui.top.addChild(titleText);
+// Create instruction text
+var instructionText = new Text2('Tap their bellies to hear them talk!', {
+ size: 50,
+ fill: 0x4A4A4A
+});
+instructionText.anchor.set(0.5, 1);
+LK.gui.bottom.addChild(instructionText);
+// Create Bing plushie
+var bing = game.addChild(new BingPlushie());
+bing.x = 2048 / 4;
+bing.y = 2732 / 2;
+// Create Sula plushie
+var sula = game.addChild(new SulaPlushie());
+sula.x = 2048 / 4 * 3;
+sula.y = 2732 / 2;
+// Add character labels
+var bingLabel = new Text2('Bing', {
+ size: 60,
+ fill: 0x4A90E2
+});
+bingLabel.anchor.set(0.5, 0);
+bingLabel.x = bing.x;
+bingLabel.y = bing.y + 300;
+game.addChild(bingLabel);
+var sulaLabel = new Text2('Sula', {
+ size: 60,
+ fill: 0xE24A90
+});
+sulaLabel.anchor.set(0.5, 0);
+sulaLabel.x = sula.x;
+sulaLabel.y = sula.y + 300;
+game.addChild(sulaLabel);
+// Idle animation for plushies
+var idleTimer = 0;
+game.update = function () {
+ idleTimer++;
+ // Gentle breathing animation
+ if (idleTimer % 120 === 0) {
+ tween(bing, {
+ scaleY: 1.05
+ }, {
+ duration: 1000,
+ easing: tween.easeInOut
+ });
+ tween(bing, {
+ scaleY: 1.0
+ }, {
+ duration: 1000,
+ easing: tween.easeInOut
+ });
+ }
+ if (idleTimer % 140 === 0) {
+ tween(sula, {
+ scaleY: 1.05
+ }, {
+ duration: 1000,
+ easing: tween.easeInOut
+ });
+ tween(sula, {
+ scaleY: 1.0
+ }, {
+ duration: 1000,
+ easing: tween.easeInOut
+ });
+ }
+};
\ No newline at end of file