User prompt
undo
User prompt
Restart the background music from the beginning after death."
User prompt
"Increase the spacing between the towers."
User prompt
"Enlarge the hitbox areas of the towers."
User prompt
Slightly reduce the size of the hitboxes for the towers to make collisions feel more precise and fair."
User prompt
Add a visual area where non-interactive, randomly floating cloud patterns move left and right in the background along with towers.
User prompt
Increase the spacing between the towers slightly.
User prompt
Create an image element centered on the screen where users can upload a background image. name wallpaper
User prompt
When the game starts, play the sound effect called Allah until it burns
User prompt
Play the bag sound effect when the tower crashes and burns
User prompt
plane add sound effect on every mouse click sound effect name gay
Remix started
Copy Flappy Plane: Tower Dash
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ // Cloud class for floating background clouds var Cloud = Container.expand(function () { var self = Container.call(this); // Use a built-in ellipse shape for a simple cloud, or use a tower image with low alpha for a stylized look // We'll use a white ellipse for now, but you can swap to an image if you have a cloud asset var cloudShape = self.attachAsset('centerCircle', { anchorX: 0.5, anchorY: 0.5, scaleX: 2 + Math.random() * 2.5, // randomize cloud width scaleY: 1.2 + Math.random() * 1.2, tint: 0xffffff, alpha: 0.18 + Math.random() * 0.12 }); // Set initial position and speed self.x = Math.random() * GAME_WIDTH; self.y = 200 + Math.random() * (GAME_HEIGHT - 800); self.speed = 2.5 + Math.random() * 2.5; // px per frame self.direction = Math.random() < 0.5 ? 1 : -1; // left or right // For smooth drifting, clouds can change direction slowly self.driftTimer = 0; self.update = function () { if (self.lastX === undefined) self.lastX = self.x; // Move cloud self.x += self.speed * self.direction; // If cloud goes off screen, wrap to the other side if (self.x < -300) { self.x = GAME_WIDTH + 300; self.y = 200 + Math.random() * (GAME_HEIGHT - 800); } if (self.x > GAME_WIDTH + 300) { self.x = -300; self.y = 200 + Math.random() * (GAME_HEIGHT - 800); } // Occasionally change direction for a more natural float self.driftTimer++; if (self.driftTimer > 180 + Math.random() * 120) { self.direction *= -1; self.driftTimer = 0; } self.lastX = self.x; }; return self; }); // Plane class var Plane = Container.expand(function () { var self = Container.call(this); var planeSprite = self.attachAsset('plane', { anchorX: 0.5, anchorY: 0.5 }); // Physics self.vy = 0; // vertical velocity self.gravity = 1.2; // gravity per frame self.flapStrength = -22; // negative for upward // Flap method self.flap = function () { self.vy = self.flapStrength; // Animate a quick upward tilt tween.stop(planeSprite, { rotation: true }); planeSprite.rotation = -0.25; tween(planeSprite, { rotation: 0.15 }, { duration: 350, easing: tween.easeOut }); }; // Update method self.update = function () { self.vy += self.gravity; self.y += self.vy; // Clamp rotation based on vy var targetRot = Math.max(-0.3, Math.min(0.4, self.vy / 40)); planeSprite.rotation += (targetRot - planeSprite.rotation) * 0.2; }; return self; }); // TowerPair class (top and bottom towers with a gap) var TowerPair = Container.expand(function () { var self = Container.call(this); // Constants var towerWidth = 220; var towerHeight = 900; var gapHeight = 520; // Top tower var topTower = self.attachAsset('tower', { anchorX: 0.5, anchorY: 1.0 }); // Bottom tower var bottomTower = self.attachAsset('tower', { anchorX: 0.5, anchorY: 0.0 }); // Set positions self.setGapY = function (gapY) { // Clamp gapY so that the gap is always fully on screen, and towers start exactly at the top and bottom var minGapY = gapHeight / 2; var maxGapY = GAME_HEIGHT - GROUND_HEIGHT - gapHeight / 2; if (gapY < minGapY) gapY = minGapY; if (gapY > maxGapY) gapY = maxGapY; // Place top tower so its bottom aligns with the top of the gap, and its top touches the top of the screen topTower.x = 0; topTower.y = 0; topTower.height = gapY - gapHeight / 2; // The anchorY is 1.0, so height stretches from y up to 0 if (topTower.height < 0) topTower.height = 0; // Place bottom tower so its top aligns with the bottom of the gap, and its bottom touches the ground bottomTower.x = 0; bottomTower.y = gapY + gapHeight / 2; bottomTower.height = GAME_HEIGHT - GROUND_HEIGHT - bottomTower.y; if (bottomTower.height < 0) bottomTower.height = 0; }; // For collision detection self.getTopTower = function () { return topTower; }; self.getBottomTower = function () { return bottomTower; }; // For scoring self.passed = false; // Add update method: top tower rotates 180deg, bottom tower is pinned self.update = function () { if (self.lastX === undefined) self.lastX = self.x; // Top tower: rotate 180deg (PI radians) self.getTopTower().rotation = Math.PI; // Bottom tower: no rotation self.getBottomTower().rotation = 0; self.lastX = self.x; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ // No title, no description backgroundColor: 0x87ceeb }); /**** * Game Code ****/ // Game constants // Plane: yellow box, 120x80 // Tower: green box, 220x900 // Ground: brown box, 2048x120 // Sound: point // Sound: hit var GAME_WIDTH = 2048; var GAME_HEIGHT = 2732; var GROUND_HEIGHT = 120; var PLANE_START_X = 600; var PLANE_START_Y = 1100; var TOWER_GAP = 520; var TOWER_WIDTH = 220; var TOWER_HEIGHT = 900; var TOWER_MIN_Y = 600 + TOWER_GAP / 2; var TOWER_MAX_Y = GAME_HEIGHT - GROUND_HEIGHT - 400 - TOWER_GAP / 2; var TOWER_INTERVAL = 1050; // horizontal distance between towers (increased for more spacing) var TOWER_SPEED = 14; // px per frame // Wallpaper image element (centered, user can upload) var wallpaper = LK.getAsset('wallpaper', { anchorX: 0.5, anchorY: 0.5, x: GAME_WIDTH / 2, y: GAME_HEIGHT / 2 }); game.addChild(wallpaper); // Add clouds array and spawn clouds in the background var clouds = []; var NUM_CLOUDS = 7 + Math.floor(Math.random() * 3); // 7-9 clouds for (var i = 0; i < NUM_CLOUDS; i++) { var cloud = new Cloud(); clouds.push(cloud); // Add behind wallpaper and towers, but above background game.addChild(cloud); } // Allow user to upload a background image for wallpaper if (typeof LK.uploadImage === "function") { LK.uploadImage(function (imgAssetId) { // Replace wallpaper texture with uploaded image wallpaper.setAsset(imgAssetId); }); } // Game state var plane; var towers = []; var ground; var score = 0; var scoreTxt; var gameStarted = false; var gameOver = false; var lastTowerX = 0; // Add ground ground = LK.getAsset('ground', { anchorX: 0, anchorY: 0, x: 0, y: GAME_HEIGHT - GROUND_HEIGHT }); game.addChild(ground); // Add plane plane = new Plane(); game.addChild(plane); plane.x = PLANE_START_X; plane.y = PLANE_START_Y; // Add score text scoreTxt = new Text2('0', { size: 150, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Helper: reset game state function resetGame() { // Remove towers for (var i = 0; i < towers.length; i++) { towers[i].destroy(); } towers = []; // Reset plane plane.x = PLANE_START_X; plane.y = PLANE_START_Y; plane.vy = 0; // Reset score score = 0; scoreTxt.setText(score); // Reset state gameStarted = false; gameOver = false; lastTowerX = GAME_WIDTH + 600; // Add initial towers for (var i = 0; i < 3; i++) { spawnTower(GAME_WIDTH + 600 + i * TOWER_INTERVAL); } // Play 'allah' sound effect when the game starts if (LK.getSound('allah')) { LK.getSound('allah').play(); } } // Helper: spawn a tower pair at x function spawnTower(x) { var gapY = TOWER_MIN_Y + Math.random() * (TOWER_MAX_Y - TOWER_MIN_Y); var towerPair = new TowerPair(); towerPair.x = x; towerPair.setGapY(gapY); game.addChild(towerPair); towers.push(towerPair); } // Start game resetGame(); // Input: tap anywhere to flap game.down = function (x, y, obj) { if (gameOver) return; if (!gameStarted) { gameStarted = true; } plane.flap(); LK.getSound('gay').play(); }; // Main update loop game.update = function () { if (gameOver) return; // Update clouds always (background effect) for (var i = 0; i < clouds.length; i++) { if (typeof clouds[i].update === "function") clouds[i].update(); } if (gameStarted) { // Move towers for (var i = towers.length - 1; i >= 0; i--) { var t = towers[i]; t.x -= TOWER_SPEED; // Update tower (for rotation) if (typeof t.update === "function") t.update(); // Remove towers off screen if (t.x < -TOWER_WIDTH) { t.destroy(); towers.splice(i, 1); } } // Spawn new towers if (towers.length === 0 || towers[towers.length - 1].x < GAME_WIDTH - TOWER_INTERVAL) { spawnTower(GAME_WIDTH + TOWER_WIDTH); } // Plane physics plane.update(); // Collision: ground if (plane.y + 40 > GAME_HEIGHT - GROUND_HEIGHT) { plane.y = GAME_HEIGHT - GROUND_HEIGHT - 40; endGame(); return; } // Collision: ceiling if (plane.y - 40 < 0) { plane.y = 40; plane.vy = 0; } // Collision: towers var _loop = function _loop() { t = towers[i]; // Only check if in range if (Math.abs(t.x - plane.x) < TOWER_WIDTH) { // AABB collision helper var aabb = function aabb(a, b) { return a.x < b.x + b.width && a.x + a.width > b.x && a.y < b.y + b.height && a.y + a.height > b.y; }; // Top // Enlarge hitboxes for less fair, more challenging collision top = t.getTopTower(); bottom = t.getBottomTower(); marginX = -24; // px to ENLARGE from each side (total 48px more width) marginY = -18; // px to ENLARGE from top/bottom // Get bounds for top tower topBounds = { x: top.x + t.x - top.width / 2 + marginX, y: top.y - top.height + marginY, width: top.width - marginX * 2, height: top.height - marginY }; // Get bounds for bottom tower bottomBounds = { x: bottom.x + t.x - bottom.width / 2 + marginX, y: bottom.y + marginY, width: bottom.width - marginX * 2, height: bottom.height - marginY }; // Get plane bounds (plane is centered, 280x298.2) planeMarginX = 18, planeMarginY = 10; planeBounds = { x: plane.x - 140 + planeMarginX, y: plane.y - 149.1 + planeMarginY, width: 280 - planeMarginX * 2, height: 298.2 - planeMarginY * 2 }; if (aabb(planeBounds, topBounds) || aabb(planeBounds, bottomBounds)) { // Explosion effect: flash screen and shake plane LK.effects.flashScreen(0xffcc00, 300); // Play 'bag' sound effect for tower crash LK.getSound('bag').play(); // Fire effect: tint plane orange for 2 seconds fireTween = tween(plane, { tint: 0xff6600 }, { duration: 200, yoyo: true, repeat: 9 // 10 flashes (200ms * 10 = 2s) }); // Shake plane using tween tween(plane, { x: plane.x + 30 }, { duration: 60, yoyo: true, repeat: 3, onComplete: function onComplete() { plane.x = PLANE_START_X; } }); endGame(); return { v: void 0 }; } } // Scoring: passed tower if (!t.passed && t.x + TOWER_WIDTH / 2 < plane.x) { t.passed = true; score += 1; scoreTxt.setText(score); LK.getSound('point').play(); } }, t, top, bottom, marginX, marginY, topBounds, bottomBounds, planeMarginX, planeMarginY, planeBounds, fireTween, _ret; for (var i = 0; i < towers.length; i++) { _ret = _loop(); if (_ret) return _ret.v; } } else { // Idle: plane bobs up and down plane.y = PLANE_START_Y + Math.sin(LK.ticks / 30) * 30; plane.vy = 0; } }; // End game function endGame() { if (gameOver) return; gameOver = true; LK.getSound('hit').play(); LK.effects.flashScreen(0xff0000, 2000); // Stop 'allah' sound effect when the plane burns if (LK.getSound('allah')) { LK.getSound('allah').stop(); } // After 2 seconds, show game over LK.setTimeout(function () { LK.showGameOver(); }, 2000); } // No drag or move needed for this game
===================================================================
--- original.js
+++ change.js
@@ -168,9 +168,9 @@
var TOWER_WIDTH = 220;
var TOWER_HEIGHT = 900;
var TOWER_MIN_Y = 600 + TOWER_GAP / 2;
var TOWER_MAX_Y = GAME_HEIGHT - GROUND_HEIGHT - 400 - TOWER_GAP / 2;
-var TOWER_INTERVAL = 850; // horizontal distance between towers (increased for more spacing)
+var TOWER_INTERVAL = 1050; // horizontal distance between towers (increased for more spacing)
var TOWER_SPEED = 14; // px per frame
// Wallpaper image element (centered, user can upload)
var wallpaper = LK.getAsset('wallpaper', {
anchorX: 0.5,
width : 1000 height : 500 road. In-Game asset. 2d. High contrast. No shadows
Design a cartoon-style character inspired by Head Ball characters, but themed as a fighter jet. The character should have an oversized head (like in the original Head Ball game), but instead of a human body, the head is mounted on a small cartoon fighter jet body. The jet should be stylized and playful, with exaggerated features like short wings, colorful decals, and a compact, fun shape. The cockpit should seamlessly blend into the character's neck or jawline area. The jet can have arms coming out from the sides of the fuselage like wings, and the rear part can have feet-like tail fins resembling shoes. The overall design should feel dynamic, energetic, and arcade-like, as if mid-flight in a blue sky or cockpit environment. The face should be: A cartoon-style floating head of a chubby young man with a round, soft face. He has thick curly short hair, a bushy mustache, and a mischievous half-smile with slightly squinted eyes. His cheeks are full, and his expression is confident and che. In-Game asset. 2d. High contrast. No shadows
"TanjuGo" "Tower Destruction" text logo. In-Game asset. 2d. High contrast. No shadows
"A 2D in-game asset of a skyscraper, showing only one face of the tower. The design should be high contrast with no shadows.". In-Game asset. 2d. High contrast. No shadows
white sky. In-Game asset. 2d. High contrast. No shadows