User prompt
İncrease distance pipe to pipe
User prompt
İncrease distance pipe to pipe
User prompt
Make everything better ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Add all Real flapy bird thing ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Can you add health bar
User prompt
İncrease distance pipe to pipe
User prompt
Decrase distance of pipe to pipe
User prompt
Add some spacn point
User prompt
Decrease size of pipe to pipe
User prompt
Add coin at among of pipe
User prompt
Reset last adding
User prompt
Make more birde jumping
Code edit (1 edits merged)
Please save this source code
User prompt
Flappy Bird
Initial prompt
Make me flaapy bird
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Bird = Container.expand(function () { var self = Container.call(this); var birdGraphics = self.attachAsset('bird', { anchorX: 0.5, anchorY: 0.5 }); self.velocity = 0; self.gravity = 0.8; self.flapStrength = -12; self.maxFallSpeed = 15; self.rotation = 0; self.flap = function () { self.velocity = self.flapStrength; LK.getSound('flap').play(); // Animate bird rotation for flapping effect tween(birdGraphics, { rotation: -0.3 }, { duration: 100 }); tween(birdGraphics, { rotation: 0 }, { duration: 200 }); }; self.update = function () { // Apply gravity self.velocity += self.gravity; // Limit fall speed if (self.velocity > self.maxFallSpeed) { self.velocity = self.maxFallSpeed; } // Update position self.y += self.velocity; // Rotate bird based on velocity if (self.velocity > 0) { birdGraphics.rotation = Math.min(self.velocity * 0.1, 1.5); } else { birdGraphics.rotation = Math.max(self.velocity * 0.1, -0.5); } }; return self; }); var Pipe = Container.expand(function () { var self = Container.call(this); self.gapHeight = 300; self.speed = -4; self.scored = false; // Create top pipe self.topPipe = self.attachAsset('pipe', { anchorX: 0.5, anchorY: 1 }); // Create bottom pipe self.bottomPipe = self.attachAsset('pipe', { anchorX: 0.5, anchorY: 0 }); self.setupPipes = function (gapCenterY) { self.topPipe.y = gapCenterY - self.gapHeight / 2; self.bottomPipe.y = gapCenterY + self.gapHeight / 2; }; self.update = function () { self.x += self.speed; }; self.checkCollision = function (bird) { var birdBounds = { left: bird.x - 30, right: bird.x + 30, top: bird.y - 30, bottom: bird.y + 30 }; var pipeBounds = { left: self.x - 60, right: self.x + 60, topBottom: self.topPipe.y, bottomTop: self.bottomPipe.y }; // Check if bird is within pipe horizontal bounds if (birdBounds.right > pipeBounds.left && birdBounds.left < pipeBounds.right) { // Check collision with top or bottom pipe if (birdBounds.top < pipeBounds.topBottom || birdBounds.bottom > pipeBounds.bottomTop) { return true; } } return false; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB }); /**** * Game Code ****/ var bird; var pipes = []; var ground; var gameStarted = false; var gameActive = true; var pipeSpawnTimer = 0; var pipeSpawnInterval = 90; // 1.5 seconds at 60fps // Create score display var scoreTxt = new Text2('0', { size: 80, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Create start instruction var startTxt = new Text2('TAP TO START', { size: 60, fill: 0xFFFFFF }); startTxt.anchor.set(0.5, 0.5); startTxt.x = 2048 / 2; startTxt.y = 2732 / 2 - 200; game.addChild(startTxt); // Initialize bird bird = new Bird(); bird.x = 2048 / 4; bird.y = 2732 / 2; game.addChild(bird); // Create ground ground = game.attachAsset('ground', { anchorX: 0, anchorY: 0, x: 0, y: 2732 - 100 }); function spawnPipe() { var pipe = new Pipe(); pipe.x = 2048 + 60; // Random gap center position var minGapCenter = 200; var maxGapCenter = 2732 - 200 - 100; // Account for ground var gapCenterY = minGapCenter + Math.random() * (maxGapCenter - minGapCenter); pipe.setupPipes(gapCenterY); pipes.push(pipe); game.addChild(pipe); } function checkScore() { for (var i = 0; i < pipes.length; i++) { var pipe = pipes[i]; if (!pipe.scored && pipe.x < bird.x) { pipe.scored = true; LK.setScore(LK.getScore() + 1); scoreTxt.setText(LK.getScore().toString()); LK.getSound('score').play(); } } } function checkCollisions() { // Check pipe collisions for (var i = 0; i < pipes.length; i++) { if (pipes[i].checkCollision(bird)) { return true; } } // Check ground collision if (bird.y + 30 > ground.y) { return true; } // Check ceiling collision if (bird.y - 30 < 0) { return true; } return false; } function gameOver() { gameActive = false; LK.getSound('hit').play(); // Stop bird movement bird.velocity = 0; // Flash screen red LK.effects.flashScreen(0xff0000, 1000); // Show game over after a brief delay LK.setTimeout(function () { LK.showGameOver(); }, 500); } // Touch/tap handler game.down = function (x, y, obj) { if (!gameStarted) { gameStarted = true; gameActive = true; startTxt.visible = false; // Spawn first pipe spawnPipe(); } if (gameActive) { bird.flap(); } }; // Main game loop game.update = function () { if (!gameStarted || !gameActive) { return; } // Update bird bird.update(); // Update pipes for (var i = pipes.length - 1; i >= 0; i--) { pipes[i].update(); // Remove pipes that have moved off screen if (pipes[i].x < -120) { pipes[i].destroy(); pipes.splice(i, 1); } } // Spawn new pipes pipeSpawnTimer++; if (pipeSpawnTimer >= pipeSpawnInterval) { spawnPipe(); pipeSpawnTimer = 0; } // Check for score checkScore(); // Check for collisions if (checkCollisions()) { gameOver(); } };
===================================================================
--- original.js
+++ change.js
@@ -1,6 +1,237 @@
-/****
+/****
+* Plugins
+****/
+var tween = LK.import("@upit/tween.v1");
+
+/****
+* Classes
+****/
+var Bird = Container.expand(function () {
+ var self = Container.call(this);
+ var birdGraphics = self.attachAsset('bird', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.velocity = 0;
+ self.gravity = 0.8;
+ self.flapStrength = -12;
+ self.maxFallSpeed = 15;
+ self.rotation = 0;
+ self.flap = function () {
+ self.velocity = self.flapStrength;
+ LK.getSound('flap').play();
+ // Animate bird rotation for flapping effect
+ tween(birdGraphics, {
+ rotation: -0.3
+ }, {
+ duration: 100
+ });
+ tween(birdGraphics, {
+ rotation: 0
+ }, {
+ duration: 200
+ });
+ };
+ self.update = function () {
+ // Apply gravity
+ self.velocity += self.gravity;
+ // Limit fall speed
+ if (self.velocity > self.maxFallSpeed) {
+ self.velocity = self.maxFallSpeed;
+ }
+ // Update position
+ self.y += self.velocity;
+ // Rotate bird based on velocity
+ if (self.velocity > 0) {
+ birdGraphics.rotation = Math.min(self.velocity * 0.1, 1.5);
+ } else {
+ birdGraphics.rotation = Math.max(self.velocity * 0.1, -0.5);
+ }
+ };
+ return self;
+});
+var Pipe = Container.expand(function () {
+ var self = Container.call(this);
+ self.gapHeight = 300;
+ self.speed = -4;
+ self.scored = false;
+ // Create top pipe
+ self.topPipe = self.attachAsset('pipe', {
+ anchorX: 0.5,
+ anchorY: 1
+ });
+ // Create bottom pipe
+ self.bottomPipe = self.attachAsset('pipe', {
+ anchorX: 0.5,
+ anchorY: 0
+ });
+ self.setupPipes = function (gapCenterY) {
+ self.topPipe.y = gapCenterY - self.gapHeight / 2;
+ self.bottomPipe.y = gapCenterY + self.gapHeight / 2;
+ };
+ self.update = function () {
+ self.x += self.speed;
+ };
+ self.checkCollision = function (bird) {
+ var birdBounds = {
+ left: bird.x - 30,
+ right: bird.x + 30,
+ top: bird.y - 30,
+ bottom: bird.y + 30
+ };
+ var pipeBounds = {
+ left: self.x - 60,
+ right: self.x + 60,
+ topBottom: self.topPipe.y,
+ bottomTop: self.bottomPipe.y
+ };
+ // Check if bird is within pipe horizontal bounds
+ if (birdBounds.right > pipeBounds.left && birdBounds.left < pipeBounds.right) {
+ // Check collision with top or bottom pipe
+ if (birdBounds.top < pipeBounds.topBottom || birdBounds.bottom > pipeBounds.bottomTop) {
+ return true;
+ }
+ }
+ return false;
+ };
+ return self;
+});
+
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000
-});
\ No newline at end of file
+ backgroundColor: 0x87CEEB
+});
+
+/****
+* Game Code
+****/
+var bird;
+var pipes = [];
+var ground;
+var gameStarted = false;
+var gameActive = true;
+var pipeSpawnTimer = 0;
+var pipeSpawnInterval = 90; // 1.5 seconds at 60fps
+// Create score display
+var scoreTxt = new Text2('0', {
+ size: 80,
+ fill: 0xFFFFFF
+});
+scoreTxt.anchor.set(0.5, 0);
+LK.gui.top.addChild(scoreTxt);
+// Create start instruction
+var startTxt = new Text2('TAP TO START', {
+ size: 60,
+ fill: 0xFFFFFF
+});
+startTxt.anchor.set(0.5, 0.5);
+startTxt.x = 2048 / 2;
+startTxt.y = 2732 / 2 - 200;
+game.addChild(startTxt);
+// Initialize bird
+bird = new Bird();
+bird.x = 2048 / 4;
+bird.y = 2732 / 2;
+game.addChild(bird);
+// Create ground
+ground = game.attachAsset('ground', {
+ anchorX: 0,
+ anchorY: 0,
+ x: 0,
+ y: 2732 - 100
+});
+function spawnPipe() {
+ var pipe = new Pipe();
+ pipe.x = 2048 + 60;
+ // Random gap center position
+ var minGapCenter = 200;
+ var maxGapCenter = 2732 - 200 - 100; // Account for ground
+ var gapCenterY = minGapCenter + Math.random() * (maxGapCenter - minGapCenter);
+ pipe.setupPipes(gapCenterY);
+ pipes.push(pipe);
+ game.addChild(pipe);
+}
+function checkScore() {
+ for (var i = 0; i < pipes.length; i++) {
+ var pipe = pipes[i];
+ if (!pipe.scored && pipe.x < bird.x) {
+ pipe.scored = true;
+ LK.setScore(LK.getScore() + 1);
+ scoreTxt.setText(LK.getScore().toString());
+ LK.getSound('score').play();
+ }
+ }
+}
+function checkCollisions() {
+ // Check pipe collisions
+ for (var i = 0; i < pipes.length; i++) {
+ if (pipes[i].checkCollision(bird)) {
+ return true;
+ }
+ }
+ // Check ground collision
+ if (bird.y + 30 > ground.y) {
+ return true;
+ }
+ // Check ceiling collision
+ if (bird.y - 30 < 0) {
+ return true;
+ }
+ return false;
+}
+function gameOver() {
+ gameActive = false;
+ LK.getSound('hit').play();
+ // Stop bird movement
+ bird.velocity = 0;
+ // Flash screen red
+ LK.effects.flashScreen(0xff0000, 1000);
+ // Show game over after a brief delay
+ LK.setTimeout(function () {
+ LK.showGameOver();
+ }, 500);
+}
+// Touch/tap handler
+game.down = function (x, y, obj) {
+ if (!gameStarted) {
+ gameStarted = true;
+ gameActive = true;
+ startTxt.visible = false;
+ // Spawn first pipe
+ spawnPipe();
+ }
+ if (gameActive) {
+ bird.flap();
+ }
+};
+// Main game loop
+game.update = function () {
+ if (!gameStarted || !gameActive) {
+ return;
+ }
+ // Update bird
+ bird.update();
+ // Update pipes
+ for (var i = pipes.length - 1; i >= 0; i--) {
+ pipes[i].update();
+ // Remove pipes that have moved off screen
+ if (pipes[i].x < -120) {
+ pipes[i].destroy();
+ pipes.splice(i, 1);
+ }
+ }
+ // Spawn new pipes
+ pipeSpawnTimer++;
+ if (pipeSpawnTimer >= pipeSpawnInterval) {
+ spawnPipe();
+ pipeSpawnTimer = 0;
+ }
+ // Check for score
+ checkScore();
+ // Check for collisions
+ if (checkCollisions()) {
+ gameOver();
+ }
+};
\ No newline at end of file
Make bird same like flappy bird. In-Game asset. 2d. No shadows
Make background forest. In-Game asset. 2d. No shadows
Flapy bird coin. In-Game asset. 2d. No shadows
Make it flapy bird cloud. In-Game asset. 2d. High contrast. No shadows
Add a monkey flying with plane. In-Game asset. 2d. No shadows
Make a zombi flapy bird. In-Game asset. 2d. High contrast. No shadows
Make a sigma flapy bird. In-Game asset. 2d. No shadows
Make a star War flapy bird. In-Game asset. 2d. No shadows
Make a gost flapy bird. In-Game asset. 2d. High contrast. No shadows
Make a starting buton. In-Game asset. 2d. High contrast. No shadows
Make a skin buton. In-Game asset. 2d. No shadows
Make it flapy bird building. 2d. No shadows
Make it flapy bird shape. 2d. High contrast. No shadows
Make it flapy bird building. In-Game asset. 2d. No shadows