User prompt
play the liftoff sound when game.down and !gameStarted
Code edit (1 edits merged)
Please save this source code
User prompt
create a honeycomb asset to place behind the scorelabel
Code edit (1 edits merged)
Please save this source code
Code edit (11 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: self.add is not a function' in or related to this line: 'self.add(gameOverText);' Line Number: 125
Code edit (3 edits merged)
Please save this source code
User prompt
delay the lk showgameover by tthree seconds
User prompt
bring gameoverscreen to the front before showing it
Code edit (2 edits merged)
Please save this source code
User prompt
create a fullscreen graphic for game over
Code edit (1 edits merged)
Please save this source code
User prompt
when a beehive is collected there should be an exploson of honeycomb fragments
Code edit (7 edits merged)
Please save this source code
User prompt
at start, spawn one beeswarm center screen
Code edit (1 edits merged)
Please save this source code
Code edit (5 edits merged)
Please save this source code
User prompt
make a hat object
Code edit (3 edits merged)
Please save this source code
User prompt
when signs appear, they should animate in from bottom of screen and then scale up and down briefly
Code edit (11 edits merged)
Please save this source code
User prompt
every ten times the bear collects honey, let either the yummysign or the honeysign pop up for a few seconds center bottom of screen
Code edit (1 edits merged)
Please save this source code
Code edit (13 edits merged)
Please save this source code
User prompt
make an instruction text at game start: Tap to change the wind direction
/**** * Classes ****/ // 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 = 10; self.dead = false; //self.goRight = true; self.update = function () { //self.y += self.speed; self.x += self.speed; if (LK.ticks % 5 == 0) { self.scale.x *= -1; } self.y += updriftSpeed; if (self.speed > 0) { if (self.x > 2248) { self.dead = true; } } else { if (self.x < -200) { self.dead = true; } } if (self.y > 3000) { self.dead = true; } }; }); // 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.2; self.x += 0.2; if (self.x > self.width / 2 + 2048) { self.x = 0 - self.width / 2 - 200; } }; }); // Dust class var Dust = Container.expand(function () { var self = Container.call(this); var dustGraphics = self.attachAsset('dust', { anchorX: 0.5, anchorY: 0.5 }); self.modifier = 0.5 + Math.random() * 0.5; self.update = function () { self.x += windSpeed * 2 * self.modifier; self.y += updriftSpeed + Math.random() * 2; if (self.x < 0 || self.x > 2048 || self.y < 0 || self.y > 2732) { self.x = Math.random() < 0.5 ? 0 : 2048; self.y = Math.random() * 2732; } }; }); var Hat = Container.expand(function () { var self = Container.call(this); var hatGraphics = self.attachAsset('hat', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { // Hat update logic }; }); // 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 self.y += updriftSpeed; }; }); var HoneycombFragment = Container.expand(function () { var self = Container.call(this); var fragmentGraphics = self.attachAsset('honeycombFragment', { anchorX: 0.5, anchorY: 0.5 }); self.scale.x = 1.5 - Math.random() * 0.75; self.scale.y = 1.5 - Math.random() * 0.75; self.speedX = (Math.random() - 0.5) * 10; self.speedY = (Math.random() - 0.5) * 10; self.update = function () { self.x += self.speedX; self.y += self.speedY; self.speedY += 0.5; // gravity effect if (self.y > 2732) { self.destroy(); } }; }); var Sign = Container.expand(function () { var self = Container.call(this); self.visible = false; self.show = function (type) { self.visible = true; self.attachAsset(type, { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 2300 }); LK.setTimeout(function () { self.visible = false; }, 2000); }; }); //<Assets used in the game will automatically appear here> var TreeContainer = Container.expand(function () { var self = Container.call(this); }); // Initialize game variables var TrunkPart = Container.expand(function () { var self = Container.call(this); var g1 = self.attachAsset('tree-part', { anchorX: 0.5, anchorY: 0.5 }); var g2 = self.attachAsset('tree-part-flipped', { anchorX: 0.5, anchorY: 0.5, y: 562.3 }); }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB // Sky blue background }); /**** * Game Code ****/ /* TODO * Add angry bee swarms or birds that pop the balloon. * Sounds - honey collect, baloon pop, mayeb bees, birds, maybe start sound as balloon takes off from ground. wind gust. * Maybe increase updrift as time progresses. */ var background; var glitchCover; var bear; var treeContainer; var tree; var firstSegment; var treeSegments = []; var bees = []; var honeys = []; var clouds = []; var score = 0; var scoreTxt; var windSpeed = 8; var windDirection = true; var lastBranchSpawn = 0; var treeBranches = []; var updriftSpeed = 16; var lastSideSpawnLeftRight = false; var totalHeight = 0; var gameStarted = false; //var honeyHeightsPerBranch = [-200, 0, 0, 0, 0, 0, 0, 0]; var branchPos = [[300, 130], [250, 340], [600, 220], [500, 250], [1700, 175], [1800, 340], [1400, 220], [1500, 250]]; // Initialize game elements var yummySign, honeySign; function initGame() { yummySign = new Sign(); honeySign = new Sign(); game.addChild(yummySign); game.addChild(honeySign); // Create background background = game.addChild(LK.getAsset('background', { anchorX: 0.0, anchorY: 0.0, x: -500, y: 0 })); 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); } treeContainer = new TreeContainer(); game.addChild(treeContainer); // Create tree //tree = game.addChild(LK.getAsset('tree', { tree = treeContainer.addChild(LK.getAsset('tree', { anchorX: 0.5, anchorY: 0.0, x: 1024 - 8, y: 0 //alpha: 0.2 })); // Create tree part /*firstSegment = game.addChild(LK.getAsset('tree-part', { anchorX: 0.5, anchorY: 0.0, x: 1024, y: -400 }));*/ firstSegment = new TrunkPart(); firstSegment.x = 1024; // - 8; firstSegment.y = -400; //game.addChild(firstSegment); treeContainer.addChild(firstSegment); treeSegments.push(firstSegment); // Create bear bear = new Bear(); bear.x = 500; bear.y = 2400; game.addChild(bear); // Create bees var beeSwarm = new Bee(); beeSwarm.x = 1024; beeSwarm.y = 1366; bees.push(beeSwarm); game.addChild(beeSwarm); // Create score text scoreTxt = new Text2('0', { size: 100, weight: 800, strokeThickness: 10, strokeColor: '0x000000', fill: "#ffffdd", font: "'Arial Black'" }); 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 < 30; i++) { var dust = new Dust(); dust.x = Math.random() * 2048; dust.y = Math.random() * 2732; game.addChild(dust); }*/ yummySign = new Sign(); honeySign = new Sign(); game.addChild(yummySign); game.addChild(honeySign); } // Update game elements game.update = function () { if (gameStarted) { totalHeight += updriftSpeed; bear.x += windSpeed; if (bear.x < -150 || bear.x > 2048 + bear.width / 2) { LK.showGameOver(); } if (bear.y > 1600) { bear.y -= updriftSpeed; } else { if (background.y < 1200) { background.y += updriftSpeed; glitchCover.y += updriftSpeed; } if (tree.y < 2732) { tree.y += updriftSpeed; } for (var i = 0; i < treeSegments.length; i++) { treeSegments[i].y += updriftSpeed; } for (var i = 0; i < treeBranches.length; i++) { treeBranches[i].y += updriftSpeed; } if (firstSegment.y > -1) { var t = new TrunkPart(); t.x = 1024; // - 8; t.y = -1120; //game.addChild(t); treeContainer.addChild(t); firstSegment = t; treeSegments.push(t); } // Update honeys for (var i = 0; i < honeys.length; i++) { //honeys[i].update(); if (bear.intersects(honeys[i])) { score += 10; scoreTxt.setText('' + score); LK.setScore(score); for (var j = 0; j < 10; j++) { var fragment = new HoneycombFragment(); fragment.x = honeys[i].x; fragment.y = honeys[i].y; game.addChild(fragment); } honeys[i].destroy(); honeys.splice(i, 1); if (score % 50 === 0) { if (Math.random() < 0.5) { yummySign.show('yummysign'); } else { honeySign.show('honeysign'); } } i--; } } } // 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(); } }*/ // Spawn a branch every few ticks. //if (LK.ticks - lastBranchSpawn >= 50) { if (totalHeight > 500 && totalHeight - lastBranchSpawn >= 300) { lastBranchSpawn = totalHeight; var branchType = 0; //Math.floor(Math.random() * 8) + 1; // Random branch type between 1 and 4 var flipped = lastSideSpawnLeftRight; if (flipped) { branchType = Math.floor(Math.random() * 4) + 1; } else { branchType = Math.floor(Math.random() * 4) + 5; } lastSideSpawnLeftRight = !lastSideSpawnLeftRight; //var flipped = Math.random() < 0.5 ? 1 : -1; var xx = 1024; var branch = treeContainer.addChildAt(LK.getAsset('tree-branch-' + branchType, { anchorX: 0.5, anchorY: 0.0, x: 1024, y: -1600 }), treeContainer.children.length - 1); if (branchType < 5) { branch.x -= branch.width / 2 + 50; } else { branch.x += branch.width / 2 + 50; } //lastBranchSpawn = LK.ticks; treeBranches.push(branch); //Check if this branch should have a beehive on it. if (Math.random() < 0.3 && treeBranches.length > 6) { // Add new honey if needed var honey = new Honey(); //var branchPos = [[300, 130], [250, 340], [600, 220], [500, 250], [1700, 175], [1800, 340], [1400, 220], [1500, 250]]; honey.x = branchPos[branchType - 1][0]; honey.y = branchPos[branchType - 1][1] - 1600; honeys.push(honey); game.addChild(honey); } // Check for bee swarm spawn. if (Math.random() < 0.1) { var b = new Bee(); b.x = Math.random() < 0.5 ? -500 : 2548; //b.y = 200; b.y = -600; b.speed *= b.x == -500 ? 1 : -1; bees.push(b); game.addChild(b); } } // Remove off-screen branches. for (var i = treeBranches.length - 1; i > 0; i--) { var t = treeBranches[i]; if (t.y > 3000) { treeBranches.splice(i, 1); t.destroy(); } } // Remove off-screen tree segments. for (var i = treeSegments.length - 1; i > 0; i--) { var t = treeSegments[i]; if (t.y > 3000) { treeSegments.splice(i, 1); t.destroy(); } } // Remove off-screen honeys. for (var i = honeys.length - 1; i > 0; i--) { var t = honeys[i]; if (t.y > 3000) { honeys.splice(i, 1); t.destroy(); } } // Remove off-screen bees. for (var i = bees.length - 1; i > 0; i--) { var b = bees[i]; var dx = bear.x - b.x; var dy = bear.y - b.y; dx *= dx; dy *= dy; if (dx + dy < 40000) { LK.showGameOver(); } if (b.dead) { bees.splice(i, 1); b.destroy(); } } for (var i = game.children.length - 1; i >= 0; i--) { if (game.children[i] instanceof HoneycombFragment) { game.children[i].update(); } } } }; // Handle touch/mouse events game.down = function (x, y, obj) { // bear.x = x; // bear.y = y; //windDirection = !windDirection; if (!gameStarted) { gameStarted = true; instructionTxt.destroy(); } else { windSpeed *= -1; bear.scale.x *= -1; } }; game.move = function (x, y, obj) { // bear.x = x; // bear.y = y; }; // Initialize game initGame(); // Add instruction text var instructionTxt = new Text2('Teddy, Set, Go!\n\nOnce in the air - just tap\nto change direction.', { size: 65, weight: 800, strokeThickness: 10, strokeColor: '0x000000', fill: "#ffffdd", font: "'Arial Black'", align: 'center' }); instructionTxt.anchor.set(0.5, 0); LK.gui.center.addChild(instructionTxt);
===================================================================
--- original.js
+++ change.js
@@ -102,8 +102,10 @@
var fragmentGraphics = self.attachAsset('honeycombFragment', {
anchorX: 0.5,
anchorY: 0.5
});
+ self.scale.x = 1.5 - Math.random() * 0.75;
+ self.scale.y = 1.5 - Math.random() * 0.75;
self.speedX = (Math.random() - 0.5) * 10;
self.speedY = (Math.random() - 0.5) * 10;
self.update = function () {
self.x += self.speedX;
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.