Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
use the font Brush Script MT for the score label
Code edit (11 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Error: 1addChildAt: The index [object Object] supplied is out of bounds 2' in or related to this line: 'var branch = treeContainer.addChildAt(treeContainer.children.length - 1, LK.getAsset('tree-branch-' + branchType, {' Line Number: 325
Code edit (7 edits merged)
Please save this source code
User prompt
the bear should be on a displaylayer above the trees and branches, even when new ones spawn
User prompt
the bear should always be in front of tree segments and branches
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (16 edits merged)
Please save this source code
User prompt
branches should follow same movement logic as tree segments
User prompt
if LK.ticks is 1000 more than lastBranchSpawn, spawn a branch on the tree (of types 1-4) and set lastbranchspawn to current tick value
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: Containerexpand is not defined' in or related to this line: 'var TrunkPart = Containerexpand(function () {' Line Number: 82
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
make the treesegments move y+= 2 where glitchcover and tree does
Code edit (14 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'y')' in or related to this line: 'glitchCover.y += 2;' Line Number: 207
Code edit (1 edits merged)
Please save this source code
User prompt
the clouds should also move horizontally according to current windspeed, but slower
Code edit (8 edits merged)
Please save this source code
User prompt
the dust should follow the wind, but at twice it's speed
User prompt
make 10 specks of dust floating in the air
/**** * Classes ****/ //<Assets used in the game will automatically appear here> // Bear class var Bear = Container.expand(function () { var self = Container.call(this); var bearGraphics = self.attachAsset('bear', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { // Bear update logic }; }); // Bee class var Bee = Container.expand(function () { var self = Container.call(this); var beeGraphics = self.attachAsset('bee', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.update = function () { self.y += self.speed; if (self.y > 2732) { self.y = -self.height; self.x = Math.random() * 2048; } }; }); // Cloud class var Cloud = Container.expand(function () { var self = Container.call(this); var cloudGraphics = self.attachAsset('cloud', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { self.x += windspeed * 0.5; }; }); // Dust class var Dust = Container.expand(function () { var self = Container.call(this); var dustGraphics = self.attachAsset('dust', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { self.x += windspeed * 2; self.y += Math.random() * 2; if (self.x < 0 || self.x > 2048 || self.y < 0 || self.y > 2732) { self.x = Math.random() * 2048; self.y = Math.random() * 2732; } }; }); // Honey class var Honey = Container.expand(function () { var self = Container.call(this); var honeyGraphics = self.attachAsset('honey', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { // Honey update logic }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB // Sky blue background }); /**** * Game Code ****/ // Initialize game variables var bear; var bees = []; var honeys = []; var clouds = []; var score = 0; var scoreTxt; var windspeed = 0; var windDirection = true; // Initialize game elements function initGame() { // Create background var background = game.addChild(LK.getAsset('background', { anchorX: 0.0, anchorY: 0.0, x: -500, y: 0 })); var glitchcover = game.addChild(LK.getAsset('glitchcover', { anchorX: 0.5, anchorY: 0.5, x: 150, y: 940 })); // Spawn three clouds randomly around the top of the screen for (var i = 0; i < 3; i++) { var cloud = new Cloud(); cloud.x = i == 0 ? 100 : i == 1 ? 1050 : 2100; cloud.y = i == 0 ? 350 : i == 1 ? 300 : 400; //Math.random() * 500; clouds.push(cloud); game.addChild(cloud); } // Create tree var tree = game.addChild(LK.getAsset('tree', { anchorX: 0.5, anchorY: 0.0, x: 1024 - 8, y: 0 //alpha: 0.2 })); // Create tree part var treePart = game.addChild(LK.getAsset('tree-part', { anchorX: 0.5, anchorY: 0.0, x: 1024, y: -400 })); // Create bear bear = new Bear(); bear.x = 1024; bear.y = 2400; game.addChild(bear); // Create bees /* for (var i = 0; i < 5; i++) { var bee = new Bee(); bee.x = Math.random() * 2048; bee.y = Math.random() * -2732; bees.push(bee); game.addChild(bee); }*/ // Create honeys for (var i = 0; i < 3; i++) { var honey = new Honey(); honey.x = Math.random() * 2048; honey.y = Math.random() * -2732; honeys.push(honey); game.addChild(honey); } // Create score text scoreTxt = new Text2('Score: 0', { size: 100, fill: "#ffffff" }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Spawn 10 specks of dust floating in the air for (var i = 0; i < 10; i++) { var dust = new Dust(); dust.x = Math.random() * 2048; dust.y = Math.random() * 2732; game.addChild(dust); } } // Update game elements game.update = function () { // Increase windspeed every tick if (windDirection) { windspeed += 0.02; } else { windspeed -= 0.02; } // With a small chance, reverse the direction of the windspeed if (Math.random() < 0.1) { windDirection = !windDirection; } // Update bear //bear.update(); if (bear.y > 1200) { bear.y -= 2; } bear.x += windspeed; // Update bees /* for (var i = 0; i < bees.length; i++) { bees[i].update(); if (bear.intersects(bees[i])) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } }*/ // Update honeys for (var i = 0; i < honeys.length; i++) { honeys[i].update(); if (bear.intersects(honeys[i])) { score += 10; scoreTxt.setText('Score: ' + score); honeys[i].destroy(); honeys.splice(i, 1); i--; } } // Add new honey if needed if (honeys.length < 3) { var honey = new Honey(); honey.x = Math.random() * 2048; honey.y = Math.random() * -2732; honeys.push(honey); game.addChild(honey); } ; }; // Handle touch/mouse events game.down = function (x, y, obj) { // bear.x = x; // bear.y = y; }; game.move = function (x, y, obj) { // bear.x = x; // bear.y = y; }; // Initialize game initGame(); // Spawn a glitchcover instance at 200x800 var glitchcover = game.addChild(LK.getAsset('glitchcover', { anchorX: 0.5, anchorY: 0.5, x: 200, y: 800 }));
===================================================================
--- original.js
+++ change.js
@@ -37,13 +37,8 @@
anchorY: 0.5
});
self.update = function () {
self.x += windspeed * 0.5;
- if (self.x < -self.width) {
- self.x = 2048;
- } else if (self.x > 2048) {
- self.x = -self.width;
- }
};
});
// Dust class
var Dust = Container.expand(function () {
delete the inpainte area
pixelart. A redwood tree branch .. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
delete all the inpainted areas and replace them with mere transparency.
Pixelart - a cool splash screen style text saying 'Yummy!' golden yellow brown honey colors.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a cool splash screen style text saying 'Delicious Honey!' golden yellow brown honey colors. high-resolution pixel art.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art. some angry bees.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art. a full screen illustration. a likeable and very content little bear cub with a punctured and deflated red baloon is looking down from an incredibly tall redwood tree, inspecting where to get a foothold in order to climb down. The baloon has a puncture in it, from a bee sting, where air is visible flowing out of it, deflating it. the bear's face and fur is smeared a bit with all the delicious golden yellow honey he just ate, which he is enjoying and feeling satiated from. The picture should adhere to the bear's perspective, looking down the tall tree trunk towards the green meadow beneath him. It's a bright summer day with a clear blue sky. Mountains in the distance.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art. a full screen illustration. a likeable and very satiated and content little bear cub with a red baloon is flying away from an incredibly tall redwood tree at considerable height. It's a bright summer day with a clear blue sky. Forest covered mountains in the distance. The overall feel should be happy complacency, even in a place of peril.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixelart. a crouching two-headed squirrel.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.