User prompt
Make the cookies auto spawn
User prompt
Add more cookies
User prompt
Please fix the bug: 'ReferenceError: cookies is not defined' in or related to this line: 'for (var k = 0; k < cookies.length; k++) {' Line Number: 147
User prompt
Turn cookies into obstacles
User prompt
Touch a ingredient to make something new
User prompt
Add cookie object
User prompt
Background back to normal size
User prompt
Shrink the background
User prompt
Add a background
Initial prompt
The cake
===================================================================
--- original.js
+++ change.js
@@ -12,8 +12,19 @@
self.update = function () {
// Cake specific update logic
};
});
+// Cookie class
+var Cookie = Container.expand(function () {
+ var self = Container.call(this);
+ var cookieGraphics = self.attachAsset('cookie', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.update = function () {
+ // Cookie specific update logic
+ };
+});
// Ingredient class
var Ingredient = Container.expand(function () {
var self = Container.call(this);
var ingredientGraphics = self.attachAsset('ingredient', {
@@ -71,8 +82,15 @@
newIngredient.y = Math.random() * 2732;
ingredients.push(newIngredient);
game.addChild(newIngredient);
}
+// Function to create a new cookie
+function createCookie() {
+ var newCookie = new Cookie();
+ newCookie.x = Math.random() * 2048;
+ newCookie.y = Math.random() * 2732;
+ game.addChild(newCookie);
+}
// Handle move events
function handleMove(x, y, obj) {
// Get event position in relation to game object
var game_position = game.toLocal(obj.global);
@@ -94,12 +112,13 @@
}
}
// Mouse or touch move on game object
game.move = handleMove;
-// Create initial cakes and ingredients
+// Create initial cakes, ingredients and cookies
for (var i = 0; i < 5; i++) {
createCake();
createIngredient();
+ createCookie();
}
// Update game every tick
game.update = function () {
// Update cakes and ingredients
Cake. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Cake ingredients. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Bluno cookies cartoon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.Bluno