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 = 320;
// 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) {
// Get airplane's actual scaled dimensions with reduced hitbox for better gameplay
var airplaneScaledWidth = 120 * 2.2 * 0.7; // Reduce hitbox by 30%
var airplaneScaledHeight = 60 * 2.2 * 0.7; // Reduce hitbox by 30%
var airplaneLeft = airplane.x - airplaneScaledWidth / 2;
var airplaneRight = airplane.x + airplaneScaledWidth / 2;
var airplaneTop = airplane.y - airplaneScaledHeight / 2;
var airplaneBottom = airplane.y + airplaneScaledHeight / 2;
// Get building dimensions (no scaling applied to buildings, so use original width)
var buildingWidth = 175;
var buildingLeft = self.x + 10; // Add small margin to building hitbox
var buildingRight = self.x + buildingWidth - 10; // Reduce building hitbox width
// Check if airplane is within building's x range
if (airplaneRight > buildingLeft && airplaneLeft < buildingRight) {
// Check collision with top building (add small margin)
if (airplaneTop < topBuilding.y - 5) {
return true;
}
// Check collision with bottom building (add small margin)
if (airplaneBottom > bottomBuilding.y + 5) {
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 = 180; // frames between buildings
var gameStarted = false;
var lastTapTime = 0;
var tapCooldown = 100; // milliseconds between taps (10 taps per second max)
// 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(120, buildingSpawnInterval - 5);
}
}
// Spawn new building
function spawnBuilding() {
var gapSize = 320; // Match the gap size used in Building class
var gapY = Math.floor(Math.random() * (2732 - gapSize - 600)) + 300; // Better gap positioning with margins
var building = new Building(0, 0, 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) {
var currentTime = Date.now();
if (currentTime - lastTapTime < tapCooldown) {
return; // Too soon, ignore this tap
}
lastTapTime = currentTime;
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 > 120) {
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];
// Manual collision detection for coins using proper airplane dimensions
var airplaneScaledWidth = 120 * 2.2;
var airplaneScaledHeight = 60 * 2.2;
var airplaneLeft = airplane.x - airplaneScaledWidth / 2;
var airplaneRight = airplane.x + airplaneScaledWidth / 2;
var airplaneTop = airplane.y - airplaneScaledHeight / 2;
var airplaneBottom = airplane.y + airplaneScaledHeight / 2;
var coinLeft = coin.x - 25; // coin width/2 = 50/2 = 25
var coinRight = coin.x + 25;
var coinTop = coin.y - 25; // coin height/2 = 50/2 = 25
var coinBottom = coin.y + 25;
// Check if rectangles overlap
if (airplaneRight > coinLeft && airplaneLeft < coinRight && airplaneBottom > coinTop && airplaneTop < coinBottom) {
LK.setScore(LK.getScore() + 2); // Increase score by 2 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,27 +63,27 @@
self.update = function () {
self.x += self.speed;
};
self.checkCollision = function (airplane) {
- // Get airplane's actual scaled dimensions
- var airplaneScaledWidth = 120 * 2.2; // Original width * scaleX
- var airplaneScaledHeight = 60 * 2.2; // Original height * scaleY
+ // Get airplane's actual scaled dimensions with reduced hitbox for better gameplay
+ var airplaneScaledWidth = 120 * 2.2 * 0.7; // Reduce hitbox by 30%
+ var airplaneScaledHeight = 60 * 2.2 * 0.7; // Reduce hitbox by 30%
var airplaneLeft = airplane.x - airplaneScaledWidth / 2;
var airplaneRight = airplane.x + airplaneScaledWidth / 2;
var airplaneTop = airplane.y - airplaneScaledHeight / 2;
var airplaneBottom = airplane.y + airplaneScaledHeight / 2;
- // Get building dimensions
- var buildingWidth = 175; // Original building asset width
- var buildingLeft = self.x;
- var buildingRight = self.x + buildingWidth;
+ // Get building dimensions (no scaling applied to buildings, so use original width)
+ var buildingWidth = 175;
+ var buildingLeft = self.x + 10; // Add small margin to building hitbox
+ var buildingRight = self.x + buildingWidth - 10; // Reduce building hitbox width
// Check if airplane is within building's x range
if (airplaneRight > buildingLeft && airplaneLeft < buildingRight) {
- // Check collision with top building
- if (airplaneTop < topBuilding.y) {
+ // Check collision with top building (add small margin)
+ if (airplaneTop < topBuilding.y - 5) {
return true;
}
- // Check collision with bottom building
- if (airplaneBottom > bottomBuilding.y) {
+ // Check collision with bottom building (add small margin)
+ if (airplaneBottom > bottomBuilding.y + 5) {
return true;
}
}
return false;