User prompt
pause tuşuna tıklandığında oyun durmak yerine devam etsin ve üstte kırmızı renkli bir yazı ile ''you cant stop in my game'' yazsın
User prompt
daha hızlı tıklama
User prompt
çimenleri kaldır ve yerine kum ekle balık gölgelerini daha gerçelçi yap ve bulut ekle
User prompt
arkaplandaki şehri kaldır ve yerine deniz ve içindeki balıkların gölgelerini ekle
User prompt
arkaplandaki şehri değiştir daha az renkli ve daha gerçekçi bir şehir kullan ve küçült lütfen
User prompt
çimenleri biraz daha gercekci yap
User prompt
aşşağıya gğzel görünmesi için biraz çimen ekle ve arkaplanada modern bir şehi resmi koy
User prompt
Show the 1st, 2nd and 3rd highest scorers among all users on the leaderboard ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
change game name ''9/11''
User prompt
Add menu and play option to menu as well as add a leaderboard for users ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
kuleleri biririnden biraz uzaklaştır
User prompt
dostum kulelere carpmamama rağmen ölüyorum lütfen hitboxları düzelt amk
User prompt
daha hızlı tıklama izni ver
User prompt
binaları birbirlerinden uzaklaştır
User prompt
delikleri daha uygun yap
User prompt
coinler 2 puan versin
User prompt
fix towers and airplane hitboxes
User prompt
fix towers hitboxes
User prompt
and add coins to some places
User prompt
Expand gaps that give points when passed thro
User prompt
kulelerdeki araları büyüt
User prompt
araları kesinlikle geçilebilecek şekilde yap
User prompt
ekranı biraz küçült
User prompt
kulelerin aralarını biraz aç
User prompt
uçak kule aralarında çok takılıyor hitboxu füzenlermisin
/****
* 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,
scaleX: 2.2,
scaleY: 2.2
});
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) / 100,
rotation: 0 // Revert the rotation of the top building to its original orientation
});
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)) / 100
});
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 - airplane.width / 2;
var airplaneRight = airplane.x + airplane.width / 2;
var airplaneTop = airplane.y - airplane.height / 2;
var airplaneBottom = airplane.y + airplane.height / 2;
var buildingLeft = self.x;
var buildingRight = self.x + topBuilding.width;
// 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;
});
var Coin = Container.expand(function () {
var self = Container.call(this);
var coinGraphics = self.attachAsset('coin', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = -4;
self.update = function () {
self.x += self.speed;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB,
scale: 2.0 // Reduce the scale to make the screen appear smaller
});
/****
* 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 = Math.floor(Math.random() * (2732 - 800)) + 400; // Randomize gap Y position between 400 and 1932
var gapSize = 1000; // 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);
// Randomly decide whether to spawn a coin
if (Math.random() < 0.5) {
// 50% chance to spawn a coin
var coin = new Coin();
coin.x = building.x + 100; // Position coin in the middle of the gap
coin.y = gapY; // Align coin vertically with the gap
game.addChild(coin);
}
}
// 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 for collisions with coins
var coins = game.children.filter(function (child) {
return child instanceof Coin;
});
for (var j = coins.length - 1; j >= 0; j--) {
var coin = coins[j];
if (airplane.intersects(coin)) {
LK.setScore(LK.getScore() + 5); // Increase score by 5 for collecting a coin
updateScore();
coin.destroy();
coins.splice(j, 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
@@ -63,14 +63,14 @@
self.update = function () {
self.x += self.speed;
};
self.checkCollision = function (airplane) {
- var airplaneLeft = airplane.x - 40;
- var airplaneRight = airplane.x + 40;
- var airplaneTop = airplane.y - 20;
- var airplaneBottom = airplane.y + 20;
+ var airplaneLeft = airplane.x - airplane.width / 2;
+ var airplaneRight = airplane.x + airplane.width / 2;
+ var airplaneTop = airplane.y - airplane.height / 2;
+ var airplaneBottom = airplane.y + airplane.height / 2;
var buildingLeft = self.x;
- var buildingRight = self.x + 200;
+ var buildingRight = self.x + topBuilding.width;
// Check if airplane is within building's x range
if (airplaneRight > buildingLeft && airplaneLeft < buildingRight) {
// Check collision with top building
if (airplaneTop < topBuilding.y) {