Code edit (14 edits merged)
Please save this source code
User prompt
Migrate to the latest version of LK
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (14 edits merged)
Please save this source code
User prompt
Please fix the bug: 'timeout callback must be a function' in or related to this line: 'LK.setTimeout(60, showNoCandlesMessage);' Line Number: 573
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
after the topdecoration layer has been added, drop 10 candles down from the top of the screen and onto the topdecoration layer in an elliptical pattern.
Code edit (16 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: TopDecoration is not defined' in or related to this line: 'var newLayer = new TopDecoration(currentCakeHeight);' Line Number: 446
Code edit (2 edits merged)
Please save this source code
User prompt
where it says "scoreLabel.flash(red);" in the code, please make the scorelabel actualy flash in a red color
Code edit (1 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: stars is not defined' in or related to this line: 'for (var i = stars.length - 1; i >= 0; i--) {' Line Number: 401
User prompt
add the stars to the stars array and update them from game tick function.
User prompt
the stars should explode upwards in all directions and then drop down while they fade out and disappear
User prompt
whenever score increases, create a particle explosion of stars around the scorelabel
Code edit (1 edits merged)
Please save this source code
Code edit (7 edits merged)
Please save this source code
User prompt
in the handleButtons function, add a copy of the button clicked to the latest cakelayer added.
Code edit (8 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: button.parent.numChildren is not a function' in or related to this line: 'console.log('button.parent.children.length - 1: ' + button.parent.numChildren() - 1);' Line Number: 358
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -6,9 +6,9 @@
var buttonGraphic = self.attachAsset('blueberryButton', {
anchorX: 0.5,
anchorY: 0.5
});
- self.on('down', function (obj) {
+ self.on('down', function (x, y, obj) {
handleButtons(self);
});
});
// CakeLayer class
@@ -23,9 +23,9 @@
self.targetY = 0;
self.tweenStartTime = LK.ticks;
self.tweening = false;
self.inPlace = false;
- self.move = function () {
+ self._move_migrated = function () {
if (!self.tweening && !self.inPlace) {
self.tweening = true;
self.startY = self.y;
self.targetY = game.height - 300 - currentCakeHeight - self.height / 2;
@@ -61,9 +61,9 @@
self.targetY = 0;
self.speed = 60;
self.delay = 0;
self.waited = 0;
- self.move = function () {
+ self._move_migrated = function () {
if (self.waited < self.delay) {
self.waited++;
} else {
if (self.y < self.targetY) {
@@ -82,9 +82,9 @@
anchorY: 0.5
});
self.type = type;
self.speed = 5;
- self.move = function () {
+ self._move_migrated = function () {
self.y += self.speed;
};
});
var FishButton = Container.expand(function () {
@@ -92,9 +92,9 @@
var buttonGraphic = self.attachAsset('fishButton', {
anchorX: 0.5,
anchorY: 0.5
});
- self.on('down', function (obj) {
+ self.on('down', function (x, y, obj) {
handleButtons(self);
});
});
var FrogButton = Container.expand(function () {
@@ -102,9 +102,9 @@
var buttonGraphic = self.attachAsset('frogButton', {
anchorX: 0.5,
anchorY: 0.5
});
- self.on('down', function (obj) {
+ self.on('down', function (x, y, obj) {
handleButtons(self);
});
});
var MangoButton = Container.expand(function () {
@@ -112,9 +112,9 @@
var buttonGraphic = self.attachAsset('mangoButton', {
anchorX: 0.5,
anchorY: 0.5
});
- self.on('down', function (obj) {
+ self.on('down', function (x, y, obj) {
handleButtons(self);
});
});
var MouseButton = Container.expand(function () {
@@ -122,9 +122,9 @@
var buttonGraphic = self.attachAsset('mouseButton', {
anchorX: 0.5,
anchorY: 0.5
});
- self.on('down', function (obj) {
+ self.on('down', function (x, y, obj) {
handleButtons(self);
});
});
var NutellaButton = Container.expand(function () {
@@ -132,9 +132,9 @@
var buttonGraphic = self.attachAsset('nutellaButton', {
anchorX: 0.5,
anchorY: 0.5
});
- self.on('down', function (obj) {
+ self.on('down', function (x, y, obj) {
handleButtons(self);
});
});
var PineappleButton = Container.expand(function () {
@@ -142,9 +142,9 @@
var buttonGraphic = self.attachAsset('pineappleButton', {
anchorX: 0.5,
anchorY: 0.5
});
- self.on('down', function (obj) {
+ self.on('down', function (x, y, obj) {
handleButtons(self);
});
});
var RaspberryButton = Container.expand(function () {
@@ -152,9 +152,9 @@
var buttonGraphic = self.attachAsset('raspberryButton', {
anchorX: 0.5,
anchorY: 0.5
});
- self.on('down', function (obj) {
+ self.on('down', function (x, y, obj) {
handleButtons(self);
});
});
var StrawberryButton = Container.expand(function () {
@@ -162,9 +162,9 @@
var buttonGraphic = self.attachAsset('strawberryButton', {
anchorX: 0.5,
anchorY: 0.5
});
- self.on('down', function (obj) {
+ self.on('down', function (x, y, obj) {
handleButtons(self);
});
});
// Table class
@@ -187,9 +187,9 @@
self.targetY = 0;
self.tweenStartTime = LK.ticks;
self.tweening = false;
self.inPlace = false;
- self.move = function () {
+ self._move_migrated = function () {
if (!self.tweening && !self.inPlace) {
self.tweening = true;
self.startY = self.y;
self.targetY = game.height - 300 - currentCakeHeight - self.height / 2;
@@ -220,9 +220,9 @@
var buttonGraphic = self.attachAsset('whippedCreamButton', {
anchorX: 0.5,
anchorY: 0.5
});
- self.on('down', function (obj) {
+ self.on('down', function (x, y, obj) {
handleButtons(self);
});
});
@@ -334,18 +334,18 @@
cakeBase.x = game.width / 2;
cakeBase.y = game.height - cakeBase.height / 2;
// Handle dragging the cake base
var dragNode = null;
-game.on('down', function (obj) {
+game.on('down', function (x, y, obj) {
dragNode = cakeBase;
});
-game.on('move', function (obj) {
+game.on('move', function (x, y, obj) {
if (dragNode) {
- var pos = obj.event.getLocalPosition(game);
+ var pos = game.toLocal(obj.global);
dragNode.x = pos.x;
}
});
-game.on('up', function (obj) {
+game.on('up', function (x, y, obj) {
dragNode = null;
}); // Create and position the table at the bottom of the screen
var table = game.addChild(new Table());
table.x = game.width / 2 - 35;
@@ -491,17 +491,18 @@
scoreLabel.anchor.set(0.5, 0);
game.addChild(scoreLabel);
var instLabel = new Text2('Add fillings to each layer of your cake.\nTap to start', {
size: 100,
- fill: "#000000",
+ weight: 800,
+ fill: "#222288",
align: "center",
dropShadow: true,
dropShadowColor: '#ffffff',
dropShadowAngle: Math.PI / 6,
dropShadowDistance: 5
});
instLabel.x = game.width / 2;
-instLabel.y = 1880;
+instLabel.y = 2200;
instLabel.anchor.set(0.5, 0);
game.addChild(instLabel);
var gameStarted = false;
game.on('down', function () {
@@ -528,17 +529,17 @@
}
}
// Move cake layers
for (var i = cakeLayers.length - 1; i >= 0; i--) {
- cakeLayers[i].move();
+ cakeLayers[i]._move_migrated();
// Remove off-screen cake layers
/*if (cakeLayers[i].y > game.height + cakeLayers[i].height) {
cakeLayers[i].destroy();
cakeLayers.splice(i, 1);
}*/
}
for (var i = candles.length - 1; i >= 0; i--) {
- candles[i].move();
+ candles[i]._move_migrated();
}
// Spawn cake layers and fillings
if (LK.ticks % 180 === 0 && currentCakeHeight < 1200) {
var newLayer = new CakeLayer(currentCakeHeight);
a dark wooden kitchen table with a serving plate.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A bakery wall with shelves full of cakes, toppings, berries. Rich game illustration style.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A swirl of delicious whipped cream. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A small pile of delicious blueberries. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A few delicious red raspberries, cleaned.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Lush, mature strawberries, cleaned and slices and ready for use in bakery or for decoration.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A little green frog. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A cute little goldfish. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A golden star.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A pile of pieces of milk chocolate. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.