User prompt
oyun adını galaxy destroyer olarak değiştir
User prompt
bu yaptığım oyunu sayfama kaydet ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
1 adet dönerek gelen uzay gemisi var onu kaldır
User prompt
gezengenler arka planda sadece birer adet görünsün
User prompt
arka plana gök cisimleri ekle örneğin gök taşı gibi
User prompt
düşman gemleri görüntüsünü güç_arttırma_hızlı_ateş adındaki görüntü ile değiştir
User prompt
ana karakterin görüntüsünü uzaygemisi adlı görüntü ile değiştir
User prompt
oyunun belirli noktalarında büyük boss düşman gelsin
User prompt
arka plana gezegenleride ekle onlarda yıldızlar gibi gidip gelsin
User prompt
oyunu kazanma score 100000 olsun
User prompt
her 250 score dan sonra +30 can veren can bonusları gelsin
User prompt
500 score dan sonra düman gemiler çok zorlu olmaya başlasın
User prompt
her 150 score dan sonra düşman gemilerin zorluk seviyesi artsın
User prompt
bonuslar hem ateş sayısını arttırsın hemde tek seferde ki ateş sayısınıda arttırsın
User prompt
uzay gemilerinin ateş gücünü arttıracak bonuslar olsun oyunda
User prompt
uzay gemileri daha hızlı ateş etsin
User prompt
uzay gemileri gerçek uzay gemisine benzesin
User prompt
bana uzay gemisi savaşı tarzı bir oyun yazabilirmisin
User prompt
başarılı olmadı her şeyi unut bana kafa topu oyununa benzer bir oyun yap
User prompt
başarılı olmadı tekrar denermisin ve harşta daha yüksek görselli olsun
Code edit (1 edits merged)
Please save this source code
User prompt
Super Jump Adventure
Initial prompt
bana süper mario benzeri 1 levellik bir oyun yaparmısın
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Coin = Container.expand(function () { var self = Container.call(this); var outerRing = self.attachAsset('coin_outer', { anchorX: 0.5, anchorY: 0.5 }); var innerRing = self.attachAsset('coin_inner', { anchorX: 0.5, anchorY: 0.5 }); var center = self.attachAsset('coin_center', { anchorX: 0.5, anchorY: 0.5 }); self.collected = false; self.update = function () { if (!self.collected) { self.rotation += 0.1; if (self.intersects(player)) { self.collect(); } } }; self.collect = function () { if (!self.collected) { self.collected = true; LK.setScore(LK.getScore() + 10); scoreTxt.setText(LK.getScore()); LK.getSound('coin').play(); // Create particle effect for (var i = 0; i < 8; i++) { var particle = new Particle(); particle.x = self.x; particle.y = self.y; particles.push(particle); game.addChild(particle); } tween(self, { scaleX: 0, scaleY: 0, alpha: 0, rotation: Math.PI * 2 }, { duration: 300, onFinish: function onFinish() { self.destroy(); } }); } }; return self; }); var Enemy = Container.expand(function () { var self = Container.call(this); var body = self.attachAsset('enemy_body', { anchorX: 0.5, anchorY: 1.0 }); var spikes = self.attachAsset('enemy_spikes', { anchorX: 0.5, anchorY: 1.0 }); spikes.y = -45; var leftEye = self.attachAsset('enemy_eyes', { anchorX: 0.5, anchorY: 0.5 }); leftEye.x = -10; leftEye.y = -35; var rightEye = self.attachAsset('enemy_eyes', { anchorX: 0.5, anchorY: 0.5 }); rightEye.x = 10; rightEye.y = -35; self.velocityX = -2; self.defeated = false; self.update = function () { if (!self.defeated) { self.x += self.velocityX; // Bounce off platforms if (self.x <= 100 || self.x >= 1948) { self.velocityX *= -1; } if (self.intersects(player)) { if (player.velocityY > 0 && player.y < self.y - 20) { // Player jumped on enemy self.defeat(); player.velocityY = -10; // Bounce player up } else { // Player touched enemy player.die(); } } } }; self.defeat = function () { if (!self.defeated) { self.defeated = true; LK.setScore(LK.getScore() + 50); scoreTxt.setText(LK.getScore()); LK.getSound('enemy_defeat').play(); tween(self, { scaleY: 0.1, alpha: 0 }, { duration: 500, onFinish: function onFinish() { self.destroy(); } }); } }; return self; }); var Flag = Container.expand(function () { var self = Container.call(this); var pole = self.attachAsset('flag_pole', { anchorX: 0.5, anchorY: 1.0 }); var cloth = self.attachAsset('flag_cloth', { anchorX: 0, anchorY: 0 }); cloth.x = 4; cloth.y = -110; var stripe1 = self.attachAsset('flag_stripe', { anchorX: 0, anchorY: 0 }); stripe1.x = 4; stripe1.y = -95; var stripe2 = self.attachAsset('flag_stripe', { anchorX: 0, anchorY: 0 }); stripe2.x = 4; stripe2.y = -80; self.animationTimer = 0; self.update = function () { // Flag waving animation self.animationTimer += 0.1; cloth.rotation = Math.sin(self.animationTimer) * 0.1; stripe1.rotation = Math.sin(self.animationTimer) * 0.1; stripe2.rotation = Math.sin(self.animationTimer) * 0.1; if (self.intersects(player)) { LK.setScore(LK.getScore() + 500); LK.showYouWin(); } }; return self; }); var Particle = Container.expand(function () { var self = Container.call(this); var graphics = self.attachAsset('particle', { anchorX: 0.5, anchorY: 0.5 }); self.velocityX = (Math.random() - 0.5) * 10; self.velocityY = (Math.random() - 0.5) * 10; self.life = 60; self.maxLife = 60; self.update = function () { self.x += self.velocityX; self.y += self.velocityY; self.velocityY += 0.3; self.life--; self.alpha = self.life / self.maxLife; if (self.life <= 0) { self.destroy(); } }; return self; }); var Platform = Container.expand(function () { var self = Container.call(this); var base = self.attachAsset('platform_base', { anchorX: 0.5, anchorY: 0.5 }); var top = self.attachAsset('platform_top', { anchorX: 0.5, anchorY: 0.5 }); top.y = -15; return self; }); var Player = Container.expand(function () { var self = Container.call(this); var body = self.attachAsset('player_body', { anchorX: 0.5, anchorY: 1.0 }); var head = self.attachAsset('player_head', { anchorX: 0.5, anchorY: 0.5 }); head.y = -60; var hat = self.attachAsset('player_hat', { anchorX: 0.5, anchorY: 0.5 }); hat.y = -75; var leftEye = self.attachAsset('player_eyes', { anchorX: 0.5, anchorY: 0.5 }); leftEye.x = -8; leftEye.y = -60; var rightEye = self.attachAsset('player_eyes', { anchorX: 0.5, anchorY: 0.5 }); rightEye.x = 8; rightEye.y = -60; self.velocityX = 0; self.velocityY = 0; self.onGround = false; self.speed = 8; self.jumpPower = 20; self.gravity = 0.8; self.maxFallSpeed = 15; self.lives = 3; self.update = function () { // Apply gravity if (!self.onGround) { self.velocityY += self.gravity; if (self.velocityY > self.maxFallSpeed) { self.velocityY = self.maxFallSpeed; } } // Apply movement self.x += self.velocityX; self.y += self.velocityY; // Reset ground state self.onGround = false; // Check platform collisions for (var i = 0; i < platforms.length; i++) { var platform = platforms[i]; if (self.intersects(platform)) { if (self.velocityY > 0 && self.y - 40 < platform.y) { self.y = platform.y; if (self.velocityY > 5) { // Create dust particles when landing hard for (var j = 0; j < 4; j++) { var dust = new Particle(); dust.x = self.x + (Math.random() - 0.5) * 40; dust.y = self.y; dust.velocityY = -Math.random() * 5; particles.push(dust); game.addChild(dust); } } self.velocityY = 0; self.onGround = true; } } } // Check ground collision if (self.y >= groundLevel) { self.y = groundLevel; if (self.velocityY > 5) { // Create dust particles when landing hard for (var j = 0; j < 4; j++) { var dust = new Particle(); dust.x = self.x + (Math.random() - 0.5) * 40; dust.y = self.y; dust.velocityY = -Math.random() * 5; particles.push(dust); game.addChild(dust); } } self.velocityY = 0; self.onGround = true; } // Check if fell off screen if (self.y > 2732 + 100) { self.die(); } // Apply friction self.velocityX *= 0.85; }; self.jump = function () { if (self.onGround) { self.velocityY = -self.jumpPower; self.onGround = false; LK.getSound('jump').play(); } }; self.moveLeft = function () { self.velocityX = -self.speed; }; self.moveRight = function () { self.velocityX = self.speed; }; self.die = function () { self.lives--; if (self.lives <= 0) { LK.showGameOver(); } else { self.respawn(); } }; self.respawn = function () { self.x = 200; self.y = groundLevel; self.velocityX = 0; self.velocityY = 0; LK.effects.flashObject(self, 0xffffff, 1000); }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB }); /**** * Game Code ****/ // Visual effects // Enhanced ground and platforms // Enhanced flag // Enhanced enemy // Enhanced coin // Player parts var groundLevel = 2600; var platforms = []; var coins = []; var enemies = []; var particles = []; var player; var flag; var scoreTxt; var livesTxt; var dragStartX = 0; var isDragging = false; var lastTouchX = 0; // Create ground for (var i = 0; i < 12; i++) { var groundBase = LK.getAsset('ground_base', { anchorX: 0.5, anchorY: 0.5 }); groundBase.x = i * 200 + 100; groundBase.y = groundLevel + 30; game.addChild(groundBase); var groundTop = LK.getAsset('ground_top', { anchorX: 0.5, anchorY: 0.5 }); groundTop.x = i * 200 + 100; groundTop.y = groundLevel + 7; game.addChild(groundTop); var groundDirt = LK.getAsset('ground_dirt', { anchorX: 0.5, anchorY: 0.5 }); groundDirt.x = i * 200 + 100; groundDirt.y = groundLevel + 40; game.addChild(groundDirt); } // Create platforms var platformPositions = [{ x: 400, y: 2400 }, { x: 700, y: 2200 }, { x: 1100, y: 2000 }, { x: 1500, y: 1800 }, { x: 1800, y: 1600 }]; for (var i = 0; i < platformPositions.length; i++) { var platform = new Platform(); platform.x = platformPositions[i].x; platform.y = platformPositions[i].y; platforms.push(platform); game.addChild(platform); } // Create coins var coinPositions = [{ x: 300, y: 2500 }, { x: 400, y: 2300 }, { x: 700, y: 2100 }, { x: 1100, y: 1900 }, { x: 1500, y: 1700 }, { x: 1800, y: 1500 }]; for (var i = 0; i < coinPositions.length; i++) { var coin = new Coin(); coin.x = coinPositions[i].x; coin.y = coinPositions[i].y; coins.push(coin); game.addChild(coin); } // Create enemies var enemyPositions = [{ x: 600, y: groundLevel }, { x: 1200, y: groundLevel }, { x: 1600, y: groundLevel }]; for (var i = 0; i < enemyPositions.length; i++) { var enemy = new Enemy(); enemy.x = enemyPositions[i].x; enemy.y = enemyPositions[i].y; enemies.push(enemy); game.addChild(enemy); } // Create player player = new Player(); player.x = 200; player.y = groundLevel; game.addChild(player); // Create flag flag = new Flag(); flag.x = 1900; flag.y = groundLevel; game.addChild(flag); // Create UI scoreTxt = new Text2('0', { size: 60, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); scoreTxt.setText(LK.getScore()); LK.gui.top.addChild(scoreTxt); livesTxt = new Text2('Lives: 3', { size: 50, fill: 0xFFFFFF }); livesTxt.anchor.set(0, 0); livesTxt.x = 120; livesTxt.y = 20; LK.gui.topLeft.addChild(livesTxt); // Camera follow player var camera = { x: 0, y: 0 }; function updateCamera() { camera.x = player.x - 1024; camera.y = player.y - 1800; // Clamp camera bounds if (camera.x < 0) camera.x = 0; if (camera.x > 400) camera.x = 400; if (camera.y > -500) camera.y = -500; if (camera.y < -1200) camera.y = -1200; game.x = -camera.x; game.y = -camera.y; } // Touch controls game.down = function (x, y, obj) { isDragging = true; dragStartX = x + camera.x; lastTouchX = x + camera.x; // Check if tap is for jumping if (y > 2000) { player.jump(); } }; game.move = function (x, y, obj) { if (isDragging) { var currentX = x + camera.x; var deltaX = currentX - lastTouchX; if (deltaX > 5) { player.moveRight(); } else if (deltaX < -5) { player.moveLeft(); } lastTouchX = currentX; } }; game.up = function (x, y, obj) { isDragging = false; }; game.update = function () { updateCamera(); // Update lives display livesTxt.setText('Lives: ' + player.lives); // Remove destroyed coins for (var i = coins.length - 1; i >= 0; i--) { if (coins[i].collected) { coins.splice(i, 1); } } // Remove destroyed enemies for (var i = enemies.length - 1; i >= 0; i--) { if (enemies[i].defeated) { enemies.splice(i, 1); } } // Clean up destroyed particles for (var i = particles.length - 1; i >= 0; i--) { if (particles[i].life <= 0) { particles.splice(i, 1); } } // Dynamic background color based on player height var skyBlue = 0x87CEEB; var sunsetOrange = 0xFF8C69; var heightRatio = Math.max(0, Math.min(1, (2600 - player.y) / 1000)); var r = Math.floor(135 + (255 - 135) * heightRatio); var g = Math.floor(206 + (140 - 206) * heightRatio); var b = Math.floor(235 + (105 - 235) * heightRatio); var dynamicColor = r << 16 | g << 8 | b; game.setBackgroundColor(dynamicColor); };
===================================================================
--- original.js
+++ change.js
@@ -7,12 +7,20 @@
* Classes
****/
var Coin = Container.expand(function () {
var self = Container.call(this);
- var graphics = self.attachAsset('coin', {
+ var outerRing = self.attachAsset('coin_outer', {
anchorX: 0.5,
anchorY: 0.5
});
+ var innerRing = self.attachAsset('coin_inner', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ var center = self.attachAsset('coin_center', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
self.collected = false;
self.update = function () {
if (!self.collected) {
self.rotation += 0.1;
@@ -26,12 +34,21 @@
self.collected = true;
LK.setScore(LK.getScore() + 10);
scoreTxt.setText(LK.getScore());
LK.getSound('coin').play();
+ // Create particle effect
+ for (var i = 0; i < 8; i++) {
+ var particle = new Particle();
+ particle.x = self.x;
+ particle.y = self.y;
+ particles.push(particle);
+ game.addChild(particle);
+ }
tween(self, {
scaleX: 0,
scaleY: 0,
- alpha: 0
+ alpha: 0,
+ rotation: Math.PI * 2
}, {
duration: 300,
onFinish: function onFinish() {
self.destroy();
@@ -42,12 +59,29 @@
return self;
});
var Enemy = Container.expand(function () {
var self = Container.call(this);
- var graphics = self.attachAsset('enemy', {
+ var body = self.attachAsset('enemy_body', {
anchorX: 0.5,
anchorY: 1.0
});
+ var spikes = self.attachAsset('enemy_spikes', {
+ anchorX: 0.5,
+ anchorY: 1.0
+ });
+ spikes.y = -45;
+ var leftEye = self.attachAsset('enemy_eyes', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ leftEye.x = -10;
+ leftEye.y = -35;
+ var rightEye = self.attachAsset('enemy_eyes', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ rightEye.x = 10;
+ rightEye.y = -35;
self.velocityX = -2;
self.defeated = false;
self.update = function () {
if (!self.defeated) {
@@ -88,34 +122,107 @@
return self;
});
var Flag = Container.expand(function () {
var self = Container.call(this);
- var graphics = self.attachAsset('flag', {
+ var pole = self.attachAsset('flag_pole', {
anchorX: 0.5,
anchorY: 1.0
});
+ var cloth = self.attachAsset('flag_cloth', {
+ anchorX: 0,
+ anchorY: 0
+ });
+ cloth.x = 4;
+ cloth.y = -110;
+ var stripe1 = self.attachAsset('flag_stripe', {
+ anchorX: 0,
+ anchorY: 0
+ });
+ stripe1.x = 4;
+ stripe1.y = -95;
+ var stripe2 = self.attachAsset('flag_stripe', {
+ anchorX: 0,
+ anchorY: 0
+ });
+ stripe2.x = 4;
+ stripe2.y = -80;
+ self.animationTimer = 0;
self.update = function () {
+ // Flag waving animation
+ self.animationTimer += 0.1;
+ cloth.rotation = Math.sin(self.animationTimer) * 0.1;
+ stripe1.rotation = Math.sin(self.animationTimer) * 0.1;
+ stripe2.rotation = Math.sin(self.animationTimer) * 0.1;
if (self.intersects(player)) {
LK.setScore(LK.getScore() + 500);
LK.showYouWin();
}
};
return self;
});
+var Particle = Container.expand(function () {
+ var self = Container.call(this);
+ var graphics = self.attachAsset('particle', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.velocityX = (Math.random() - 0.5) * 10;
+ self.velocityY = (Math.random() - 0.5) * 10;
+ self.life = 60;
+ self.maxLife = 60;
+ self.update = function () {
+ self.x += self.velocityX;
+ self.y += self.velocityY;
+ self.velocityY += 0.3;
+ self.life--;
+ self.alpha = self.life / self.maxLife;
+ if (self.life <= 0) {
+ self.destroy();
+ }
+ };
+ return self;
+});
var Platform = Container.expand(function () {
var self = Container.call(this);
- var graphics = self.attachAsset('platform', {
+ var base = self.attachAsset('platform_base', {
anchorX: 0.5,
anchorY: 0.5
});
+ var top = self.attachAsset('platform_top', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ top.y = -15;
return self;
});
var Player = Container.expand(function () {
var self = Container.call(this);
- var graphics = self.attachAsset('player', {
+ var body = self.attachAsset('player_body', {
anchorX: 0.5,
anchorY: 1.0
});
+ var head = self.attachAsset('player_head', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ head.y = -60;
+ var hat = self.attachAsset('player_hat', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ hat.y = -75;
+ var leftEye = self.attachAsset('player_eyes', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ leftEye.x = -8;
+ leftEye.y = -60;
+ var rightEye = self.attachAsset('player_eyes', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ rightEye.x = 8;
+ rightEye.y = -60;
self.velocityX = 0;
self.velocityY = 0;
self.onGround = false;
self.speed = 8;
@@ -141,16 +248,38 @@
var platform = platforms[i];
if (self.intersects(platform)) {
if (self.velocityY > 0 && self.y - 40 < platform.y) {
self.y = platform.y;
+ if (self.velocityY > 5) {
+ // Create dust particles when landing hard
+ for (var j = 0; j < 4; j++) {
+ var dust = new Particle();
+ dust.x = self.x + (Math.random() - 0.5) * 40;
+ dust.y = self.y;
+ dust.velocityY = -Math.random() * 5;
+ particles.push(dust);
+ game.addChild(dust);
+ }
+ }
self.velocityY = 0;
self.onGround = true;
}
}
}
// Check ground collision
if (self.y >= groundLevel) {
self.y = groundLevel;
+ if (self.velocityY > 5) {
+ // Create dust particles when landing hard
+ for (var j = 0; j < 4; j++) {
+ var dust = new Particle();
+ dust.x = self.x + (Math.random() - 0.5) * 40;
+ dust.y = self.y;
+ dust.velocityY = -Math.random() * 5;
+ particles.push(dust);
+ game.addChild(dust);
+ }
+ }
self.velocityY = 0;
self.onGround = true;
}
// Check if fell off screen
@@ -200,12 +329,19 @@
/****
* Game Code
****/
+// Visual effects
+// Enhanced ground and platforms
+// Enhanced flag
+// Enhanced enemy
+// Enhanced coin
+// Player parts
var groundLevel = 2600;
var platforms = [];
var coins = [];
var enemies = [];
+var particles = [];
var player;
var flag;
var scoreTxt;
var livesTxt;
@@ -213,15 +349,29 @@
var isDragging = false;
var lastTouchX = 0;
// Create ground
for (var i = 0; i < 12; i++) {
- var groundTile = LK.getAsset('ground', {
+ var groundBase = LK.getAsset('ground_base', {
anchorX: 0.5,
anchorY: 0.5
});
- groundTile.x = i * 200 + 100;
- groundTile.y = groundLevel + 30;
- game.addChild(groundTile);
+ groundBase.x = i * 200 + 100;
+ groundBase.y = groundLevel + 30;
+ game.addChild(groundBase);
+ var groundTop = LK.getAsset('ground_top', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ groundTop.x = i * 200 + 100;
+ groundTop.y = groundLevel + 7;
+ game.addChild(groundTop);
+ var groundDirt = LK.getAsset('ground_dirt', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ groundDirt.x = i * 200 + 100;
+ groundDirt.y = groundLevel + 40;
+ game.addChild(groundDirt);
}
// Create platforms
var platformPositions = [{
x: 400,
@@ -373,5 +523,20 @@
if (enemies[i].defeated) {
enemies.splice(i, 1);
}
}
+ // Clean up destroyed particles
+ for (var i = particles.length - 1; i >= 0; i--) {
+ if (particles[i].life <= 0) {
+ particles.splice(i, 1);
+ }
+ }
+ // Dynamic background color based on player height
+ var skyBlue = 0x87CEEB;
+ var sunsetOrange = 0xFF8C69;
+ var heightRatio = Math.max(0, Math.min(1, (2600 - player.y) / 1000));
+ var r = Math.floor(135 + (255 - 135) * heightRatio);
+ var g = Math.floor(206 + (140 - 206) * heightRatio);
+ var b = Math.floor(235 + (105 - 235) * heightRatio);
+ var dynamicColor = r << 16 | g << 8 | b;
+ game.setBackgroundColor(dynamicColor);
};
\ No newline at end of file
uzay gemisi. In-Game asset. 2d. High contrast. No shadows
beyaz renkli yıldız. In-Game asset. 2d. High contrast. No shadows
jüpiter. In-Game asset. 2d. High contrast. No shadows
satürn. In-Game asset. 2d. High contrast. No shadows
dünya. In-Game asset. 2d. High contrast. No shadows
asteroit. In-Game asset. 2d. High contrast. No shadows
bonus. In-Game asset. 2d. High contrast. No shadows
mermi. In-Game asset. 2d. High contrast. No shadows
patlama. In-Game asset. 2d. High contrast. No shadows