User prompt
kulenin yıkılma ihtimalide olsun çok yamuk ve dengesiz koyuldunğunda kule yıkılabilir ve ilk 50 puan verdikten sonra üstüne düzgün gelomesse 10 puan vermen lazım sen 50 puan verdin. ip ve kule hala yavaş sallanmakta onu hızlandırman ve eşit bi şekilde sallanması gerekli ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
kuleler düzgün dizilmedikçe kulelerde sallansın 5 kule yamuk dizildiğinde sallanmaya başlasın eğer 5 ten sonra devam ederse yani kule tam düzgün dizilirse sallanma yavaşlasın ve kule tam düzgün hizalı dizildiğinde puanı 50 verilir tam olmassa puan 10 olur ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
çok güzel şimdi ipin ve kulanin sallanması aynı şekilde olsun yani ip sağa giderken kule sola gitmesin ve her kule dikilişinde işler biraz daha zorlaştır ki oyunun zevki çıksın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
kule nereye düşüyorsa zeminde oraya duracak en sola yerleşmeyecek ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
boylu boyuna çekilen zeminde ilk bıraktığımız kulanin durması gerekiyor ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
sallanan ipte ortda olması lazım zemine çekilen çizgide durması gerekiyor binayı nasıl dikicez ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
ayrıca tıklayıp bıraktığımız ipte tam ortda olması gerekiyot ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
ekranın en soluna geldi ortasına gelmesi lazın, en altta ki zemin boylu boyuna uzanması lazım ve ürünler üst üste dizilirken sprey sıkılıyormuş havası vermesi lazım ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
bir halat yardımı ile sağa sola sakin bir hızda sallanmalı dokunduğunda hallattan kopup temele ilk şişe düşmeli ardından gelen şişeler ilk şişenin üstüne düşmesse bunu oyun biter ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
probşemi çözermisin
User prompt
tamam bunların hepsini yap ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
farklı bir eklenti dene
User prompt
plugins problem ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
hala eklenti hatası verdi ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
eklenti hatası verdi
Code edit (1 edits merged)
Please save this source code
User prompt
Loris Perfume Tower - Stack & Balance
Initial prompt
We are developing a mobile-compatible "Stack & Balance" style game inspired by City Bloxx for Loris Perfume. The game concept revolves around the elegant and entertaining stacking of Loris Perfume bottles. Game Details: Players start by placing a perfume bottle flat on the ground. They then attempt to precisely stack falling perfume bottles onto the previous bottle. Each successful placement awards points and triggers a subtle perfume-spraying animation. The bottles alternate between upright and inverted positions as they fall, increasing the game's difficulty and enjoyment. As the stack grows taller, maintaining balance becomes increasingly challenging, with realistic swaying effects. If the stack collapses, the game ends, and the final score is displayed. At certain score milestones, players earn special discount codes, redeemable on the Loris Perfume online store. Visual Design: Perfume bottles should be stylish and attractive, inspired by actual Loris Perfume bottle designs. Backgrounds should feature pastel tones or subtle modern patterns aligned with the brand identity. The user interface should be minimalist, intuitive, and user-friendly. Sound and Animation: A gentle and pleasant spray sound should accompany the perfume-spraying animation. Soft and satisfying sound effects should be used as bottles fall and stack. Background music should be calming yet enjoyable. Overall Objective: To create positive user interaction with the Loris Perfume brand and enhance brand awareness through gameplay. To provide a fun, addictive, and visually appealing gaming experience.
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var PerfumeBottle = Container.expand(function (isInverted) {
var self = Container.call(this);
// Create bottle graphics based on orientation
var bottleAsset = isInverted ? 'perfumeBottleInverted' : 'perfumeBottleUpright';
var bottleGraphics = self.attachAsset(bottleAsset, {
anchorX: 0.5,
anchorY: 1.0
});
self.isInverted = isInverted || false;
self.fallSpeed = 3;
self.placed = false;
self.lastY = 0;
// Method to create spray effect
self.createSprayEffect = function () {
var spray = self.attachAsset('sprayEffect', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.8
});
// Position spray at top of bottle
spray.y = self.isInverted ? -180 : -20;
// Animate spray effect with tween
tween(spray, {
alpha: 0.6,
scaleX: 1.5,
scaleY: 1.5
}, {
duration: 300,
onFinish: function onFinish() {
tween(spray, {
alpha: 0.3,
scaleX: 2,
scaleY: 2
}, {
duration: 300,
onFinish: function onFinish() {
tween(spray, {
alpha: 0
}, {
duration: 200,
onFinish: function onFinish() {
if (spray.parent) {
spray.parent.removeChild(spray);
}
}
});
}
});
}
});
};
self.update = function () {
if (!self.placed) {
self.lastY = self.y;
self.y += self.fallSpeed;
}
};
return self;
});
var Tower = Container.expand(function () {
var self = Container.call(this);
self.bottles = [];
self.height = 0;
self.swayAmount = 0;
self.swaySpeed = 0.02;
// Add base bottle
self.addBase = function () {
var base = self.attachAsset('bottleBase', {
anchorX: 0.5,
anchorY: 1.0
});
base.y = gameHeight - 100;
self.height = base.y;
};
self.addBottle = function (bottle) {
bottle.y = self.height - (bottle.isInverted ? 180 : 20);
bottle.placed = true;
self.bottles.push(bottle);
self.height -= 180;
// Increase sway with tower height
self.swayAmount = Math.min(self.bottles.length * 0.5, 15);
};
self.update = function () {
// Apply swaying physics to tower
if (self.bottles.length > 0) {
var sway = Math.sin(LK.ticks * self.swaySpeed) * self.swayAmount;
for (var i = 0; i < self.bottles.length; i++) {
var bottle = self.bottles[i];
var swayMultiplier = (i + 1) / self.bottles.length;
bottle.x = sway * swayMultiplier;
}
}
};
self.checkCollapse = function (newBottle) {
// Simple collision check - if bottle is too far off center
var centerX = 0;
var tolerance = 80;
return Math.abs(newBottle.x - centerX) > tolerance;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0xF5F0E8
});
/****
* Game Code
****/
var gameWidth = 2048;
var gameHeight = 2732;
// Game state variables
var score = 0;
var gameActive = true;
var nextIsInverted = false;
var fallingBottle = null;
var dropCooldown = 0;
// Create tower
var tower = game.addChild(new Tower());
tower.x = gameWidth / 2;
tower.addBase();
// Create score display
var scoreTxt = new Text2('Score: 0', {
size: 80,
fill: 0x8B4513
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Create instruction text
var instructionTxt = new Text2('Tap to drop bottle', {
size: 60,
fill: 0xA0522D
});
instructionTxt.anchor.set(0.5, 0);
instructionTxt.y = 120;
LK.gui.top.addChild(instructionTxt);
// Spawn new falling bottle
function spawnBottle() {
if (!gameActive || fallingBottle) {
return;
}
fallingBottle = new PerfumeBottle(nextIsInverted);
fallingBottle.x = gameWidth / 2 + (Math.random() - 0.5) * 200;
fallingBottle.y = 100;
game.addChild(fallingBottle);
nextIsInverted = !nextIsInverted;
}
// Handle bottle placement
function placeBottle() {
if (!fallingBottle || !gameActive || dropCooldown > 0) {
return;
}
// Stop the bottle from falling
fallingBottle.placed = true;
// Check if placement is valid
if (tower.checkCollapse(fallingBottle)) {
// Game over - tower collapses
gameActive = false;
LK.effects.flashScreen(0xFF6B6B, 1000);
LK.setTimeout(function () {
LK.showGameOver();
}, 1000);
return;
}
// Successful placement
tower.addBottle(fallingBottle);
fallingBottle.createSprayEffect();
// Update score
score += 10;
LK.setScore(score);
scoreTxt.setText('Score: ' + score);
// Play sounds
LK.getSound('placeBottle').play();
LK.setTimeout(function () {
LK.getSound('spray').play();
}, 200);
// Check for milestone rewards
if (score % 100 === 0 && score > 0) {
LK.effects.flashScreen(0x98FB98, 500);
}
// Reset for next bottle
fallingBottle = null;
dropCooldown = 30; // Brief cooldown before next bottle
}
// Game input handling
game.down = function (x, y, obj) {
placeBottle();
};
// Main game update loop
game.update = function () {
if (!gameActive) {
return;
}
// Handle cooldown
if (dropCooldown > 0) {
dropCooldown--;
}
// Spawn new bottle if none exists and cooldown is over
if (!fallingBottle && dropCooldown === 0) {
spawnBottle();
}
// Check if falling bottle has gone off screen
if (fallingBottle && fallingBottle.y > gameHeight + 100) {
// Missed bottle - game over
gameActive = false;
LK.effects.flashScreen(0xFF6B6B, 1000);
LK.setTimeout(function () {
LK.showGameOver();
}, 1000);
}
};
// Start the game by spawning first bottle
LK.setTimeout(function () {
spawnBottle();
}, 1000); ===================================================================
--- original.js
+++ change.js
@@ -1,8 +1,8 @@
/****
* Plugins
****/
-var storage = LK.import("@upit/storage.v1");
+var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
@@ -26,24 +26,37 @@
alpha: 0.8
});
// Position spray at top of bottle
spray.y = self.isInverted ? -180 : -20;
- // Animate spray effect with simple fade
- var fadeTimer = LK.setTimeout(function () {
- spray.alpha = 0.6;
- spray.scaleX = 1.5;
- spray.scaleY = 1.5;
- var fadeTimer2 = LK.setTimeout(function () {
- spray.alpha = 0.3;
- spray.scaleX = 2;
- spray.scaleY = 2;
- var fadeTimer3 = LK.setTimeout(function () {
- if (spray.parent) {
- spray.parent.removeChild(spray);
+ // Animate spray effect with tween
+ tween(spray, {
+ alpha: 0.6,
+ scaleX: 1.5,
+ scaleY: 1.5
+ }, {
+ duration: 300,
+ onFinish: function onFinish() {
+ tween(spray, {
+ alpha: 0.3,
+ scaleX: 2,
+ scaleY: 2
+ }, {
+ duration: 300,
+ onFinish: function onFinish() {
+ tween(spray, {
+ alpha: 0
+ }, {
+ duration: 200,
+ onFinish: function onFinish() {
+ if (spray.parent) {
+ spray.parent.removeChild(spray);
+ }
+ }
+ });
}
- }, 200);
- }, 300);
- }, 300);
+ });
+ }
+ });
};
self.update = function () {
if (!self.placed) {
self.lastY = self.y;