Code edit (2 edits merged)
Please save this source code
User prompt
please us LK.ticks (assuming a framerate of 60 frames per second, instead of datetime in the moveTo function
Code edit (18 edits merged)
Please save this source code
User prompt
please implement the moveto function so it it moves the target object to the destination cooredinates and endScale x and y over the number of seconds secified in duration parameter.
Code edit (1 edits merged)
Please save this source code
User prompt
please fix the emptyglass class, so that the textlabel is correctly added to it.
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: queueUpdateCounter is not defined' in or related to this line: 'if (queueUpdateCounter < queueUpdateMax) {' Line Number: 328
Code edit (7 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: Cutomer7 is not defined' in or related to this line: 'var customerTypes = [Customer1, Customer2, Customer3, Customer4, Customer5, Customer6, Cutomer7];' Line Number: 241
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: customerTypes[Math.ceil(...)] is not a constructor' in or related to this line: 'var t = new customerTypes[Math.ceil(Math.random() * customerTypes.length)]();' Line Number: 232
Code edit (4 edits merged)
Please save this source code
User prompt
create an emptyglass asset and class
Code edit (1 edits merged)
Please save this source code
Code edit (19 edits merged)
Please save this source code
User prompt
make an empty function for when an ingredientbutton is pressed.
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
add an ingredientbutton element behind each of the ingredient sprites
Code edit (3 edits merged)
Please save this source code
User prompt
when an item has been ordered pop up its ingredients along the bottom center of the screen
Code edit (1 edits merged)
Please save this source code
Code edit (13 edits merged)
Please save this source code
/****
* Classes
****/
// Customer1 class
var Customer1 = Container.expand(function () {
var self = Container.call(this);
var customer1Graphics = self.attachAsset('customer1', {
anchorX: 0.5,
anchorY: 0.5
});
});
// Customer2 class
var Customer2 = Container.expand(function () {
var self = Container.call(this);
var customer2Graphics = self.attachAsset('customer2', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
// Customer2 specific update logic
};
});
// Customer3 class
var Customer3 = Container.expand(function () {
var self = Container.call(this);
var customer3Graphics = self.attachAsset('customer3', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
// Customer3 specific update logic
};
});
// Customer4 class
var Customer4 = Container.expand(function () {
var self = Container.call(this);
var customer4Graphics = self.attachAsset('customer4', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
// Customer4 specific update logic
};
});
// Customer5 class
var Customer5 = Container.expand(function () {
var self = Container.call(this);
var customer5Graphics = self.attachAsset('customer5', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
// Customer5 specific update logic
};
});
// Customer6 class
var Customer6 = Container.expand(function () {
var self = Container.call(this);
var customer6Graphics = self.attachAsset('customer6', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
// Customer6 specific update logic
};
});
// Girl class
var Girl = Container.expand(function () {
var self = Container.call(this);
var girlGraphics = self.attachAsset('girl', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
// Girl specific update logic
};
});
// Ice class
var Ice = Container.expand(function () {
var self = Container.call(this);
var iceGraphics = self.attachAsset('ice', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
// Ice specific update logic
};
});
//<Assets used in the game will automatically appear here>
// Lemon class
var Lemon = Container.expand(function () {
var self = Container.call(this);
var lemonGraphics = self.attachAsset('lemon', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
// Lemon specific update logic
};
});
// LemonadeStand class
var LemonadeStand = Container.expand(function () {
var self = Container.call(this);
var standGraphics = self.attachAsset('stand', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
// Lemonade stand specific update logic
};
});
// Sugar class
var Sugar = Container.expand(function () {
var self = Container.call(this);
var sugarGraphics = self.attachAsset('sugar', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
// Sugar specific update logic
};
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB // Init game with sky blue background
});
/****
* Game Code
****/
var lemonadeStand;
var scoreTxt;
var score = 0;
var background = game.addChild(LK.getAsset('background', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1,
scaleY: 1,
x: 1024,
y: 2732 / 2
}));
// Initialize game elements
function initGameElements() {
// Create and position girl
var girl = new Girl();
girl.x = 2048 / 2;
girl.y = 2732 - 1150;
game.addChild(girl);
// Create and position lemonade stand
lemonadeStand = new LemonadeStand();
lemonadeStand.x = 2048 / 2;
lemonadeStand.y = 2732 - 1100;
game.addChild(lemonadeStand);
// Create and position score text
scoreTxt = new Text2('Score: 0', {
size: 100,
fill: "#ffffff",
stroke: '#000000',
strokeThickness: 10,
weight: 300
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
}
// Update score
function updateScore() {
scoreTxt.setText('Score: ' + score);
}
// Initialize game elements
initGameElements();
// Create and position customer1
var customer1 = new Customer1();
customer1.x = 500; //2048 / 4;
customer1.y = 1800;
game.addChild(customer1);
var customer2 = new Customer2();
customer2.x = customer1.x - customer1.width - 50;
customer2.y = 1800;
game.addChild(customer2);
game.setChildIndex(background, 0);
// Create and position customer3
var customer3 = new Customer3();
customer3.x = customer2.x - customer2.width - 50;
customer3.y = 1800;
game.addChild(customer3);
// Create and position customer4
var customer4 = new Customer4();
customer4.x = customer3.x - customer3.width - 50;
customer4.y = 1800;
game.addChild(customer4);
// Create and position customer5
var customer5 = new Customer5();
customer5.x = customer4.x - customer4.width - 50;
customer5.y = 1800;
game.addChild(customer5);
// Create and position customer6
var customer6 = new Customer6();
customer6.x = customer5.x - customer5.width - 50;
customer6.y = 1800;
game.addChild(customer6);
//customer1.hopAndWobble();
var customers = [customer1, customer2, customer3, customer4, customer5, customer6];
for (var i = 0; i < customers.length; i++) {
customers[i].anchorY = 2;
}
var backgroundOverlay = game.addChild(LK.getAsset('backgroundOverlay', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1,
scaleY: 1,
x: 1024,
y: 2732 / 2
}));
var lemonade = {
sprite: 'lemonade',
ingredients: ['lemon', 'sugar', 'water'],
price: 5
};
var availableItems = [lemonade];
function orderSomething(obj) {
var item = availableItems[Math.floor(Math.random() * availableItems.length)];
var speechBubble = LK.getAsset('speechBubble', {
anchorX: 0.5,
anchorY: 1,
scaleX: 0.5,
scaleY: 0.5,
x: obj.x - 250,
y: obj.y - obj.height / 2 - 50,
rotation: 0.12
});
game.addChild(speechBubble);
// Add the sprite of the ordered item inside the speech bubble
var itemSprite = LK.getAsset(item.sprite, {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.5,
scaleY: 0.5,
x: speechBubble.x,
y: speechBubble.y - 300
});
game.addChild(itemSprite);
}
;
var queueSpeed = 3;
var queueUpdateCounter = 0;
var queueUpdateMax = 200 / queueSpeed;
function updateCustomers() {
if (queueUpdateCounter < queueUpdateMax) {
queueUpdateCounter++;
for (var i = 0; i < customers.length; i++) {
customers[i].x += queueSpeed;
customers[i].y += Math.cos(LK.ticks / 2) * 15 * (Math.random() * 0.3 + 0.7);
customers[i].rotation += 0.05 - Math.random() * 0.1;
//customers[i].rotation += LK.ticks % 6 < 3 ? 0.05 : -0.05;
}
} else if (queueUpdateCounter >= queueUpdateMax) {
for (var i = 0; i < customers.length; i++) {
customers[i].rotation = 0;
customers[i].y = 1800;
}
orderSomething(customers[0]);
}
}
;
game.update = function () {
updateCustomers();
};
A beautiful scenery looking out to sea from an empty beach side promenade on a bright summer day. Happy game illustration style for a casual family friendly game.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
remove the glass and the crate of lemons from the table.
A simple, elegant white speech bubble.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A lemon with a few slices cut off.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A bag of white sugar, open and with a pile of the sugar in front of it.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A pitcher full of nice fresh water and ice cubes.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A round white button for an interface element.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
An empty drinking glass.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A yellow star. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A red heart. simple.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A nice glass of watermelon and strawberry slushice. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A nice glass of banana milkshake. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A nice glass of pina colada. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A nice glass of mango lassie. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
An orange. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A couple of blueberries. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A couple of bananas. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A bottle of milk. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A watermelon and some pieces of watermelon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A mango and a few slices of mango. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A pineapple with a few slices of pineapple in front. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A fullscreen background gui element for an in-game shop. It should be mostly blanks space, but along the edges there could be some structure or decorative vines and items, mostly related to fruits, berries, cocktails in a summer theme.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A modern dream of a sailing boat. game illustration.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A bold green checkmark.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
An idyllic llustration of a beach cove where a blnd girl in a strawhat i en joying an enormous strawberry drink on her sailing boat as the sun sets. Clean game art illustration style.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
An idyllic llustration of a beach cove where a blond girl in a straw hat is enjoying an large strawberry drink on the deck of her sailing boat as the sun sets. Clean game illustration style.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.