User prompt
Alınabilir yakıtları sıklaştır
User prompt
Yakıt deposu ekle
User prompt
Ağaç karın arasındaki boşluğa çalılar ekle
User prompt
Skoru görmem için bir tuş ekle
User prompt
Score toblosu ekle ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Arka plan için sağ sola ağçlar ekle
User prompt
Ok tuşlarını varlıklarda ki oktusu ile değiştir
User prompt
Gaz pedalı na bastığımda arbanı hızı yavaşça artsın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Oyuncunun arabası gaz pedalı na basmdan hareket etmesin
User prompt
Ben durukede diğer arabalar hareket. Etsin
User prompt
Gaz pedalına basmadığımız sürece araba hareket etmesin
User prompt
Oyuncunun arabası 150 km hızı geçemesin
User prompt
Score muz artıkça ve gitimiz metre artıkça gelen arabalr hızlansın
User prompt
Gaz pedalı na basarken gazı kesmeden sağ sol yapa biliyim
User prompt
Ok tuşlarını büyüt
User prompt
Gaz pedalı mı büyüt
User prompt
Hız göstergesi ekle
User prompt
Ok tuş larının arasını aç
User prompt
Gaz ile varlıklarda ki gaz ile değiştir
User prompt
Ok tuşlarını büyüt
User prompt
Araba nın sağ ve sola gitmesini sağlıycak iki tane ok tuşu ekle
User prompt
Gaz pedalı mı büyüt
User prompt
Gaz pedalı ekle basın ca araba hızlan son
User prompt
Arkaya otoban yolu koy
User prompt
Arka plan a bir şehirdeymişiz gibi yap
/**** * Classes ****/ var Building = Container.expand(function () { var self = Container.call(this); var buildingGraphics = self.attachAsset('cityBuildings', { anchorX: 0.5, anchorY: 1 }); self.speed = 3; self.update = function () { self.y += self.speed; }; return self; }); var Car = Container.expand(function () { var self = Container.call(this); var carGraphics = self.attachAsset('playerCar', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 0; self.targetX = 0; self.lane = 1; // 0=left, 1=center, 2=right 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 = 6; self.lastY = 0; self.lastIntersecting = false; self.update = function () { self.y += self.speed; coinGraphics.rotation += 0.1; }; return self; }); var EnemyCar = Container.expand(function () { var self = Container.call(this); var carTypes = ['enemyCar1', 'enemyCar2', 'enemyCar3']; var randomType = carTypes[Math.floor(Math.random() * carTypes.length)]; var carGraphics = self.attachAsset(randomType, { anchorX: 0.5, anchorY: 0.5 }); self.speed = 8; self.lastY = 0; self.lastIntersecting = false; self.update = function () { self.y += self.speed; }; return self; }); var Highway = Container.expand(function () { var self = Container.call(this); var highwayGraphics = self.attachAsset('highway', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 6; self.update = function () { self.y += self.speed; }; return self; }); var RoadLine = Container.expand(function () { var self = Container.call(this); var lineGraphics = self.attachAsset('roadLine', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 6; self.update = function () { self.y += self.speed; }; return self; }); /**** * Initialize Game ****/ // Game variables var game = new LK.Game({ backgroundColor: 0x2c3e50 }); /**** * Game Code ****/ // Game variables var playerCar; var enemyCars = []; var coins = []; var roadLines = []; var buildings = []; var highways = []; var gameSpeed = 6; var lanes = [2048 / 4, 2048 / 2, 3 * 2048 / 4]; // Three lanes var spawnTimer = 0; var coinSpawnTimer = 0; var roadLineSpawnTimer = 0; var buildingSpawnTimer = 0; var distanceScore = 0; var dragActive = false; // Create score display using asset var scoreDisplay = LK.getAsset('Score', { anchorX: 0.5, anchorY: 0 }); LK.gui.top.addChild(scoreDisplay); // Create score text display var scoreTxt = new Text2('0', { size: 60, fill: 0xFFFFFF }); scoreTxt.anchor.set(0, 0); scoreTxt.x = scoreDisplay.x + 60; // Position next to score image scoreTxt.y = scoreDisplay.y; LK.gui.top.addChild(scoreTxt); // Create distance display var distanceTxt = new Text2('Distance: 0m', { size: 60, fill: 0xFFFFFF }); distanceTxt.anchor.set(0.5, 0); distanceTxt.y = 100; LK.gui.top.addChild(distanceTxt); // Create initial highway segments for (var i = 0; i < 8; i++) { var highway = new Highway(); highway.x = 1024; // Center of screen highway.y = i * -400; // Space them out vertically highway.speed = gameSpeed; highways.push(highway); game.addChild(highway); } // Create initial city buildings for (var i = 0; i < 4; i++) { var building = new Building(); building.x = 1024; // Center of screen building.y = i * -400; // Space them out vertically building.speed = gameSpeed * 0.5; buildings.push(building); game.addChild(building); } // Create player car playerCar = game.addChild(new Car()); playerCar.x = lanes[1]; // Start in middle lane playerCar.y = 2732 - 300; playerCar.targetX = playerCar.x; // Touch controls game.down = function (x, y, obj) { dragActive = true; // Move car to closest lane based on touch position var closestLane = 1; var minDistance = Math.abs(x - lanes[1]); for (var i = 0; i < lanes.length; i++) { var distance = Math.abs(x - lanes[i]); if (distance < minDistance) { minDistance = distance; closestLane = i; } } playerCar.lane = closestLane; playerCar.targetX = lanes[closestLane]; }; game.move = function (x, y, obj) { if (dragActive) { // Move car to closest lane based on drag position var closestLane = 1; var minDistance = Math.abs(x - lanes[1]); for (var i = 0; i < lanes.length; i++) { var distance = Math.abs(x - lanes[i]); if (distance < minDistance) { minDistance = distance; closestLane = i; } } playerCar.lane = closestLane; playerCar.targetX = lanes[closestLane]; } }; game.up = function (x, y, obj) { dragActive = false; }; // Main game loop game.update = function () { // Smooth car movement to target lane var moveSpeed = 15; if (Math.abs(playerCar.x - playerCar.targetX) > moveSpeed) { if (playerCar.x < playerCar.targetX) { playerCar.x += moveSpeed; } else { playerCar.x -= moveSpeed; } } else { playerCar.x = playerCar.targetX; } // Increase game speed over time gameSpeed += 0.002; // Update distance score distanceScore += gameSpeed * 0.1; distanceTxt.setText('Distance: ' + Math.floor(distanceScore) + 'm'); // Spawn highway segments if (LK.ticks % 60 === 0) { var highway = new Highway(); highway.x = 1024; // Center of screen highway.y = -400; highway.speed = gameSpeed; highways.push(highway); game.addChild(highway); } // Spawn city buildings buildingSpawnTimer++; if (buildingSpawnTimer >= 80) { buildingSpawnTimer = 0; var building = new Building(); building.x = 1024; // Center of screen building.y = -400; building.speed = gameSpeed * 0.5; buildings.push(building); game.addChild(building); } // Update and check highways for (var i = highways.length - 1; i >= 0; i--) { var highway = highways[i]; highway.speed = gameSpeed; if (highway.lastY === undefined) highway.lastY = highway.y; // Remove highways that go off screen if (highway.lastY <= 2732 + 400 && highway.y > 2732 + 400) { highway.destroy(); highways.splice(i, 1); continue; } highway.lastY = highway.y; } // Update and check buildings for (var i = buildings.length - 1; i >= 0; i--) { var building = buildings[i]; building.speed = gameSpeed * 0.5; if (building.lastY === undefined) building.lastY = building.y; // Remove buildings that go off screen if (building.lastY <= 2732 + 400 && building.y > 2732 + 400) { building.destroy(); buildings.splice(i, 1); continue; } building.lastY = building.y; } // Spawn road lines roadLineSpawnTimer++; if (roadLineSpawnTimer >= 20) { roadLineSpawnTimer = 0; for (var i = 0; i < 2; i++) { var roadLine = new RoadLine(); roadLine.x = lanes[0] + i * (lanes[2] - lanes[0]); roadLine.y = -50; roadLine.speed = gameSpeed; roadLines.push(roadLine); game.addChild(roadLine); } } // Spawn enemy cars spawnTimer++; if (spawnTimer >= Math.max(30, 90 - Math.floor(gameSpeed))) { spawnTimer = 0; var enemyCar = new EnemyCar(); var randomLane = Math.floor(Math.random() * 3); enemyCar.x = lanes[randomLane]; enemyCar.y = -100; enemyCar.speed = gameSpeed + Math.random() * 3; enemyCar.lastY = enemyCar.y; enemyCar.lastIntersecting = enemyCar.intersects(playerCar); enemyCars.push(enemyCar); game.addChild(enemyCar); } // Spawn coins coinSpawnTimer++; if (coinSpawnTimer >= 120) { coinSpawnTimer = 0; if (Math.random() < 0.7) { var coin = new Coin(); var randomLane = Math.floor(Math.random() * 3); coin.x = lanes[randomLane]; coin.y = -50; coin.speed = gameSpeed; coin.lastY = coin.y; coin.lastIntersecting = coin.intersects(playerCar); coins.push(coin); game.addChild(coin); } } // Update and check road lines for (var i = roadLines.length - 1; i >= 0; i--) { var roadLine = roadLines[i]; roadLine.speed = gameSpeed; if (roadLine.lastY === undefined) roadLine.lastY = roadLine.y; // Remove road lines that go off screen if (roadLine.lastY <= 2732 + 50 && roadLine.y > 2732 + 50) { roadLine.destroy(); roadLines.splice(i, 1); continue; } roadLine.lastY = roadLine.y; } // Update and check enemy cars for (var i = enemyCars.length - 1; i >= 0; i--) { var enemyCar = enemyCars[i]; enemyCar.speed = gameSpeed + 2; // Remove cars that go off screen if (enemyCar.lastY <= 2732 + 100 && enemyCar.y > 2732 + 100) { enemyCar.destroy(); enemyCars.splice(i, 1); continue; } // Check collision with player var currentIntersecting = enemyCar.intersects(playerCar); if (!enemyCar.lastIntersecting && currentIntersecting) { // Collision detected - game over LK.getSound('crash').play(); LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); return; } enemyCar.lastY = enemyCar.y; enemyCar.lastIntersecting = currentIntersecting; } // Update and check coins for (var i = coins.length - 1; i >= 0; i--) { var coin = coins[i]; coin.speed = gameSpeed; // Remove coins that go off screen if (coin.lastY <= 2732 + 50 && coin.y > 2732 + 50) { coin.destroy(); coins.splice(i, 1); continue; } // Check collection by player var currentIntersecting = coin.intersects(playerCar); if (!coin.lastIntersecting && currentIntersecting) { // Coin collected LK.setScore(LK.getScore() + 10); scoreTxt.setText(LK.getScore().toString()); LK.getSound('collectCoin').play(); coin.destroy(); coins.splice(i, 1); continue; } coin.lastY = coin.y; coin.lastIntersecting = currentIntersecting; } };
===================================================================
--- original.js
+++ change.js
@@ -54,8 +54,20 @@
self.y += self.speed;
};
return self;
});
+var Highway = Container.expand(function () {
+ var self = Container.call(this);
+ var highwayGraphics = self.attachAsset('highway', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 6;
+ self.update = function () {
+ self.y += self.speed;
+ };
+ return self;
+});
var RoadLine = Container.expand(function () {
var self = Container.call(this);
var lineGraphics = self.attachAsset('roadLine', {
anchorX: 0.5,
@@ -84,8 +96,9 @@
var enemyCars = [];
var coins = [];
var roadLines = [];
var buildings = [];
+var highways = [];
var gameSpeed = 6;
var lanes = [2048 / 4, 2048 / 2, 3 * 2048 / 4]; // Three lanes
var spawnTimer = 0;
var coinSpawnTimer = 0;
@@ -115,8 +128,17 @@
});
distanceTxt.anchor.set(0.5, 0);
distanceTxt.y = 100;
LK.gui.top.addChild(distanceTxt);
+// Create initial highway segments
+for (var i = 0; i < 8; i++) {
+ var highway = new Highway();
+ highway.x = 1024; // Center of screen
+ highway.y = i * -400; // Space them out vertically
+ highway.speed = gameSpeed;
+ highways.push(highway);
+ game.addChild(highway);
+}
// Create initial city buildings
for (var i = 0; i < 4; i++) {
var building = new Building();
building.x = 1024; // Center of screen
@@ -182,8 +204,17 @@
gameSpeed += 0.002;
// Update distance score
distanceScore += gameSpeed * 0.1;
distanceTxt.setText('Distance: ' + Math.floor(distanceScore) + 'm');
+ // Spawn highway segments
+ if (LK.ticks % 60 === 0) {
+ var highway = new Highway();
+ highway.x = 1024; // Center of screen
+ highway.y = -400;
+ highway.speed = gameSpeed;
+ highways.push(highway);
+ game.addChild(highway);
+ }
// Spawn city buildings
buildingSpawnTimer++;
if (buildingSpawnTimer >= 80) {
buildingSpawnTimer = 0;
@@ -193,8 +224,21 @@
building.speed = gameSpeed * 0.5;
buildings.push(building);
game.addChild(building);
}
+ // Update and check highways
+ for (var i = highways.length - 1; i >= 0; i--) {
+ var highway = highways[i];
+ highway.speed = gameSpeed;
+ if (highway.lastY === undefined) highway.lastY = highway.y;
+ // Remove highways that go off screen
+ if (highway.lastY <= 2732 + 400 && highway.y > 2732 + 400) {
+ highway.destroy();
+ highways.splice(i, 1);
+ continue;
+ }
+ highway.lastY = highway.y;
+ }
// Update and check buildings
for (var i = buildings.length - 1; i >= 0; i--) {
var building = buildings[i];
building.speed = gameSpeed * 0.5;
Coin. In-Game asset. 2d. High contrast. No shadows
Yol hattı. In-Game asset. 2d. High contrast. No shadows
Score. In-Game asset. 2d. High contrast. No shadows
Şehir. In-Game asset. 2d. High contrast. No shadows
Gaz pedalı. In-Game asset. 2d. High contrast. No shadows
Sağ sola hareket oktuşuşlar. In-Game asset. 2d. High contrast. No shadows
Kuş bakışı ağaç. In-Game asset. 2d. High contrast. No shadows
Çalı. In-Game asset. 2d. High contrast. No shadows
Benzin kutusu. In-Game asset. 2d. High contrast. No shadows
Dökülmüş benzin. In-Game asset. 2d. High contrast. No shadows
Yola koyulmuş kutular. In-Game asset. 2d. High contrast. No shadows
Kuş bakışı Ferrari araba. In-Game asset. 2d. High contrast. No shadows
Kuş bakışı Lamborghini. In-Game asset. 2d. High contrast. No shadows
Kuş bakışı kosiegg. In-Game asset. 2d. High contrast. No shadows
Bugatti kuş bakışı. In-Game asset. 2d. High contrast. No shadows