User prompt
yer çekimini yüzde 15 arttırın
User prompt
engeller arasında ki mesafeyi yüzde 15 azalt
User prompt
engeller arası mesafeyi yüzde 45 arrtır
User prompt
karakterimizi update olarak zıplama işlemini y pozisyonunu sahnenin ortasına getir
User prompt
tüm engelley sahnenin ortasına aynı hizada yerleştirilsin
User prompt
yer çekimini yüzde 40 azalt
User prompt
yer çekimini yüzde 40 azalt
User prompt
engeller arası mesafeyi random belirle
User prompt
yer çekimini yüzde 50 azalt
User prompt
engellerin karakter le aynı y pozisyonuna getir
User prompt
karakterimizin update olarak zıplama işlemini y pozisyonuna göre ortaya al
User prompt
engellerin y pozisyonlarını aşağıya al
User prompt
karakterimizi update olarak zıplama işlemini y pozisyonuna göre aşağıya al
User prompt
karakterimizin upset zıplama işlevi y pozisyonunu sahnenin altına al
User prompt
✅ Dino karakterinin y konumunu sahnenin ortasına değiştirin
User prompt
Dino karakterinin y konumunu sahnenin altına değiştirin
User prompt
sayacı yukarı al
User prompt
✅ Dino karakterinin y pozisyonunu sahnenin altına değiştirin
User prompt
sayacı beyaz yap ve yukarı taşı
User prompt
yer çekimini yüzde 7 azalt
User prompt
engeller arası mesafeyi yüzde 12 arttır
User prompt
yer çekimini yüzde 15 azaltın
User prompt
engeller arsı mesafeyi yüzde 20 arrtır
User prompt
engeller arası mesafeyi yüzde 50 azalt
User prompt
sayaç yüzde 78 buyusun ve beyaz renkte olsun
/**** * Classes ****/ //<Assets used in the game will automatically appear here> //<Write imports for supported plugins here> // Class for the Dino character var Dino = Container.expand(function () { var self = Container.call(this); var dinoGraphics = self.attachAsset('dino', { anchorX: 0.5, anchorY: 0.5 }); self.yVelocity = 0; self.isJumping = false; self.jump = function () { if (!self.isJumping) { self.yVelocity = -20; self.isJumping = true; } }; self.update = function () { self.y += self.yVelocity; self.yVelocity += 0.3; // Gravity effect if (self.y >= 2732 / 2 - self.height) { // Ground level self.y = 2732 / 2 - self.height; self.yVelocity = 0; self.isJumping = false; } }; }); // Class for Obstacles var Obstacle = Container.expand(function () { var self = Container.call(this); var obstacleGraphics = self.attachAsset('obstacle', { anchorX: 0.5, anchorY: 0.5 }); self.speed = -5; self.update = function () { self.x += self.speed; if (self.x < -100) { self.destroy(); } }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0xFFFFFF //Init game with white background }); /**** * Game Code ****/ // Initialize score display var scoreTxt = new Text2('0', { size: 150, fill: 0x800080 // Set the color to purple }); scoreTxt.anchor.set(0.5, 0); // Anchor at the top LK.gui.top.addChild(scoreTxt); // Position at the top of the screen // Initialize Dino var dino = game.addChild(new Dino()); dino.x = 2048 / 2; dino.y = 2732 - dino.height / 2; // Array to keep track of obstacles var obstacles = []; // Function to spawn obstacles function spawnObstacle() { var obstacle = new Obstacle(); obstacle.x = 2048; obstacle.y = dino.y; obstacles.push(obstacle); game.addChild(obstacle); } // Handle game updates game.update = function () { dino.update(); for (var i = obstacles.length - 1; i >= 0; i--) { obstacles[i].update(); if (dino.intersects(obstacles[i])) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } else if (dino.x > obstacles[i].x + obstacles[i].width && !obstacles[i].passed) { obstacles[i].passed = true; LK.setScore(LK.getScore() + 1); scoreTxt.setText(LK.getScore()); } } if (LK.ticks % 60 == 0) { // Spawn obstacle every second spawnObstacle(); } }; // Handle touch events for jumping game.down = function (x, y, obj) { dino.jump(); };
===================================================================
--- original.js
+++ change.js
@@ -70,9 +70,9 @@
var obstacles = [];
// Function to spawn obstacles
function spawnObstacle() {
var obstacle = new Obstacle();
- obstacle.x = 2048 + Math.floor(Math.random() * 500); // Randomize the distance between obstacles
+ obstacle.x = 2048;
obstacle.y = dino.y;
obstacles.push(obstacle);
game.addChild(obstacle);
}