User prompt
boot text should be clear white
User prompt
ensure background #2 starts at the end of background#1
User prompt
when the first background reaches a specific point(like x = -2048), move the second background to x = 4096.
User prompt
make sure the paralax updates itself outside of the playspace not inside
User prompt
make sure the backgrounds are seamless
User prompt
make the background tile horizontally, sew them together
Code edit (2 edits merged)
Please save this source code
User prompt
make boottext a flashy-er blue
Code edit (3 edits merged)
Please save this source code
User prompt
bggraphics2 should be located after bggraphics, not overlapping
User prompt
make boottext white
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in this line: 'bgGraphics.x = self.bgGraphics2.x + game.width;' Line Number: 13
Code edit (1 edits merged)
Please save this source code
User prompt
Move background down by 1000
User prompt
make boottext bolder
User prompt
make boottext glacier blue
User prompt
fix the parralax when the game starts, its overlapping
User prompt
make boottext more bolder
User prompt
delete "text" assez class
User prompt
do not spawn obstacles until the game has started
User prompt
delay the hero flying to the initial position by one second
User prompt
accelerate the boot sequence text animation a little bit faster
User prompt
accelerate the boot sequence text animation
User prompt
when score is shown on screen, delete boottext
User prompt
when score is shown on screen, delete boottext after two seconds
/****
* Classes
****/
var Parallax = Container.expand(function () {
var self = Container.call(this);
var bgGraphics = self.createAsset('background', 'Background image', 0.5, 0.5);
bgGraphics.x = game.width / 2;
bgGraphics.y = 700;
self.speed = -2;
self.move = function () {
bgGraphics.x += self.speed;
if (bgGraphics.x <= -game.width) {
bgGraphics.x = self.bgGraphics2.x + game.width;
}
if (!self.bgGraphics2) {
self.bgGraphics2 = self.createAsset('background', 'Background image', 0.5, 0.5);
self.bgGraphics2.x = game.width + game.width / 2;
self.bgGraphics2.y = 700;
}
self.bgGraphics2.x += self.speed;
if (self.bgGraphics2.x <= -game.width) {
self.bgGraphics2.x = bgGraphics.x + game.width;
}
};
});
var Hero = Container.expand(function () {
var self = Container.call(this);
self.createDashTrail = function () {
var trailCount = 10;
for (var i = 0; i < trailCount; i++) {
LK.setTimeout(function () {
var trailParticle = new Particle();
trailParticle.x = self.x;
trailParticle.y = self.y;
game.addChild(trailParticle);
LK.effects.flashObject(trailParticle, 0x00ff00, 500);
}, i * 50);
}
};
var heroGraphics = self.createAsset('hero', 'Hero character', .5, .5);
self.speed = 30;
self.dashSpeed = game.width / 2 / 30; // 1/2 of the screen over 0.5 seconds at 60FPS
self.dashBackSpeed = self.dashSpeed / 2; // Accelerated return at half of the dash speed
self.dashStartTime = 0; // Time when the dash started
self.gravity = 1;
self.isDashing = false;
self.initialX = 200;
self.animateToPosition = function () {
var targetY = 2732 / 2;
var targetX = self.initialX;
var animationSpeed = 10;
if (!self.animationStarted) {
self.animationDelay = LK.setTimeout(function () {
self.animationStarted = true;
}, 2000);
self.animationStarted = false;
}
if (self.animationStarted) {
if (self.y < targetY) {
self.y += animationSpeed;
}
if (self.x < targetX) {
self.x += animationSpeed;
}
if (self.y >= targetY && self.x >= targetX) {
gameStarted = true; // Start the game once the hero reaches the initial position
initializeScoreDisplay();
}
}
};
self.dash = function () {
if (!self.isDashing && LK.ticks - self.holdStartTime >= 60 && self.x === self.initialX) {
self.isDashing = true;
self.dashStartTime = LK.ticks; // Save the start time of the dash
self.savedX = self.x; // Save the current x position
self.dashTargetX = self.x + game.width / 3 * 2; // Set the target X position for the dash, now twice as long
// Apply dash effect
self.createDashTrail();
}
};
self.isGravityFlipped = false;
self.flipGravity = function () {
self.isGravityFlipped = !self.isGravityFlipped;
self.gravity *= -1;
};
self.move = function () {
if (self.isHolding && LK.ticks - self.holdStartTime >= 60 && LK.ticks - self.dashStartTime > 6) {
self.dash();
}
if (self.isDashing) {
if (self.x < self.dashTargetX) {
self.x += self.dashSpeed;
} else {
self.isDashing = false;
self.dashTargetX = null; // Clear the dash target position
// Remove dash effect
self.tint = 0xffffff;
}
}
// Gradually move back to the initial position after dashing
// Resume normal movement after reaching saved x position
if (!self.isDashing && self.dashTargetX === null && self.x !== self.savedX) {
var moveBack = self.savedX < self.x ? -self.dashBackSpeed : self.dashBackSpeed;
self.x += moveBack;
// Clamp the hero's x position to the savedX to prevent overshooting
if (Math.abs(self.x - self.savedX) < Math.abs(moveBack)) {
self.x = self.savedX;
}
}
// Stop vertical movement while holding down
if (!self.isHolding) {
self.y += self.speed * self.gravity;
var boundaryPadding = 200;
if (self.y < boundaryPadding) {
self.y = boundaryPadding;
}
if (self.y > game.height - boundaryPadding) {
self.y = game.height - boundaryPadding;
}
}
// Trigger game over if hero leaves the screen horizontally
if (self.x < 0 || self.x > game.width) {
isGameOver = true;
}
// Generate particle trail
if (LK.ticks % 5 == 0) {
var particle = new Particle();
particle.x = self.x;
particle.y = self.y;
game.addChild(particle);
}
};
self.isHolding = false;
self.holdStartTime = 0;
self.onHold = function () {
if (!self.isHolding && !self.isDashing) {
self.isHolding = true;
self.holdStartTime = LK.ticks;
}
};
self.onRelease = function () {
// When mouse is released, initiate a horizontal dash
if (self.isHolding) {
self.dash();
}
self.isHolding = false;
self.holdStartTime = 0;
};
});
var Enemy = Container.expand(function () {
var self = Container.call(this);
var enemyGraphics = self.createAsset('enemy', 'Enemy character', .5, .5);
self.speed = -3;
self.move = function () {};
});
var Obstacle = Container.expand(function () {
var self = Container.call(this);
var obstacleGraphics = self.createAsset('obstacle', 'Obstacle', .5, .5);
self.speed = -5;
self.move = function () {
self.x += self.speed;
if (self.x < -self.width) {
self.destroy();
}
};
});
var Particle = Container.expand(function () {
var self = Container.call(this);
var particleGraphics = self.createAsset('particle', 'Particle', 0.5, 0.5);
self.alpha = 1.0;
self.fadeOut = function () {
self.alpha -= 0.05;
if (self.alpha <= 0) {
self.destroy();
}
};
});
var BootText = Container.expand(function (text) {
var self = Container.call(this);
var bootText = self.addChild(new Text2(text, {
size: 100,
fill: "#ffffff"
}));
bootText.anchor.set(0.5, 0);
self.alpha = 0;
self.fadeIn = function () {
if (self.alpha < 1) {
self.alpha += 0.05;
}
};
self.fadeOut = function () {
if (self.alpha > 0) {
self.alpha -= 0.05;
} else {
self.destroy();
}
};
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000
});
/****
* Game Code
****/
function startBootSequence() {
var bootTexts = ['Calibrating Cybernetic Enhancements...', 'Booting Cybernetic Core Systems...', 'All systems ready...'];
var currentBootTextIndex = 0;
var bootTextY = game.height / 2 - 100;
var displayBootText = function displayBootText() {
var bootText = new BootText(bootTexts[currentBootTextIndex]);
bootText.x = game.width / 2;
bootText.y = bootTextY + currentBootTextIndex * 120;
game.addChild(bootText);
LK.setInterval(function () {
bootText.fadeIn();
if (bootText.alpha === 1) {
LK.setTimeout(function () {
bootText.fadeOut();
}, 2000); // Changed from 500 to 2000 to delete after two seconds
}
}, 100);
currentBootTextIndex++;
if (currentBootTextIndex < bootTexts.length) {
LK.setTimeout(displayBootText, 1500);
}
};
displayBootText();
}
var hero,
enemies = [],
obstacles = [],
parallax,
score = 0,
distanceTraveled = 0,
isGameOver = false,
gameStarted = false;
var generateObstacle = function generateObstacle() {
var obstacle = new Obstacle();
obstacle.x = game.width;
obstacle.y = Math.random() * game.height;
obstacles.push(obstacle);
game.addChild(obstacle);
};
var obstacleGenerationInterval = LK.setInterval(generateObstacle, 2000);
parallax = game.addChild(new Parallax());
var distanceTxt;
function initializeScoreDisplay() {
distanceTxt = new Text2('Δs: 0', {
size: 150,
fill: "#ffffff"
});
distanceTxt.anchor.set(.5, 0);
LK.gui.top.addChild(distanceTxt);
}
hero = game.addChild(new Hero());
hero.x = -100;
hero.y = -100;
startBootSequence();
LK.on('tick', function () {
if (!gameStarted) {
hero.animateToPosition();
return; // Skip the rest of the game logic until the animation is complete
}
parallax.move();
hero.move();
for (var i = 0; i < enemies.length; i++) {
enemies[i].move();
}
for (var i = obstacles.length - 1; i >= 0; i--) {
obstacles[i].move();
if (!obstacles[i].parent) {
obstacles.splice(i, 1);
}
}
var particles = game.children.filter(function (child) {
return child instanceof Particle;
});
for (var i = 0; i < particles.length; i++) {
particles[i].fadeOut();
}
if (!isGameOver) {
distanceTraveled += 1 / 60;
distanceTxt.setText('Δs: ' + Math.floor(distanceTraveled).toString());
}
if (isGameOver) {
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
}
});
game.on('down', function (obj) {
hero.flipGravity();
hero.onHold();
});
game.on('up', function (obj) {
hero.onRelease();
});
2d cyberpunk particle of a dash ability. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
blue jetfuel. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art speech bubble that says "?" neon color. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art speech bubble that says "Go" neon color. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art speech bubble that says "Ok" neon color.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a bubble a wing inside in neon color.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art bubble with 2 fast foward arrows neon color. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Gray Cyber neon lit logo of the word Rush. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
side profile of a flying car in the art style of a 16 bit neon cyberpunk game. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro cyberpunk datadisk in neon colors. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro cyberpunk pole flag in neon colors with the words 'events' on it.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro sign that says "Hold to Dash" in neon colors. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro sign that says "Tap to Move" in neon colors.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro sign that says "catch" with an flying drone symbol in neon colors.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro flying drone in neon colors.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro sign that says "Survive" with an face symbol in neon colors... Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
neon colored cyberpunk round electricity. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
SynthwaveMusic
Music
snd_letsgo
Sound effect
snd_announcer
Sound effect
snd_powerup
Sound effect
snd_dataacquire
Sound effect
snd_walkie
Sound effect
snd_nice
Sound effect
snd_carhonk
Sound effect
snd_enemy
Sound effect
snd_sphere
Sound effect
snd_windup
Sound effect
snd_spikey
Sound effect
snd_drone
Sound effect