User prompt
bu yerleri biraz daha sıkı tut
User prompt
uçağın geçebileceği şekilde düzenle
User prompt
place towers in random places
User prompt
more a little bit
User prompt
enlarge the plane
User prompt
geri al
User prompt
yerlerini bozmadan
User prompt
yukarıdaki kuleler aşşağı baksın
User prompt
ve dondürdüğün kuleleri eskisi gibi yerleştir
User prompt
yukarıdaki kuleleri aşşağıya dondur
User prompt
zoom the plane
User prompt
a little bit more
User prompt
and zoom more
User prompt
Extend the towers pictures to the border
User prompt
Extend the towers to the border
User prompt
Zoom in on the screen
User prompt
bigger towers and random sizes
User prompt
Hey buddy, to make this like the ''Flappy Bird'' game, place the towers at certain intervals so that they are equal at the top and bottom, and when the plane passes between the towers, give it 1 point, and the plane's speed will increase by 1 for every 15 points.
User prompt
Hey dostum bunun ''Flappy Bird'' oyununa benzemesi için belirli aralılarla üste ve alta eşit olacak şekilde kuleleri koy ve uçak kulelerin arasından geçtiğindeyse ona 1 puan ver uçağın hızı her 15 puanda 1 artsın
User prompt
binaları altta ve üstte eşit olacak şekilde yerleştir
User prompt
dostum bunu flappy bird oyununa benzetmen lazım
Code edit (1 edits merged)
Please save this source code
User prompt
Sky Scraper Flight
Initial prompt
hocam bana flappy birds yap fakar kuş yerine uçak koy ve borularda gökdelen olsun
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Airplane = Container.expand(function () {
var self = Container.call(this);
var airplaneGraphics = self.attachAsset('airplane', {
anchorX: 0.5,
anchorY: 0.5
});
self.velocity = 0;
self.gravity = 0.6;
self.jumpPower = -10;
self.maxVelocity = 12;
self.update = function () {
// Apply gravity
self.velocity += self.gravity;
// Limit velocity
if (self.velocity > self.maxVelocity) {
self.velocity = self.maxVelocity;
}
if (self.velocity < -self.maxVelocity) {
self.velocity = -self.maxVelocity;
}
// Update position
self.y += self.velocity;
// Rotate airplane based on velocity for visual effect
airplaneGraphics.rotation = Math.max(-0.5, Math.min(0.5, self.velocity * 0.05));
// Allow airplane to go off screen (will be caught by game over logic)
};
self.jump = function () {
self.velocity = self.jumpPower;
LK.getSound('fly').play();
};
return self;
});
var Building = Container.expand(function (topHeight, bottomHeight, gapY) {
var self = Container.call(this);
var gapSize = 400;
// Top building
var topBuilding = self.attachAsset('building', {
anchorX: 0,
anchorY: 1,
scaleY: (gapY - gapSize / 2) / 800
});
topBuilding.y = gapY - gapSize / 2; // Position top building at gap start
// Bottom building
var bottomBuilding = self.attachAsset('building', {
anchorX: 0,
anchorY: 0,
scaleY: (2732 - (gapY + gapSize / 2)) / 800
});
bottomBuilding.y = gapY + gapSize / 2; // Position bottom building at gap end
self.speed = -4;
self.passed = false;
self.update = function () {
self.x += self.speed;
};
self.checkCollision = function (airplane) {
var airplaneLeft = airplane.x - 50;
var airplaneRight = airplane.x + 50;
var airplaneTop = airplane.y - 25;
var airplaneBottom = airplane.y + 25;
var buildingLeft = self.x;
var buildingRight = self.x + 200;
// Check if airplane is within building's x range
if (airplaneRight > buildingLeft && airplaneLeft < buildingRight) {
// Check collision with top building
if (airplaneTop < topBuilding.y) {
return true;
}
// Check collision with bottom building
if (airplaneBottom > bottomBuilding.y) {
return true;
}
}
return false;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB,
scale: 1.5 // Zoom in by scaling the game container
});
/****
* Game Code
****/
// Game variables
var airplane;
var buildings = [];
var gameSpeed = 4;
var buildingSpawnTimer = 0;
var buildingSpawnInterval = 120; // frames between buildings
var gameStarted = false;
// UI Elements
var scoreTxt = new Text2('0', {
size: 120,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
var instructionTxt = new Text2('TAP TO FLY', {
size: 80,
fill: 0xFFFFFF
});
instructionTxt.anchor.set(0.5, 0.5);
instructionTxt.x = 1024;
instructionTxt.y = 1366;
game.addChild(instructionTxt);
// Initialize airplane
airplane = game.addChild(new Airplane());
airplane.x = 400;
airplane.y = 1366;
// Update score display
function updateScore() {
scoreTxt.setText(LK.getScore());
if (LK.getScore() % 15 === 0) {
gameSpeed += 1;
buildingSpawnInterval = Math.max(80, buildingSpawnInterval - 5);
}
}
// Spawn new building
function spawnBuilding() {
var gapY = 1366; // Center gap
var gapSize = 400; // Total gap size
var maxBuildingHeight = 1200; // Maximum height for a building
var minBuildingHeight = 600; // Minimum height for a building
var topHeight = Math.floor(Math.random() * (maxBuildingHeight - minBuildingHeight + 1)) + minBuildingHeight;
var bottomHeight = 2732 - gapSize - topHeight;
var building = new Building(topHeight, bottomHeight, gapY);
building.x = 2048 + 100; // Start off-screen to the right
buildings.push(building);
game.addChild(building);
}
// Game input handling
game.down = function (x, y, obj) {
if (!gameStarted) {
gameStarted = true;
instructionTxt.visible = false;
// Spawn first building
spawnBuilding();
}
airplane.jump();
};
// Main game loop
game.update = function () {
if (!gameStarted) return;
// Update building spawn timer
buildingSpawnTimer++;
if (buildingSpawnTimer >= buildingSpawnInterval) {
buildingSpawnTimer = 0;
spawnBuilding();
// Gradually increase difficulty
if (buildingSpawnInterval > 80) {
buildingSpawnInterval -= 0.1;
}
}
// Check collisions and update buildings
for (var i = buildings.length - 1; i >= 0; i--) {
var building = buildings[i];
// Check collision
if (building.checkCollision(airplane)) {
LK.getSound('crash').play();
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
return;
}
// Check if airplane passed building (score)
if (!building.passed && building.x + 200 < airplane.x) {
building.passed = true;
LK.setScore(LK.getScore() + 1);
updateScore();
}
// Remove buildings that are off-screen
if (building.x < -400) {
building.destroy();
buildings.splice(i, 1);
}
}
// Check ground and ceiling collision
if (airplane.y <= 30 || airplane.y >= 2702) {
LK.getSound('crash').play();
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
return;
}
};
// Initialize score display
updateScore();
// Start background music
LK.playMusic('arkaplan'); ===================================================================
--- original.js
+++ change.js
@@ -44,16 +44,16 @@
// Top building
var topBuilding = self.attachAsset('building', {
anchorX: 0,
anchorY: 1,
- scaleY: topHeight / 800
+ scaleY: (gapY - gapSize / 2) / 800
});
topBuilding.y = gapY - gapSize / 2; // Position top building at gap start
// Bottom building
var bottomBuilding = self.attachAsset('building', {
anchorX: 0,
anchorY: 0,
- scaleY: bottomHeight / 800
+ scaleY: (2732 - (gapY + gapSize / 2)) / 800
});
bottomBuilding.y = gapY + gapSize / 2; // Position bottom building at gap end
self.speed = -4;
self.passed = false;