User prompt
Add new asset "armour" when player reach on score 60
User prompt
Change the background colour into black and sky-blue in every 20 seconds
User prompt
Make the bird to collect bread and get power for 9 seconds
User prompt
Add new asset "bread" when player reach on score 20
User prompt
Change the background colour "black" in every 20 seconds
User prompt
increase the number of spawning of stone when player reach on score 60
User prompt
Add the function of cookie which gives energy to bird
User prompt
Add new asset " cookie" will be visible when the player reach on 20 score
User prompt
Remove clouds asset
User prompt
Make the bird that bounces from side of wall
User prompt
Make the clouds still and when the bird collides and it dies
User prompt
Make the background beautiful add cloud and sun
User prompt
Add a test when the bird goes a accident on stone or wallis "SORRY"
User prompt
Add a test when the bird dies is "SORRY"
User prompt
Make the score board cool
User prompt
Add a function of shield which make the bird invincible for 5 seconds
User prompt
Add a new object shield
User prompt
Make the bird that bounces from side of wall
User prompt
Decrease the movement speed of bird
User prompt
Make it little easier
Initial prompt
Flappy clappy
/**** * Classes ****/ // Assets will be automatically created and loaded during gameplay // Bird class var Bird = Container.expand(function () { var self = Container.call(this); var birdGraphics = self.attachAsset('bird', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.update = function () { // Bird movement logic self.x += self.vx; self.y += self.vy; }; self.vx = 0; self.vy = 0; }); // Food class var Food = Container.expand(function () { var self = Container.call(this); var foodGraphics = self.attachAsset('food', { anchorX: 0.5, anchorY: 0.5 }); }); // Tree class var Tree = Container.expand(function () { var self = Container.call(this); var treeGraphics = self.attachAsset('tree', { anchorX: 0.5, anchorY: 0.5 }); }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB // Sky blue background }); /**** * Game Code ****/ // Initialize game variables var bird = game.addChild(new Bird()); bird.x = 2048 / 2; bird.y = 2732 / 2; var trees = []; var foods = []; var score = 0; var scoreTxt = new Text2('0', { size: 150, fill: "#ffffff" }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Function to spawn trees function spawnTree() { var tree = new Tree(); tree.x = Math.random() * 2048; tree.y = Math.random() * 2732; trees.push(tree); game.addChild(tree); } // Function to spawn food function spawnFood() { var food = new Food(); food.x = Math.random() * 2048; food.y = Math.random() * 2732; foods.push(food); game.addChild(food); } // Spawn initial trees and food for (var i = 0; i < 10; i++) { spawnTree(); spawnFood(); } // Handle bird movement game.down = function (x, y, obj) { var game_position = game.toLocal(obj.global); bird.vx = (game_position.x - bird.x) / 50; bird.vy = (game_position.y - bird.y) / 50; }; // Update game state game.update = function () { bird.update(); // Check for collisions with trees for (var i = 0; i < trees.length; i++) { if (bird.intersects(trees[i])) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); return; } } // Check for collisions with food for (var i = 0; i < foods.length; i++) { if (bird.intersects(foods[i])) { score++; scoreTxt.setText(score); foods[i].destroy(); foods.splice(i, 1); spawnFood(); } } // Check for collisions with walls if (bird.x < 0 || bird.x > 2048 || bird.y < 0 || bird.y > 2732) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } };
/****
* Classes
****/
// Assets will be automatically created and loaded during gameplay
// Bird class
var Bird = Container.expand(function () {
var self = Container.call(this);
var birdGraphics = self.attachAsset('bird', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 5;
self.update = function () {
// Bird movement logic
self.x += self.vx;
self.y += self.vy;
};
self.vx = 0;
self.vy = 0;
});
// Food class
var Food = Container.expand(function () {
var self = Container.call(this);
var foodGraphics = self.attachAsset('food', {
anchorX: 0.5,
anchorY: 0.5
});
});
// Tree class
var Tree = Container.expand(function () {
var self = Container.call(this);
var treeGraphics = self.attachAsset('tree', {
anchorX: 0.5,
anchorY: 0.5
});
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB // Sky blue background
});
/****
* Game Code
****/
// Initialize game variables
var bird = game.addChild(new Bird());
bird.x = 2048 / 2;
bird.y = 2732 / 2;
var trees = [];
var foods = [];
var score = 0;
var scoreTxt = new Text2('0', {
size: 150,
fill: "#ffffff"
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Function to spawn trees
function spawnTree() {
var tree = new Tree();
tree.x = Math.random() * 2048;
tree.y = Math.random() * 2732;
trees.push(tree);
game.addChild(tree);
}
// Function to spawn food
function spawnFood() {
var food = new Food();
food.x = Math.random() * 2048;
food.y = Math.random() * 2732;
foods.push(food);
game.addChild(food);
}
// Spawn initial trees and food
for (var i = 0; i < 10; i++) {
spawnTree();
spawnFood();
}
// Handle bird movement
game.down = function (x, y, obj) {
var game_position = game.toLocal(obj.global);
bird.vx = (game_position.x - bird.x) / 50;
bird.vy = (game_position.y - bird.y) / 50;
};
// Update game state
game.update = function () {
bird.update();
// Check for collisions with trees
for (var i = 0; i < trees.length; i++) {
if (bird.intersects(trees[i])) {
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
return;
}
}
// Check for collisions with food
for (var i = 0; i < foods.length; i++) {
if (bird.intersects(foods[i])) {
score++;
scoreTxt.setText(score);
foods[i].destroy();
foods.splice(i, 1);
spawnFood();
}
}
// Check for collisions with walls
if (bird.x < 0 || bird.x > 2048 || bird.y < 0 || bird.y > 2732) {
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
}
};
A honeybee. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A glass bottle filled with honey. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A block of stone. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A shield of IRON MAN. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
sun. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Piece of bread. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
White star and give them glowing effect. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A small armour fit for honeybee. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Blue sky with white colour cloud. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Black sky with night weather and also imagine glowing white star and moon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.