User prompt
stop the chicken asset from flickering when it moves
User prompt
Make the chicken asset shake slightly each time the score increases.
User prompt
Increase the size of the chicken asset after every collected Chicken wing
User prompt
Please fix the bug: 'TypeError: clearInterval is not a function' in or related to this line: 'clearInterval(chickenWingInterval);' Line Number: 157
User prompt
Make it possible for more than one chicken wing to slide in at a time.
User prompt
Once player gets 15 score, make more chicken wings fall from the top of the screen.
User prompt
Once player gets 100 score, reset the game but increase their score by two per chicken wing after that point
User prompt
Make the chicken's size increase more drastic.
User prompt
At every milestone of ten score, increase the chicken's size.
User prompt
Only show the tip message once.
User prompt
Change Tip text color to brown
User prompt
When menu bar is unlocked, show text on screen for ten seconds that says 'Tip: Click to Chick'
User prompt
Only unlock click ability when player has collected five chicken wings
User prompt
Instead of having the sword asset be clicked, make the chicken wings get collected whenever the mouse/screen is clicked.
User prompt
Sword asset cannot be clicked.
User prompt
Make the sword asset able to be clicked by the player.
User prompt
Make the sword asset able to be clicked and clear screen of chicken wings while updating score with howeve many chicken wings.
User prompt
In the first MenuBar slot, add a sword asset. Make it able to be clicked. When clicked, all the chicken wings turn white and increase the score by however many currently fill the screen.
User prompt
Menu bar doesn't appear.
User prompt
Create menu bar asset and add to bottom of screen when player score hits 5.
User prompt
When player score hits 10, unlock a menu bar with five slots.
User prompt
Above the score: 0, add the word 'Chicken'
User prompt
Make Chicken wings be collected by Chicken player.
User prompt
Make the falling chicken wings appear every two seconds.
User prompt
Have falling chicken wings on the screen
/**** * Classes ****/ // Chicken class var Chicken = Container.expand(function () { var self = Container.call(this); var chickenGraphics = self.attachAsset('chicken', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.update = function () { // Update logic for chicken }; self.move = function (x, y) { self.x = x; self.y = y; }; }); //<Assets used in the game will automatically appear here> // ChickenWing class var ChickenWing = Container.expand(function () { var self = Container.call(this); var wingGraphics = self.attachAsset('chickenWing', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.update = function () { self.y += self.speed; if (self.y > 2732) { self.y = -50; self.x = Math.random() * 2048; // No initial creation of chicken wings } }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0xF0EAD6 //Init game with egg-white background }); /**** * Game Code ****/ function unlockMenuBar() { var menuBar = new Container(); var menuBarGraphics = menuBar.attachAsset('menuBar', { anchorX: 0.5, anchorY: 0.5 }); menuBar.y = 2732 - 75; // Position menu bar at the bottom of the screen menuBar.x = 2048 / 2; // Center the menu bar horizontally for (var i = 0; i < 5; i++) { var slot = new Container(); slot.width = 200; slot.height = 200; slot.x = (i - 2) * 220; // Space slots evenly, centered on the menu bar slot.attachAsset('slot', { anchorX: 0.5, anchorY: 0.5 }); if (i === 0) { var sword = slot.attachAsset('sword', { anchorX: 0.5, anchorY: 0.5 }); // Removed sword click event } menuBar.addChild(slot); } game.addChild(menuBar); } var chickenWingCount = 0; var menuBarUnlocked = false; var chicken; var score = 0; var scoreTxt; var chickenTxt; // Initialize game elements function initGame() { // Create chicken wings every two seconds LK.setInterval(function () { var wing = game.addChild(new ChickenWing()); wing.x = Math.random() * 2048; wing.y = -50; game.menuBarUnlocked = false; }, 2000); chicken = game.addChild(new Chicken()); chicken.x = 2048 / 2; chicken.y = 2732 - 200; var chickenTxt = new Text2('Chicken', { size: 100, fill: "#000000" }); chickenTxt.anchor.set(0.5, 0); LK.gui.top.addChild(chickenTxt); scoreTxt = new Text2('Score: 0', { size: 100, fill: "#000000" }); scoreTxt.anchor.set(0.5, 0); scoreTxt.y = chickenTxt.height; // Position score text below 'Chicken' text LK.gui.top.addChild(scoreTxt); } // Update game elements game.update = function () { chicken.update(); game.children.forEach(function (child) { if (child instanceof ChickenWing) { child.update(); if (chicken.intersects(child)) { child.destroy(); score += 1; scoreTxt.setText('Score: ' + score); if (score >= 5 && !game.menuBarUnlocked) { game.menuBarUnlocked = true; unlockMenuBar(); } } } }); }; // Handle touch events game.down = function (x, y, obj) { chicken.move(x, y); var chickenWingCount = 0; if (menuBarUnlocked) { game.children.forEach(function (child) { if (child instanceof ChickenWing) { child.destroy(); chickenWingCount += 1; } }); } score += chickenWingCount; scoreTxt.setText('Score: ' + score); if (score >= 5 && !menuBarUnlocked) { menuBarUnlocked = true; unlockMenuBar(); } }; game.move = function (x, y, obj) { chicken.move(x, y); }; game.up = function (x, y, obj) { // No action needed on touch up }; // Initialize the game initGame();
===================================================================
--- original.js
+++ change.js
@@ -74,8 +74,9 @@
}
game.addChild(menuBar);
}
var chickenWingCount = 0;
+var menuBarUnlocked = false;
var chicken;
var score = 0;
var scoreTxt;
var chickenTxt;
@@ -126,16 +127,22 @@
// Handle touch events
game.down = function (x, y, obj) {
chicken.move(x, y);
var chickenWingCount = 0;
- game.children.forEach(function (child) {
- if (child instanceof ChickenWing) {
- child.destroy();
- chickenWingCount += 1;
- }
- });
+ if (menuBarUnlocked) {
+ game.children.forEach(function (child) {
+ if (child instanceof ChickenWing) {
+ child.destroy();
+ chickenWingCount += 1;
+ }
+ });
+ }
score += chickenWingCount;
scoreTxt.setText('Score: ' + score);
+ if (score >= 5 && !menuBarUnlocked) {
+ menuBarUnlocked = true;
+ unlockMenuBar();
+ }
};
game.move = function (x, y, obj) {
chicken.move(x, y);
};