Initial prompt
Copy endless runner v3
User prompt
Add lines to separate the lanes
User prompt
Make sure lane lines fill top to bottom of the acreen
User prompt
Lane lines only cober the top half of the screen. Fix it maybe fixing the anchor
User prompt
Add outline lines to the left and right lane. Should have the size of the center lane width
User prompt
Please fix the bug: 'TypeError: Cannot set properties of null (setting 'update')' in or related to this line: 'leftPlayer.update = function () {' Line Number: 1173
User prompt
Please fix the bug: 'TypeError: Cannot set properties of null (setting 'update')' in or related to this line: 'leftPlayer.update = function () {' Line Number: 1173
User prompt
Make sure taht if two obstcles spwan at the same tkme and are in different lanes, taht their speed is the same
User prompt
Once spawned obstavles should keep constant speed
User prompt
When two small obstacles are spawn together but different lanes, make sure they move at the same speed
User prompt
When two small obstacles are paralle have them share the same speed
Code edit (1 edits merged)
Please save this source code
User prompt
To ensure that small obstacles are perfectly aligned, it is crucial to: - Set their initial `y` positions to be exactly the same. - Create them within the same function call to avoid timing discrepancies. - Ensure that their update logic is synchronized and that they move at the exact same speed.
User prompt
Please fix the bug: 'TypeError: Cannot set properties of undefined (setting 'y')' in or related to this line: 'smallObstacleLeft.y = smallObstacleRight.y = -smallObstacleLeft.height * 2;' Line Number: 1360
User prompt
Please fix the bug: 'TypeError: Cannot set properties of null (setting 'update')' in or related to this line: 'leftPlayer.update = function () {' Line Number: 1174
User prompt
Make obstavles move amoother
User prompt
Use linear interpolation for obstacles but keep their current speed
User prompt
Remove starfield
User prompt
Please fix the bug: 'TypeError: Cannot set properties of null (setting 'update')' in or related to this line: 'leftPlayer.update = function () {' Line Number: 1129
User prompt
Particles should use the color of the asset they are sxploding to
User prompt
Make text font thicker and add border
User prompt
Add border to textobject
User prompt
Add border to textobstacle
User prompt
Make textobstacle a little bigger
User prompt
Not so big a little smaller
===================================================================
--- original.js
+++ change.js
@@ -9,9 +9,9 @@
anchorY: 0.5
});
self.speed = gameSpeed;
self.update = function () {
- self.y += (self.speed - self.y) * 0.1;
+ self.y += self.speed;
if (self.y > 2732 + self.height / 2) {
self.destroy();
}
};
@@ -24,9 +24,9 @@
anchorY: 0.5
});
self.speed = gameSpeed;
self.update = function () {
- self.y += (self.speed - self.y) * 0.1;
+ self.y += self.speed;
if (self.y > 2732 + self.height / 2) {
self.destroy();
}
};
@@ -43,9 +43,9 @@
});
separatorGraphics.height = 2732; // Ensure the height covers the entire screen height
self.speed = gameSpeed;
self.update = function () {
- self.y += (self.speed - self.y) * 0.1;
+ self.y += self.speed;
if (self.y > 2732 + self.height / 2) {
self.destroy();
}
};
@@ -61,9 +61,9 @@
});
outlineGraphics.height = 2732; // Ensure the height covers the entire screen height
self.speed = gameSpeed;
self.update = function () {
- self.y += (self.speed - self.y) * 0.1;
+ self.y += self.speed;
if (self.y > 2732 + self.height / 2) {
self.destroy();
}
};
@@ -100,9 +100,9 @@
width: 2048 // Set the width to the full screen width
});
self.speed = gameSpeed;
self.update = function () {
- self.y += (self.speed - self.y) * 0.1;
+ self.y += self.speed;
if (self.y > 2732 + self.height / 2) {
self.destroy();
}
};
@@ -115,9 +115,9 @@
anchorY: 0.5
});
self.speed = gameSpeed;
self.update = function () {
- self.y += (self.speed - self.y) * 0.1;
+ self.y += self.speed;
if (self.y > 2732 + self.height / 2) {
self.destroy();
}
};
@@ -290,9 +290,9 @@
anchorY: 0.5
});
self.speed = gameSpeed;
self.update = function () {
- self.y += (self.speed - self.y) * 0.1;
+ self.y += self.speed;
if (self.y > 2732 + self.height / 2) {
self.destroy();
}
};
@@ -305,9 +305,9 @@
anchorY: 0.5
});
self.speed = gameSpeed;
self.update = function () {
- self.y += (self.speed - self.y) * 0.1;
+ self.y += self.speed;
if (self.y > 2732 + self.height / 2) {
self.destroy();
}
};
@@ -323,9 +323,9 @@
});
outlineGraphics.height = 2732; // Ensure the height covers the entire screen height
self.speed = gameSpeed;
self.update = function () {
- self.y += (self.speed - self.y) * 0.1;
+ self.y += self.speed;
if (self.y > 2732 + self.height / 2) {
self.destroy();
}
};
@@ -385,9 +385,9 @@
anchorY: 0.5
});
self.speed = gameSpeed;
self.update = function () {
- self.y += (self.speed - self.y) * 0.1;
+ self.y += self.speed;
if (self.y > 2732 + self.height / 2) {
self.destroy();
}
};
@@ -400,34 +400,15 @@
anchorY: 0.5
});
self.speed = gameSpeed;
self.update = function () {
- self.y += (self.speed - self.y) * 0.1;
+ self.y += self.speed;
if (self.y > 2732 + self.height / 2) {
self.destroy();
}
};
});
// Function to spawn SmallObstacle in the center and Coins on the sides
-// Define the Starfield class
-var Starfield = Container.expand(function () {
- var self = Container.call(this);
- var starGraphics = self.attachAsset('particle', {
- anchorX: 0.5,
- anchorY: 0.5,
- alpha: 0.5,
- scaleX: 0.5,
- scaleY: 0.5
- });
- self.speed = gameSpeed * 0.8; // Starfield moves at 80% of the game speed
- self.update = function () {
- self.y += (self.speed - self.y) * 0.1;
- if (self.y > 2732) {
- self.y = -self.height;
- }
- };
-});
-// Define the TextObstacle class
var TextObstacle = Container.expand(function (customText) {
var self = Container.call(this);
var textGraphics = new Text2(customText || 'Sample Text', {
size: 100,
@@ -437,9 +418,9 @@
textGraphics.anchor.set(0.5, 0.5);
self.addChild(textGraphics);
self.speed = gameSpeed;
self.update = function () {
- self.y += (self.speed - self.y) * 0.1;
+ self.y += self.speed;
self.hitbox = null; // Ensure TextObstacle does not collide with player
if (self.y > 2732 + self.height / 2) {
self.destroy();
}
@@ -665,19 +646,8 @@
var shadow;
// Initialize lanes
var lanes = [2048 / 4, 2048 / 2, 2048 / 4 * 3];
// Initialize starfield
-var starfield = [];
-for (var i = 0; i < 30; i++) {
- var star = new Starfield();
- star.scale.x = 1.0;
- star.scale.y = 1.0;
- star.x = Math.random() * 2048;
- star.y = Math.random() * 2732;
- star.speed = gameSpeed * 0.8; // Initialize starfield with dynamic speed
- starfield.push(star);
- game.addChild(star);
-}
// Initialize lane separators
var laneSeparators = [];
for (var i = 1; i < lanes.length; i++) {
var separator = new LaneSeparator();
@@ -867,9 +837,8 @@
if (Math.abs(y - touchStartY) > Math.abs(x - touchStartX)) {
if (y < touchStartY && !leftPlayer && !rightPlayer) {
player.jump();
} else if (y > touchStartY && !leftPlayer && !rightPlayer && !player.isJumping && player.lane === 1) {
- // Split player into left and right players
// Animate leftPlayer and rightPlayer to move to the sides
var leftTargetX = player.x - 650;
var rightTargetX = player.x + 550;
var animationDuration = 20; // Duration in frames (0.33 seconds at 60 FPS)
@@ -1033,21 +1002,10 @@
// Update game logic
game.update = function () {
if (!gameStarted) {
// Update starfield
- for (var i = 0; i < starfield.length; i++) {
- starfield[i].y += gameSpeed * 0.8; // Starfield moves at 80% of the game speed
- starfield[i].speed = gameSpeed * 0.8; // Update starfield speed dynamically
- starfield[i].update();
- }
return;
}
- // Update starfield
- for (var i = 0; i < starfield.length; i++) {
- starfield[i].y += gameSpeed * 0.8; // Starfield moves at 80% of the game speed
- starfield[i].speed = gameSpeed * 0.8; // Update starfield speed dynamically
- starfield[i].update();
- }
// Update lane separators
for (var i = 0; i < laneSeparators.length; i++) {
laneSeparators[i].update();
laneSeparators[i].children[0].height = 2732; // Ensure the height covers the entire screen height
@@ -1057,11 +1015,8 @@
// Increase game speed and decrease global spawn interval over time
if (LK.ticks % 600 == 0) {
// Increase speed every 10 seconds
gameSpeed *= 1.03; // Increase speed by 3%
- for (var i = 0; i < starfield.length; i++) {
- starfield[i].speed = gameSpeed * 0.8; // Update starfield speed dynamically
- }
// Decrease global spawn interval to make spawns more frequent
globalSpawnInterval = Math.max(30, globalSpawnInterval - 10); // Ensure interval doesn't go below 30 frames (0.5 seconds)
}
// Update obstacles, coins, and powerups
cartoon white circle. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
cartoon light blue circle. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
cartoon white square. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
black rectangle