User prompt
iksir efekti de tam yuvarlak olsun.
User prompt
Blue ellipse shape asset ekle ve iksirde bunu kullan.
User prompt
iksir toplarken de mavi bir yuvarlak kullan.
User prompt
altın toplarken patlama efektinde sarı yuvarlak kullan.
User prompt
altın toplarken patlama efektinde enemy asseti kullanma
User prompt
Joystick asset ve kodlarını kaldır.
User prompt
Düşman çarpınca kırmızı patlasın. Diğer efektleri bozma.
User prompt
Çarpan düşman kırmızı patlasın.
User prompt
Çarpan düşman kirmizi patlamasın.
User prompt
Altın toplama efekti daha büyük ve alphasiz olsun.
User prompt
Mavi renk patlams alphası 0.5 olsun
Code edit (1 edits merged)
Please save this source code
User prompt
Altın toplama efektini sap sarı renk yap ve büyüt.
User prompt
Mavi renk patlama olsun.
User prompt
iksir toplayınca bulut gibi patlama efekti yap.
User prompt
iksirleri 2 kat büyüt.
User prompt
burn ismini lose yap
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
// Enemy
var Enemy = Container.expand(function () {
var self = Container.call(this);
var enemy = self.attachAsset('enemy', {
anchorX: 0.5,
anchorY: 0.5
});
self.width = enemy.width;
self.height = enemy.height;
self.speed = 4 + Math.random() * 2;
self.update = function () {
self.x -= self.speed;
};
return self;
});
// Exit Door
var ExitDoor = Container.expand(function () {
var self = Container.call(this);
var exit = self.attachAsset('exit', {
anchorX: 0.5,
anchorY: 1
});
self.width = exit.width;
self.height = exit.height;
return self;
});
// Gold
var Gold = Container.expand(function () {
var self = Container.call(this);
var gold = self.attachAsset('gold', {
anchorX: 0.5,
anchorY: 0.5
});
self.width = gold.width;
self.height = gold.height;
self.collected = false;
return self;
});
// Joystick
var Joystick = Container.expand(function () {
var self = Container.call(this);
// Large, glassy, transparent base
var base = self.attachAsset('joystickBase', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.18 // More glassy, less visible
});
// Large knob, more visible
var knob = self.attachAsset('joystickKnob', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.7
});
self.baseRadius = base.width / 2;
self.knobRadius = knob.width / 2;
self.knob = knob;
// --- Big Arrow Overlays ---
// Arrow style: white, semi-transparent, large, pointing outwards
function createArrow(rotation) {
// Use a box as arrow body, and a triangle as arrow head (simulate with two ellipses for sandbox)
var arrow = new Container();
// Arrow body (rectangle)
var body = LK.getAsset('joystickKnob', {
width: 38,
height: 90,
color: 0xffffff,
anchorX: 0.5,
anchorY: 0.8,
alpha: 0.18
});
// Arrow head (ellipse, simulates triangle tip)
var head = LK.getAsset('joystickKnob', {
width: 70,
height: 70,
color: 0xffffff,
anchorX: 0.5,
anchorY: 0.2,
alpha: 0.32
});
body.y = 0;
head.y = -50;
arrow.addChild(body);
arrow.addChild(head);
arrow.rotation = rotation;
return arrow;
}
// Up
var arrowUp = createArrow(0);
arrowUp.y = -base.width * 0.36;
self.addChild(arrowUp);
// Down
var arrowDown = createArrow(Math.PI);
arrowDown.y = base.width * 0.36;
self.addChild(arrowDown);
// Left
var arrowLeft = createArrow(-Math.PI / 2);
arrowLeft.x = -base.width * 0.36;
self.addChild(arrowLeft);
// Right
var arrowRight = createArrow(Math.PI / 2);
arrowRight.x = base.width * 0.36;
self.addChild(arrowRight);
// Place knob on top
self.addChild(knob);
self.active = false;
self.touchId = null;
self.centerX = 0;
self.centerY = 0;
self.valueX = 0;
self.valueY = 0;
self.reset = function () {
self.knob.x = 0;
self.knob.y = 0;
self.valueX = 0;
self.valueY = 0;
};
self.down = function (x, y, obj) {
self.active = true;
self.centerX = self.x;
self.centerY = self.y;
self.touchId = obj.event && obj.event.identifier !== undefined ? obj.event.identifier : null;
self.move(x, y, obj);
};
self.move = function (x, y, obj) {
if (!self.active) return;
var dx = x - self.centerX;
var dy = y - self.centerY;
var dist = Math.sqrt(dx * dx + dy * dy);
var maxDist = self.baseRadius - self.knobRadius;
if (dist > maxDist) {
dx = dx * maxDist / dist;
dy = dy * maxDist / dist;
dist = maxDist;
}
self.knob.x = dx;
self.knob.y = dy;
self.valueX = dx / maxDist;
self.valueY = dy / maxDist;
};
self.up = function (x, y, obj) {
self.active = false;
self.touchId = null;
self.reset();
};
self.reset();
return self;
});
// MagicCarpet: Player
var MagicCarpet = Container.expand(function () {
var self = Container.call(this);
var carpet = self.attachAsset('carpet', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 2,
scaleY: 2
});
self.width = carpet.width;
self.height = carpet.height;
self.baseY = 0;
self.swayTick = 0;
self.update = function () {
// Sway up and down
self.swayTick += 0.07;
self.y = self.baseY + Math.sin(self.swayTick) * 18;
};
return self;
});
// ParallaxLayer: For background movement
var ParallaxLayer = Container.expand(function () {
var self = Container.call(this);
self.speed = 0;
self.sprites = [];
self.assetId = '';
self.y = 0;
self.height = 0;
self.init = function (assetId, y, speed, count) {
self.assetId = assetId;
self.y = y;
self.speed = speed;
self.height = LK.getAsset(assetId, {}).height;
for (var i = 0; i < count; i++) {
var sprite = self.attachAsset(assetId, {
anchorX: 0,
anchorY: 0,
x: i * LK.getAsset(assetId, {}).width,
y: 0
});
self.sprites.push(sprite);
}
};
self.update = function () {
for (var i = 0; i < self.sprites.length; i++) {
var s = self.sprites[i];
s.x -= self.speed;
if (s.x <= -s.width) {
// Move to right
s.x += s.width * self.sprites.length;
}
}
};
return self;
});
// Potion
var Potion = Container.expand(function () {
var self = Container.call(this);
var potion = self.attachAsset('potion', {
anchorX: 0.5,
anchorY: 0.5
});
self.width = potion.width;
self.height = potion.height;
self.collected = false;
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87ceeb // Sky blue
});
/****
* Game Code
****/
// Arkaplan müziğini başlat (loop açık, fade ile yumuşak başlat)
// --- Parallax Layers ---
// Uzun arkaplan müziği (örnek id: 'longbgmusic', gerçek id asset pipeline'dan gelir)
LK.playMusic('longbgmusic', {
fade: {
start: 0,
end: 0.7,
duration: 1800
}
});
// Sihirli Halı (Magic Carpet)
// Altın (Gold)
// İksir (Potion)
// Düşman (Enemy)
// Çıkış Kapısı (Exit Door)
// Zemin (Ground, parallax layer 1)
// Dağlar (Mountains, parallax layer 2)
// Bulut (Cloud, parallax layer 3)
// Joystick tabanı
// Joystick topu
var parallaxLayers = [];
// Layer 1: Ground (closest)
var groundLayer = new ParallaxLayer();
groundLayer.init('ground', 2732 - 300, 2.5, 2);
game.addChild(groundLayer);
parallaxLayers.push(groundLayer);
// Layer 2: Mountains (middle)
var mountainLayer = new ParallaxLayer();
mountainLayer.init('mountain', 2732 - 300 - 180, 1.2, 2);
game.addChild(mountainLayer);
parallaxLayers.push(mountainLayer);
// Layer 3: Clouds (farthest, randomized positions and sizes, more scattered)
var cloudSprites = [];
var cloudCount = 12 + Math.floor(Math.random() * 5); // 12-16 clouds for more density
for (var i = 0; i < cloudCount; i++) {
// More variety in scale and position, allow overlap and wide spread
var scale = 0.5 + Math.random() * 2.0; // 0.5x to 2.5x
var y = 40 + Math.random() * 900; // Spread vertically in upper 940px
var x = Math.random() * 2048;
var cloud = LK.getAsset('cloud', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: scale,
scaleY: scale,
x: x,
y: y
});
cloud._cloudSpeed = 0.25 + Math.random() * 0.7; // 0.25-0.95 px/frame
game.addChild(cloud);
cloudSprites.push(cloud);
}
parallaxLayers.push({
// Dummy for compatibility, update will be handled below
update: function update() {
for (var i = 0; i < cloudSprites.length; i++) {
var c = cloudSprites[i];
c.x -= c._cloudSpeed;
if (c.x < -c.width / 2) {
// When respawning, randomize both X and Y for more scattered effect
c.x = 2048 + c.width / 2 + Math.random() * 300;
c.y = 40 + Math.random() * 900;
c._cloudSpeed = 0.25 + Math.random() * 0.7;
var scale = 0.5 + Math.random() * 2.0;
c.scaleX = scale;
c.scaleY = scale;
}
}
}
});
// --- Exit Door ---
var exitDoor = new ExitDoor();
exitDoor.x = 2048 - 200;
exitDoor.y = 2732 - 300 - 10;
exitDoor.visible = false;
game.addChild(exitDoor);
// --- Magic Carpet (Player) ---
var carpet = new MagicCarpet();
carpet.x = 320;
carpet.baseY = 2732 / 2;
carpet.y = carpet.baseY;
carpet.targetX = carpet.x;
carpet.targetBaseY = carpet.baseY;
game.addChild(carpet);
// --- Collectibles ---
var golds = [];
var potions = [];
// Gold positions (spread out, not overlapping, not too close to edges)
var goldPositions = [{
x: 700,
y: 700
}, {
x: 1200,
y: 900
}, {
x: 900,
y: 1700
}, {
x: 1500,
y: 1200
}, {
x: 1800,
y: 2100
}];
for (var i = 0; i < 5; i++) {
var g = new Gold();
g.x = goldPositions[i].x;
g.y = goldPositions[i].y;
golds.push(g);
game.addChild(g);
}
// Potion positions
var potionPositions = [{
x: 1100,
y: 2200
}, {
x: 1700,
y: 600
}];
for (var i = 0; i < 2; i++) {
var p = new Potion();
p.x = potionPositions[i].x;
p.y = potionPositions[i].y;
potions.push(p);
game.addChild(p);
}
// --- Enemies ---
var enemies = [];
function spawnEnemies() {
// 3 enemies, random vertical positions, spaced horizontally
enemies.length = 0;
for (var i = 0; i < 3; i++) {
var e = new Enemy();
e.x = 2048 + 200 + i * 300;
e.y = 600 + Math.random() * (2732 - 1200);
enemies.push(e);
game.addChild(e);
}
}
spawnEnemies();
// --- Joystick ---
var joystick = new Joystick();
// Center bottom: x = 2048/2, y = just above bottom edge, accounting for joystick size
joystick.x = 2048 / 2;
joystick.y = 2732 - joystick.baseRadius - 40; // 40px margin from bottom
// Always add joystick to LK.gui.bottom
LK.gui.bottom.addChild(joystick);
// --- GUI: Score/Progress ---
var progressTxt = new Text2('', {
size: 80,
fill: "#fff"
});
progressTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(progressTxt);
// --- State ---
var collectedGold = 0;
var collectedPotion = 0;
var allCollected = false;
var gameOver = false;
var youWin = false;
// --- Helper: Update Progress Text ---
function updateProgressText() {
progressTxt.setText("Altın: " + collectedGold + "/5 İksir: " + collectedPotion + "/2");
}
updateProgressText();
// --- Helper: Reset Game State ---
function resetGame() {
// Reset collectibles
for (var i = 0; i < golds.length; i++) {
golds[i].collected = false;
golds[i].visible = true;
}
for (var i = 0; i < potions.length; i++) {
potions[i].collected = false;
potions[i].visible = true;
}
collectedGold = 0;
collectedPotion = 0;
allCollected = false;
updateProgressText();
// Reset player
carpet.x = 320;
carpet.baseY = 2732 / 2;
carpet.swayTick = 0;
carpet.targetX = carpet.x;
carpet.targetBaseY = carpet.baseY;
// Reset enemies
for (var i = 0; i < enemies.length; i++) {
enemies[i].destroy();
}
spawnEnemies();
// Hide exit
exitDoor.visible = false;
gameOver = false;
youWin = false;
}
// --- Joystick Event Handling ---
// (Handled by Joystick class itself)
// --- Touch Handling for Joystick (on GUI) ---
LK.gui.bottom.down = function (x, y, obj) {
// Only trigger if inside joystick area
var localX = x - joystick.x;
var localY = y - joystick.y;
if (localX * localX + localY * localY <= joystick.baseRadius * joystick.baseRadius) {
joystick.down(x, y, obj);
}
};
LK.gui.bottom.move = function (x, y, obj) {
if (joystick.active) {
joystick.move(x, y, obj);
}
};
LK.gui.bottom.up = function (x, y, obj) {
if (joystick.active) {
joystick.up(x, y, obj);
}
};
// --- Main Game Move Handler (for mobile drag outside joystick) ---
// Touch/drag anywhere on the game area (except joystick) to move the player directly
var draggingPlayer = false;
game.down = function (x, y, obj) {
// Don't start drag if inside joystick area
var localX = x - joystick.x;
var localY = y - joystick.y;
if (localX * localX + localY * localY > joystick.baseRadius * joystick.baseRadius) {
draggingPlayer = true;
// Set target position for smooth movement
var margin = 60;
var px = x;
var py = y;
if (px < margin + carpet.width / 2) px = margin + carpet.width / 2;
if (px > 2048 - margin - carpet.width / 2) px = 2048 - margin - carpet.width / 2;
if (py < margin + carpet.height / 2) py = margin + carpet.height / 2;
if (py > 2732 - 300 - margin - carpet.height / 2) py = 2732 - 300 - margin - carpet.height / 2;
carpet.targetX = px;
carpet.targetBaseY = py;
}
};
game.move = function (x, y, obj) {
if (draggingPlayer) {
// Set target position for smooth movement
var margin = 60;
var px = x;
var py = y;
if (px < margin + carpet.width / 2) px = margin + carpet.width / 2;
if (px > 2048 - margin - carpet.width / 2) px = 2048 - margin - carpet.width / 2;
if (py < margin + carpet.height / 2) py = margin + carpet.height / 2;
if (py > 2732 - 300 - margin - carpet.height / 2) py = 2732 - 300 - margin - carpet.height / 2;
carpet.targetX = px;
carpet.targetBaseY = py;
}
};
game.up = function (x, y, obj) {
draggingPlayer = false;
carpet.targetX = undefined;
carpet.targetBaseY = undefined;
};
// --- Main Game Update Loop ---
game.update = function () {
if (gameOver || youWin) return;
// Parallax layers
for (var i = 0; i < parallaxLayers.length; i++) {
parallaxLayers[i].update();
}
// Player movement (joystick)
var speed = 13;
var vx = joystick.valueX * speed;
var vy = joystick.valueY * speed;
carpet.x += vx;
carpet.baseY += vy;
// Smooth movement toward target if dragging
if (typeof carpet.targetX === "number" && typeof carpet.targetBaseY === "number") {
// Only move if not already at target
var dx = carpet.targetX - carpet.x;
var dy = carpet.targetBaseY - carpet.baseY;
var dist = Math.sqrt(dx * dx + dy * dy);
if (dist > 2) {
// Move a fraction toward target (lerp)
var moveSpeed = 0.22; // 0..1, higher = faster
carpet.x += dx * moveSpeed;
carpet.baseY += dy * moveSpeed;
} else {
// Snap to target if close enough
carpet.x = carpet.targetX;
carpet.baseY = carpet.targetBaseY;
}
}
// Clamp inside play area (not too close to edges)
var margin = 60;
if (carpet.x < margin + carpet.width / 2) carpet.x = margin + carpet.width / 2;
if (carpet.x > 2048 - margin - carpet.width / 2) carpet.x = 2048 - margin - carpet.width / 2;
if (carpet.baseY < margin + carpet.height / 2) carpet.baseY = margin + carpet.height / 2;
if (carpet.baseY > 2732 - 300 - margin - carpet.height / 2) carpet.baseY = 2732 - 300 - margin - carpet.height / 2;
// Sway
carpet.update();
// Collectibles: Gold
for (var i = 0; i < golds.length; i++) {
var g = golds[i];
if (!g.collected && carpet.intersects(g)) {
g.collected = true;
g.visible = false;
// Play gold collect sound
LK.getSound('gold_collect').play();
// Sparkle effect: create a large, fully opaque round flash at gold position
var sparkle = LK.getAsset('enemy', {
width: g.width * 2.5,
height: g.height * 2.5,
color: 0xb89b1c,
// dark yellow
anchorX: 0.5,
anchorY: 0.5,
alpha: 1,
x: g.x,
y: g.y
});
game.addChild(sparkle);
// Animate: scale up and fade out quickly, then remove
tween(sparkle, {
scaleX: 2.8,
scaleY: 2.8,
alpha: 0
}, {
duration: 340,
easing: tween.easeOut,
complete: function complete() {
sparkle.destroy();
}
});
collectedGold++;
updateProgressText();
}
}
// Collectibles: Potion
for (var i = 0; i < potions.length; i++) {
var p = potions[i];
if (!p.collected && carpet.intersects(p)) {
p.collected = true;
p.visible = false;
// Play potion collect sound
LK.getSound('potion_collect').play();
// --- Cloud-like explosion effect ---
var cloudCount = 7 + Math.floor(Math.random() * 3); // 7-9 clouds
for (var ci = 0; ci < cloudCount; ci++) {
var angle = Math.random() * Math.PI * 2;
var dist = 30 + Math.random() * 60;
var scale = 0.7 + Math.random() * 1.2;
var cx = p.x + Math.cos(angle) * dist;
var cy = p.y + Math.sin(angle) * dist;
var cloud = LK.getAsset('cloud', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: scale,
scaleY: scale,
alpha: 0.7,
x: p.x,
y: p.y,
tint: 0x3399ff // blue
});
game.addChild(cloud);
// Animate: move outward, fade out, scale up a bit
tween(cloud, {
x: cx,
y: cy,
alpha: 0,
scaleX: scale * 1.25,
scaleY: scale * 1.25
}, {
duration: 420 + Math.random() * 180,
easing: tween.easeOut,
complete: function (cloud) {
return function () {
cloud.destroy();
};
}(cloud)
});
}
collectedPotion++;
updateProgressText();
}
}
// All collected?
if (!allCollected && collectedGold === 5 && collectedPotion === 2) {
allCollected = true;
// Show exit door
exitDoor.visible = true;
// Animate door (flash green)
tween(exitDoor, {
tint: 0x00ff00
}, {
duration: 600,
easing: tween.bounceOut
});
}
// Enemies
for (var i = 0; i < enemies.length; i++) {
var e = enemies[i];
e.update();
// If off screen left, respawn to right
if (e.x < -e.width) {
e.x = 2048 + 200 + Math.random() * 200;
e.y = 600 + Math.random() * (2732 - 1200);
e.speed = 4 + Math.random() * 2;
}
// Collision with player
if (carpet.intersects(e)) {
// Game over
gameOver = true;
// Play lose sound
LK.getSound('lose').play();
LK.effects.flashScreen(0xff0000, 900);
LK.setTimeout(function () {
LK.showGameOver();
}, 900);
return;
}
}
// Win condition: All collected and reached exit
if (allCollected && carpet.intersects(exitDoor)) {
youWin = true;
// Play win sound
LK.getSound('win').play();
LK.effects.flashScreen(0x00ff00, 700);
LK.setTimeout(function () {
LK.showYouWin();
}, 700);
return;
}
};
// --- Game Over/Win Reset Handler ---
LK.on('gameover', function () {
resetGame();
});
LK.on('youwin', function () {
resetGame();
}); ===================================================================
--- original.js
+++ change.js
@@ -532,25 +532,25 @@
g.collected = true;
g.visible = false;
// Play gold collect sound
LK.getSound('gold_collect').play();
- // Sparkle effect: create a round, dark yellow flash at gold position
+ // Sparkle effect: create a large, fully opaque round flash at gold position
var sparkle = LK.getAsset('enemy', {
- width: g.width * 1.7,
- height: g.height * 1.7,
+ width: g.width * 2.5,
+ height: g.height * 2.5,
color: 0xb89b1c,
// dark yellow
anchorX: 0.5,
anchorY: 0.5,
- alpha: 0.7,
+ alpha: 1,
x: g.x,
y: g.y
});
game.addChild(sparkle);
// Animate: scale up and fade out quickly, then remove
tween(sparkle, {
- scaleX: 2.2,
- scaleY: 2.2,
+ scaleX: 2.8,
+ scaleY: 2.8,
alpha: 0
}, {
duration: 340,
easing: tween.easeOut,
@@ -582,9 +582,9 @@
anchorX: 0.5,
anchorY: 0.5,
scaleX: scale,
scaleY: scale,
- alpha: 0.5,
+ alpha: 0.7,
x: p.x,
y: p.y,
tint: 0x3399ff // blue
});
Fullscreen modern App Store landscape banner, 16:9, high definition, for a game titled "Sihirli Halı: Çöl Macerası" and with the description "Sihirli halı ile çöl manzarasında süzül, altın ve iksirleri topla, düşmanlardan kaç ve çıkış kapısına ulaş!". No text on banner!
Pofuduk yumuşacık bulut. In-Game asset. 2d. High contrast. No shadows
sihirli iksir mavi renk. In-Game asset. 2d. High contrast. No shadows
red angry bird transparan. In-Game asset. 2d. High contrast. No shadows
Green wood arabic door. In-Game asset. 2d. High contrast. No shadows
Gold coin up view tranparent. In-Game asset. 2d. High contrast. No shadows no text