User prompt
arabalarin hizini 30x e cikart
User prompt
arabalar niye cok yavas gidiyor, onlari hizli yap.
User prompt
uzunlugu eskisi gibi yap bunu begenmedim
User prompt
yollarin uzunlugunu kisalt
User prompt
daha cok hizlandir
User prompt
arabalar niye yavaş? onlari hizli yap
User prompt
arabalari hizlandir
User prompt
butun arabalarin hizi 3x sabit olsun ve eger sadece 1 tane arabaya carparsam yaralanayim olmeyeyim 2. arabaya carparsam oleyim
User prompt
hizli olan arabalarin hizini 2x dusur
User prompt
yavas olan arabalarin hizini 1x daha arttir
User prompt
yavas olan arabalarin hizini 1x arttir hizli olanlarin ise 1.5x dusur
User prompt
her bitirdigimde puanlar 1 er 1 er artsin ve olursem puanlarim sifirlansin
User prompt
puani alinca tavugumu baslangica isinla
User prompt
10 puan yaptigimda ise bir soru sor: bonus puan denemek ister misin yoksa devam et. eger oyuncu bonus puani denemeyi secerse arabalar daha cok olsun ve yavas olanlari kaldir, eger devam ederse normal oldugu gibi devam etsin. eger bonus puan da yenilirse puani azalmasin ve normal devam etsin, yenerse puani 10 artsin ve normal devam etsin
User prompt
bir kere yolun tamamini gectigimde 11 puan artiyor, bunu 1 yap
User prompt
degisik bir hata var, tavuk bir yoldan diger yolar direk gecsin yesillik alanda veya cizgide durmasin
User prompt
arabalar yolun tam ustunde olsun cizgide degil ve yol daha duzgun olsun
User prompt
bazi arabalar biraz daha yavas olsun cok yavas degil biraz bir de yavas araba carptiginda ölmeyelim sadece yaralanalim yaralanma efekti ekle ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
arabalari bir tik azalt ve yolu biraz uzat
User prompt
puan yazan yeri yolun sonuna getir
User prompt
0 yazan yeri yolun sonuna getir
User prompt
yollari bitirdigimde puan gelsin hemen ve basa gideyim tekrar ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
boyle iyi ama 4 yol daha ekle ileriye
User prompt
daha fazla araba olsun ve benim basladigim yerdeki yollari sil
User prompt
3x hizlandir arabalari
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var Car = Container.expand(function (direction, speed, lane) {
var self = Container.call(this);
var carGraphics = self.attachAsset('car', {
anchorX: 0.5,
anchorY: 0.5
});
self.direction = direction; // 1 for right, -1 for left
self.speed = speed;
self.lane = lane;
// Position car based on direction
if (self.direction === 1) {
self.x = -60; // Start from left
} else {
self.x = 2048 + 60; // Start from right
}
self.y = 2732 - 250 - lane * 180; // Position in center of road with new spacing
self.update = function () {
self.x += self.speed * self.direction;
// Remove car when it goes off screen
if (self.direction === 1 && self.x > 2048 + 100) {
self.removeFromParent = true;
} else if (self.direction === -1 && self.x < -100) {
self.removeFromParent = true;
}
};
return self;
});
var Chicken = Container.expand(function () {
var self = Container.call(this);
var chickenGraphics = self.attachAsset('chicken', {
anchorX: 0.5,
anchorY: 0.5
});
self.moveStep = 100;
self.isMoving = false;
self.targetY = 2732 - 100; // Start near bottom
self.moveForward = function () {
if (self.isMoving) return;
self.isMoving = true;
// Calculate next valid road position
var currentY = self.y;
var nextRoadY = null;
var roadSpacing = 180;
var startY = 2732 - 250;
// Find the next road position above current position
for (var i = 0; i < 12; i++) {
var roadY = startY - i * roadSpacing;
if (roadY < currentY && roadY >= 0) {
nextRoadY = roadY;
break;
}
}
// If no road found above, move to finish line
if (nextRoadY === null) {
nextRoadY = 50;
}
// Animate movement directly to next road
tween(self, {
y: nextRoadY
}, {
duration: 200,
easing: tween.easeOut,
onFinish: function onFinish() {
self.isMoving = false;
// Check if crossed a road
if (self.y < 150) {
// Crossed all roads, reset and increase score
crossedRoad();
}
}
});
LK.getSound('move').play();
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x4CAF50
});
/****
* Game Code
****/
var chicken;
var cars = [];
var roads = [];
var gameSpeed = 1;
var carSpawnTimer = 0;
var carSpawnRate = 30; // frames between car spawns - slightly reduced cars
var crossedRoads = 0;
var bonusMode = false;
var questionAsked = false;
var waitingForAnswer = false;
// Create score display
var scoreTxt = new Text2('0', {
size: 100,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0.5);
scoreTxt.x = 1024; // Center horizontally
scoreTxt.y = 50; // Position at the top end of roads
game.addChild(scoreTxt);
// Create bonus question UI elements
var questionTxt = new Text2('Bonus puan denemek ister misin?', {
size: 60,
fill: 0xFFFFFF
});
questionTxt.anchor.set(0.5, 0.5);
questionTxt.x = 1024;
questionTxt.y = 1366;
questionTxt.visible = false;
game.addChild(questionTxt);
var bonusBtn = new Text2('BONUS', {
size: 50,
fill: 0x00FF00
});
bonusBtn.anchor.set(0.5, 0.5);
bonusBtn.x = 850;
bonusBtn.y = 1500;
bonusBtn.visible = false;
game.addChild(bonusBtn);
var continueBtn = new Text2('DEVAM ET', {
size: 50,
fill: 0x0080FF
});
continueBtn.anchor.set(0.5, 0.5);
continueBtn.x = 1200;
continueBtn.y = 1500;
continueBtn.visible = false;
game.addChild(continueBtn);
// Functions to show/hide bonus question
function showBonusQuestion() {
questionTxt.visible = true;
bonusBtn.visible = true;
continueBtn.visible = true;
waitingForAnswer = true;
}
function hideBonusQuestion() {
questionTxt.visible = false;
bonusBtn.visible = false;
continueBtn.visible = false;
waitingForAnswer = false;
}
function startBonusMode() {
bonusMode = true;
hideBonusQuestion();
// Make cars faster and remove slow cars
carSpawnRate = 15; // More frequent spawns
gameSpeed = 2; // Faster overall speed
}
function continueNormalMode() {
hideBonusQuestion();
// Continue with normal settings
}
// Initialize score from storage
var currentTotalScore = storage.totalScore || 0;
LK.setScore(currentTotalScore);
scoreTxt.setText(currentTotalScore.toString());
// Create roads
function createRoads() {
// Create roads starting from a gap above starting position
var startY = 2732 - 250; // Start roads with gap from starting position
var totalRoads = 12; // Extended roads further
var roadSpacing = 180; // More uniform spacing between roads
for (var i = 0; i < totalRoads; i++) {
var roadY = startY - i * roadSpacing;
if (roadY >= 0) {
var road = LK.getAsset('road', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: roadY
});
roads.push(road);
game.addChild(road);
// Add road lines at the edges of roads for better visual separation
var roadLineTop = LK.getAsset('roadLine', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: roadY - 75
});
game.addChild(roadLineTop);
var roadLineBottom = LK.getAsset('roadLine', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: roadY + 75
});
game.addChild(roadLineBottom);
}
}
}
// Create chicken
function createChicken() {
chicken = game.addChild(new Chicken());
chicken.x = 1024; // Center horizontally
chicken.y = 2732 - 100; // Start near bottom
}
// Spawn a car
function spawnCar() {
var lane = Math.floor(Math.random() * roads.length);
var direction = Math.random() > 0.5 ? 1 : -1;
var baseSpeed;
var isSlow = false;
if (bonusMode) {
// In bonus mode: only fast cars, no slow cars
baseSpeed = (4 + Math.random() * 3) * 6; // Only fast cars
baseSpeed = baseSpeed / 1.5; // Decrease fast car speed by 1.5x
isSlow = false;
} else {
// Normal mode: create variable speeds - some cars are slower
var speedVariation = Math.random();
if (speedVariation < 0.3) {
// 30% chance for slower cars
baseSpeed = (2 + Math.random() * 2) * 6; // Slower cars
baseSpeed = baseSpeed * 3; // Increase slow car speed by 2x more (triple)
isSlow = true;
} else {
// 70% chance for normal speed cars
baseSpeed = (3 + Math.random() * 4) * 6; // Normal speed cars
baseSpeed = baseSpeed / 1.5; // Decrease fast car speed by 1.5x
isSlow = false;
}
}
var speed = baseSpeed * gameSpeed;
var car = new Car(direction, speed, lane);
// Mark if this is a slow car for collision handling
car.isSlow = isSlow;
cars.push(car);
game.addChild(car);
}
// Check collisions
function checkCollisions() {
for (var i = 0; i < cars.length; i++) {
var car = cars[i];
if (chicken.intersects(car)) {
if (bonusMode) {
// In bonus mode, any collision ends bonus mode but doesn't decrease score
LK.getSound('hit').play();
LK.effects.flashScreen(0xff4444, 500);
bonusMode = false;
questionAsked = false;
// Reset game settings to normal
gameSpeed = 1;
carSpawnRate = 30;
// Reset chicken position
chicken.y = 2732 - 100;
crossedRoads = 0;
return;
} else if (car.isSlow) {
// Slow car collision - injury instead of death
LK.getSound('hit').play();
// Create injury effect - flash red and shake
LK.effects.flashScreen(0xff4444, 300);
tween(chicken, {
x: chicken.x + 20
}, {
duration: 50,
easing: tween.easeOut,
onFinish: function onFinish() {
tween(chicken, {
x: chicken.x - 40
}, {
duration: 100,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(chicken, {
x: chicken.x + 20
}, {
duration: 50,
easing: tween.easeIn
});
}
});
}
});
// Remove the slow car after collision
car.removeFromParent = true;
} else {
// Fast car collision - game over and reset score
LK.getSound('hit').play();
LK.effects.flashScreen(0xff0000, 500);
// Reset score to 0
storage.totalScore = 0;
LK.setScore(0);
scoreTxt.setText('0');
LK.setTimeout(function () {
LK.showGameOver();
}, 500);
return;
}
}
}
}
// Handle successful road crossing
function crossedRoad() {
crossedRoads++;
var totalScore = storage.totalScore || 0;
if (bonusMode) {
// In bonus mode, successful completion gives 10 bonus points
totalScore += 10;
storage.totalScore = totalScore;
LK.setScore(totalScore);
scoreTxt.setText(totalScore.toString());
// Flash screen gold for bonus completion
LK.effects.flashScreen(0xffd700, 1000);
// End bonus mode and reset
bonusMode = false;
questionAsked = false;
chicken.y = 2732 - 100;
crossedRoads = 0;
gameSpeed = 1;
carSpawnRate = 30;
return;
}
// Check if completed all roads (reached the end)
if (chicken.y <= 50) {
// Completed all roads - give 1 point and reset to start
totalScore += 1;
storage.totalScore = totalScore;
LK.setScore(totalScore);
scoreTxt.setText(totalScore.toString());
// Reset chicken position to starting position when score increases
chicken.y = 2732 - 100;
crossedRoads = 0;
// Check if reached 10 points and haven't asked bonus question yet
if (totalScore >= 10 && !questionAsked) {
questionAsked = true;
showBonusQuestion();
// Flash screen gold for completion
LK.effects.flashScreen(0xffd700, 500);
return; // Don't reset yet, wait for user choice
}
// Flash screen gold for completion
LK.effects.flashScreen(0xffd700, 500);
// Reset to beginning
gameSpeed = 1;
carSpawnRate = 20;
} else {
// Normal road crossing - move forward
chicken.y = 2732 - 100;
// Increase difficulty
gameSpeed += 0.1;
if (carSpawnRate > 30) {
carSpawnRate -= 2;
}
// Flash screen green for success
LK.effects.flashScreen(0x00ff00, 300);
}
}
// Initialize game elements
createRoads();
createChicken();
// Game controls
game.down = function (x, y, obj) {
if (waitingForAnswer) {
// Check if clicked on bonus button
if (x >= 750 && x <= 950 && y >= 1450 && y <= 1550) {
startBonusMode();
// Reset chicken position for bonus mode
chicken.y = 2732 - 100;
crossedRoads = 0;
return;
}
// Check if clicked on continue button
if (x >= 1100 && x <= 1300 && y >= 1450 && y <= 1550) {
continueNormalMode();
// Reset chicken position for normal mode
chicken.y = 2732 - 100;
crossedRoads = 0;
return;
}
}
if (chicken && !chicken.isMoving && !waitingForAnswer) {
chicken.moveForward();
}
};
// Main game loop
game.update = function () {
// Spawn cars
carSpawnTimer++;
if (carSpawnTimer >= carSpawnRate) {
spawnCar();
carSpawnTimer = 0;
}
// Clean up cars that are off screen
for (var i = cars.length - 1; i >= 0; i--) {
var car = cars[i];
if (car.removeFromParent) {
car.destroy();
cars.splice(i, 1);
}
}
// Check collisions
checkCollisions();
}; ===================================================================
--- original.js
+++ change.js
@@ -225,9 +225,9 @@
var speedVariation = Math.random();
if (speedVariation < 0.3) {
// 30% chance for slower cars
baseSpeed = (2 + Math.random() * 2) * 6; // Slower cars
- baseSpeed = baseSpeed * 2; // Increase slow car speed by 1x (double)
+ baseSpeed = baseSpeed * 3; // Increase slow car speed by 2x more (triple)
isSlow = true;
} else {
// 70% chance for normal speed cars
baseSpeed = (3 + Math.random() * 4) * 6; // Normal speed cars
Fullscreen modern App Store landscape banner, 16:9, high definition, for a game titled "Chicken Cross - Road Rush" and with the description "Guide a chicken across busy roads filled with speeding cars. Time your movements carefully to avoid traffic and cross safely in this classic arcade-style challenge.". No text on banner!