User prompt
play crash sound when rocket crash
User prompt
oyun basladiginda ekledigimiz muzik calsin
User prompt
arkadan ara sira opacity %50 olacak sekilde uzay ve insan ile ilgili varolussal sozler gecsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
add 2 more planets
User prompt
gezegenlerin opacity oranini %25 yapalim ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
gezegenler sinus egrisi yaparak gecsinler ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
gezegenler dumduz degil biraz yukari dogru bombeli gecsinler ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
geaegen gecis sikligini arttiralim ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
1 gezegen birden fazla gorunmesin
User prompt
gezegenler kendi etrafinda donmesin ve sagdan sola veya soldan saga gecis yapsinlar ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
add 7 planet assets
User prompt
arkaplandaki gezegenler soldan saga dogru ilerleyip kaybolsunlar ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
arka plandan bazen %50 opacity ile gezegenler gecsin sadece goruntu amacli ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
engeller ilerleyen bolumlerde hareket edebilsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
rocket platformun onunden asagi insin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
engeller kendi etrafinda yavas bir sekilde donsun ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
add 4 different obstacle asset
User prompt
her yeni bolume geciste platform hizini % 3 arttiralim ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
platform 2 kat daha yavas hareket etsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
ilerideki bazi bolumlerde platform yavas bir sekilde hareket etsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
platforma inince oyun bitmesin diger bolume gecelim diger bolumde de roketin carpabilecegi engeller koyalim engellere carparsa oyun game over olsun
User prompt
tiklayinca roket ucmasin sadece asagi dusmesini yavaslatalim
User prompt
roket platform disina duserse game over olsun. Platform uzerine duserse diger bolume gecelim
User prompt
roket platforma inince puan kazanalim
User prompt
2 kat daha azaltalim
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Obstacle = Container.expand(function () {
var self = Container.call(this);
var obstacleGraphics = self.attachAsset('obstacle', {
anchorX: 0.5,
anchorY: 0.5
});
return self;
});
var Platform = Container.expand(function () {
var self = Container.call(this);
var platformGraphics = self.attachAsset('platform', {
anchorX: 0.5,
anchorY: 0.5
});
self.landingZone = 180; // Safe landing zone width
self.isMoving = false;
self.startMoving = function () {
if (self.isMoving) return;
self.isMoving = true;
// Calculate speed based on current level (3% faster each level)
var speedMultiplier = Math.pow(1.03, currentLevel - 3); // Start from level 3
var baseDuration = 6000;
var moveDuration = baseDuration / speedMultiplier;
// Create continuous horizontal movement
function moveLeft() {
tween(self, {
x: 300
}, {
duration: moveDuration,
easing: tween.linear,
onFinish: moveRight
});
}
function moveRight() {
tween(self, {
x: 1748
}, {
duration: moveDuration,
easing: tween.linear,
onFinish: moveLeft
});
}
// Start movement cycle
if (self.x < 1024) {
moveRight();
} else {
moveLeft();
}
};
self.checkLanding = function (spacecraft) {
var dx = Math.abs(spacecraft.x - self.x);
var dy = Math.abs(spacecraft.y - self.y);
if (dx < self.landingZone / 2 && dy < 80) {
// Check if landing speed is safe
if (spacecraft.velocityY < 4 && Math.abs(spacecraft.velocityX) < 3) {
spacecraft.land();
return true;
} else {
spacecraft.crash();
return false;
}
}
return false;
};
return self;
});
var Spacecraft = Container.expand(function () {
var self = Container.call(this);
var body = self.attachAsset('spacecraft', {
anchorX: 0.5,
anchorY: 0.5
});
var flame = self.attachAsset('flame', {
anchorX: 0.5,
anchorY: 0,
x: 0,
y: 60
});
self.velocityX = 0;
self.velocityY = 0; // Start with no initial descent speed
self.thrust = 0;
self.maxThrust = 6;
self.thrustDecay = 0.9;
self.horizontalDamping = 0.95;
self.isLanded = false;
self.lastLanded = false;
flame.visible = false;
self.update = function () {
if (self.isLanded) return;
// Apply thrust and movement
self.velocityY -= self.thrust;
self.velocityX *= self.horizontalDamping;
self.thrust *= self.thrustDecay;
// Apply gravity (free fall) - reduce by 75% when mouse pressed
var gravityForce = mousePressed ? 0.0125 : 0.05;
self.velocityY += gravityForce;
// Update position
self.x += self.velocityX;
self.y += self.velocityY;
// Keep spacecraft in bounds horizontally
if (self.x < 40) {
self.x = 40;
self.velocityX = 0;
}
if (self.x > 2008) {
self.x = 2008;
self.velocityX = 0;
}
// Show flame when thrusting
flame.visible = self.thrust > 0.5;
// Check if crashed (hit bottom without landing)
if (self.y > 2650) {
self.crash();
}
// Check if rocket falls outside platform area
if (self.y > 2550 && currentPlatform) {
var platformLeft = currentPlatform.x - currentPlatform.landingZone / 2;
var platformRight = currentPlatform.x + currentPlatform.landingZone / 2;
if (self.x < platformLeft || self.x > platformRight) {
self.crash();
}
}
};
self.applyThrust = function (direction) {
self.thrust = Math.min(self.maxThrust, self.thrust + 0.03);
if (direction !== 0) {
self.velocityX += direction * 0.4;
}
LK.getSound('thrust').play();
};
self.crash = function () {
LK.effects.flashScreen(0xFF0000, 1000);
LK.getSound('crash').play();
LK.showGameOver();
};
self.land = function () {
if (!self.lastLanded && !self.isLanded) {
self.isLanded = true;
self.velocityX = 0;
self.velocityY = 0;
self.thrust = 0;
flame.visible = false;
LK.getSound('landing').play();
LK.effects.flashObject(self, 0x00FF00, 500);
// Increase score when landing on platform
LK.setScore(LK.getScore() + 10);
scoreTxt.setText(LK.getScore());
// Show level complete effect and progress to next level
LK.effects.flashScreen(0x00FF00, 500);
// Reset for next level after delay
LK.setTimeout(function () {
currentLevel++;
self.reset();
spawnNewPlatform();
spawnObstacles();
}, 1500);
}
self.lastLanded = true;
};
self.reset = function () {
self.x = 1024;
self.y = 100;
self.velocityX = 0;
self.velocityY = 0; // Start with no velocity for free fall
self.thrust = 0;
self.isLanded = false;
self.lastLanded = false;
flame.visible = false;
};
return self;
});
var Star = Container.expand(function () {
var self = Container.call(this);
var starGraphics = self.attachAsset('stars', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = Math.random() * 1 + 0.5;
self.update = function () {
self.y += self.speed;
if (self.y > 2732) {
self.y = -10;
self.x = Math.random() * 2048;
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x0A0A0A
});
/****
* Game Code
****/
var spacecraft;
var currentPlatform;
var stars = [];
var obstacles = [];
var currentLevel = 1;
var mousePressed = false;
var lastMouseX = 1024;
// Create score display
var scoreTxt = new Text2('0', {
size: 120,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Create instruction text
var instructionTxt = new Text2('Hold mouse to slow descent', {
size: 60,
fill: 0x888888
});
instructionTxt.anchor.set(0.5, 0);
instructionTxt.y = 150;
LK.gui.top.addChild(instructionTxt);
// Initialize spacecraft
spacecraft = game.addChild(new Spacecraft());
spacecraft.x = 1024;
spacecraft.y = 100;
// Create background stars
for (var i = 0; i < 30; i++) {
var star = game.addChild(new Star());
star.x = Math.random() * 2048;
star.y = Math.random() * 2732;
stars.push(star);
}
function spawnObstacles() {
// Clear existing obstacles
for (var i = 0; i < obstacles.length; i++) {
obstacles[i].destroy();
}
obstacles = [];
// Spawn obstacles based on current level (more obstacles in higher levels)
var numObstacles = Math.min(currentLevel - 1, 5); // Start spawning from level 2
for (var i = 0; i < numObstacles; i++) {
var obstacle = game.addChild(new Obstacle());
obstacle.x = Math.random() * 1600 + 224;
obstacle.y = 1500 + Math.random() * 800; // Place between spacecraft start and platform
obstacles.push(obstacle);
}
}
function spawnNewPlatform() {
if (currentPlatform) {
tween.stop(currentPlatform);
currentPlatform.destroy();
}
currentPlatform = game.addChild(new Platform());
currentPlatform.x = Math.random() * 1600 + 224; // Keep platforms away from edges
currentPlatform.y = 2600;
// Start moving platform for levels 3 and above
if (currentLevel >= 3) {
currentPlatform.startMoving();
}
}
// Spawn initial platform
spawnNewPlatform();
// Initialize obstacles
spawnObstacles();
// Mouse controls
game.down = function (x, y, obj) {
mousePressed = true;
lastMouseX = x;
};
game.up = function (x, y, obj) {
mousePressed = false;
};
game.move = function (x, y, obj) {
lastMouseX = x;
};
game.update = function () {
if (mousePressed && !spacecraft.isLanded) {
// Calculate thrust direction based on mouse position
var direction = 0;
if (lastMouseX < spacecraft.x - 50) {
direction = -1;
} else if (lastMouseX > spacecraft.x + 50) {
direction = 1;
}
spacecraft.applyThrust(direction);
}
// Check for collision with obstacles
for (var i = 0; i < obstacles.length; i++) {
if (spacecraft.intersects(obstacles[i]) && !spacecraft.isLanded) {
spacecraft.crash();
break;
}
}
// Check for landing
if (currentPlatform && !spacecraft.isLanded) {
spacecraft.lastLanded = false;
currentPlatform.checkLanding(spacecraft);
}
// Update score display
scoreTxt.setText(LK.getScore());
}; ===================================================================
--- original.js
+++ change.js
@@ -24,23 +24,27 @@
self.isMoving = false;
self.startMoving = function () {
if (self.isMoving) return;
self.isMoving = true;
+ // Calculate speed based on current level (3% faster each level)
+ var speedMultiplier = Math.pow(1.03, currentLevel - 3); // Start from level 3
+ var baseDuration = 6000;
+ var moveDuration = baseDuration / speedMultiplier;
// Create continuous horizontal movement
function moveLeft() {
tween(self, {
x: 300
}, {
- duration: 6000,
+ duration: moveDuration,
easing: tween.linear,
onFinish: moveRight
});
}
function moveRight() {
tween(self, {
x: 1748
}, {
- duration: 6000,
+ duration: moveDuration,
easing: tween.linear,
onFinish: moveLeft
});
}
one windowed red and white space ship with 4 legs with flame under it. In-Game asset. 2d. High contrast. No shadows
random asteroid stone. In-Game asset. 2d. High contrast. No shadows
star shaped random asteroid stone. In-Game asset. 2d. High contrast. No shadows
rocket landing platform. In-Game asset. 2d. High contrast. No shadows
rocket flame but only flame. In-Game asset. 2d. High contrast. No shadows
white shiny star. In-Game asset. 2d. High contrast. No shadows
realistic saturn. In-Game asset. 2d. High contrast. No shadows
realistic milky way. In-Game asset. 2d. High contrast. No shadows
realistic milky way. In-Game asset. 2d. High contrast. No shadows
mercury realistic. In-Game asset. 2d. High contrast. No shadows
earth realistic. In-Game asset. 2d. High contrast. No shadows
random galaxies realistic. In-Game asset. 2d. High contrast. No shadows
realistic sun. In-Game asset. 2d. High contrast. No shadows
realistic pluton. In-Game asset. 2d. High contrast. No shadows