Code edit (1 edits merged)
Please save this source code
Code edit (13 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: instructionTxt is not defined' in or related to this line: 'instructionTxt.setText('Tap to throw the javelin');' Line Number: 65
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (15 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in or related to this line: 'self.x += queueSpeed;' Line Number: 591
Code edit (1 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
when a customer has received their drink, three little hearts should rise above their heads and disappear
Code edit (4 edits merged)
Please save this source code
User prompt
after speechBubble is destroyed and the itemsprite is set, move the itemsprite towards the rightmost customer while scaling it down to 0.2 over 1 second
Code edit (4 edits merged)
Please save this source code
User prompt
in createStarExplosion, please set the stars vx and vy to a uniform circular spread
Code edit (6 edits merged)
Please save this source code
User prompt
create a star explosions after emptyglass.destroy()
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
the emptyGlass' updateText function should make the fullText label display i as passed in parameter
Code edit (1 edits merged)
Please save this source code
User prompt
now use the beziercurve function to generate an overarching path from each ingredient to the center of the glass
User prompt
cool, please add the function to the game, soI can use it
===================================================================
--- original.js
+++ change.js
@@ -1,100 +1,29 @@
/****
* Classes
****/
-// Customer1 class
-var Customer1 = Container.expand(function () {
+var CustomerBase = Container.expand(function () {
var self = Container.call(this);
- var customer1Graphics = self.attachAsset('customer1', {
+ var sprite = 'customer' + Math.ceil(Math.random() * 8);
+ var customerGraphics = self.attachAsset(sprite, {
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.anchorX = 0.5;
+ self.anchorY = 0.5;
self.done = false;
self.update = function () {
if (self.done) {
- self.x += queueSpeed;
+ self.x += queueSpeed * 8;
self.y += Math.cos(LK.ticks / 2) * 15 * (Math.random() * 0.3 + 0.7);
self.rotation += 0.05 - Math.random() * 0.1;
if (self.x > 2300) {
self.destroy();
}
}
};
});
-// 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
- };
-});
-// Customer7 class
-var Customer7 = Container.expand(function () {
- var self = Container.call(this);
- var customer7Graphics = self.attachAsset('customer7', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.update = function () {
- // Customer6 specific update logic
- };
-});
-// Customer8 class
-var Customer8 = Container.expand(function () {
- var self = Container.call(this);
- var customer8Graphics = self.attachAsset('customer8', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.update = function () {
- // Customer6 specific update logic
- };
-});
+// Customer1 class
// EmptyGlass class
var EmptyGlass = Container.expand(function () {
var self = Container.call(this);
var emptyGlassGraphics = self.attachAsset('emptyGlass', {
@@ -245,9 +174,10 @@
moveDrinkToCustomer(itemSprite, rightmostCustomer.x, rightmostCustomer.y, 1);
// TODO: Here a few coins should flip from customer to girl and money label be upgraded
//itemSprite.update = globalMoveTo;
//updateCustomers();
- customers[0].update = waltzOff;
+ //customers[0].addChild(itemSprite);
+ customers[0].done = true;
customers.splice(0, 1);
// This causes the updateCustomers in game.update() to advance the queue.
queueUpdateCounter = 0;
orderPlaced = false;
@@ -438,12 +368,13 @@
scoreTxt.setText('Score: ' + score);
}
// Initialize game elements
initGameElements();
-var customerTypes = [Customer1, Customer2, Customer3, Customer4, Customer5, Customer6, Customer7, Customer8];
+var customerTypes = [CustomerBase]; //[Customer1, Customer2, Customer3, Customer4, Customer5, Customer6, Customer7, Customer8];
var customers = [];
for (var i = 0; i < 7; i++) {
- var t = new customerTypes[Math.floor(Math.random() * customerTypes.length)]();
+ //var t = new customerTypes[Math.floor(Math.random() * customerTypes.length)]();
+ var t = new CustomerBase();
t.y = 1800;
t.x = 500 - 250 * i - 50;
t.anchorY = 2;
game.addChild(t);
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.