User prompt
Upraded her sarın altında onceki fiyatın 4 katını istesin
User prompt
Upraded her satın altında omceki fiyatın 10 katını istesin
User prompt
Rebith her onceki fiyatına 4 kattınız istesin
User prompt
Upraded her sarın altında onceki fitaın 3 katını istesin
User prompt
Oyuna rebith ekle renith atınca her rebith altında 2 katta gucku basla butun herşeyi sıfırlansın rebith ilk fiyatı 1000 her satınalonca onceki fiyatın 1.5 kattı fiyatı istesin
User prompt
Upgraded 2 ekle
User prompt
Upraded 2x te ekle
User prompt
Noktadan sonra gösterme
User prompt
2 kat 2 kat fiyat artmasın 1.5 kat artsın
User prompt
Oyuna Shop ekle shopta puana click arttıracak upgraded alalım
User prompt
Tıklama hızını 2 katta arttır
User prompt
İstediniz kadar hızlı tıklayabilelin tıklama hızını arttır
User prompt
Time kaldır
Code edit (1 edits merged)
Please save this source code
User prompt
Tap the Orb
Initial prompt
Çoktan siyah olsun ekranın ortasında beyaz bir yuvarlak top olsun her tıkladımızda usteki score artsın
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1", {
highScore: 0
});
/****
* Classes
****/
var Orb = Container.expand(function () {
var self = Container.call(this);
// Create and attach the orb asset
var orbGraphics = self.attachAsset('orb', {
anchorX: 0.5,
anchorY: 0.5
});
// Initialize variables for animation and state
self.originalScale = 1;
self.isAnimating = false;
// Handle tap/click on the orb
self.down = function (x, y, obj) {
if (self.isAnimating) {
return;
}
// Play tap sound
LK.getSound('tap').play();
// Increment score
LK.setScore(LK.getScore() + 1);
// Update score display
scoreTxt.setText(LK.getScore());
// Animate the orb (shrink and grow)
self.isAnimating = true;
tween(orbGraphics, {
scaleX: 0.8,
scaleY: 0.8
}, {
duration: 100,
easing: tween.easeOut,
onFinish: function onFinish() {
tween(orbGraphics, {
scaleX: self.originalScale,
scaleY: self.originalScale
}, {
duration: 200,
easing: tween.elasticOut,
onFinish: function onFinish() {
self.isAnimating = false;
}
});
}
});
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000
});
/****
* Game Code
****/
// Set the background color to black for the minimalist aesthetic
game.setBackgroundColor(0x000000);
// Set up score display
var scoreTxt = new Text2('0', {
size: 150,
fill: 0xFFFFFF
});
scoreTxt.setText('0');
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Create high score display
var highScoreTxt = new Text2('High Score: 0', {
size: 60,
fill: 0xAAAAAA
});
highScoreTxt.setText('High Score: ' + storage.highScore);
highScoreTxt.anchor.set(0.5, 0);
highScoreTxt.y = 170;
LK.gui.top.addChild(highScoreTxt);
// Create time display
var timeTxt = new Text2('Time: 30', {
size: 60,
fill: 0xFFFFFF
});
timeTxt.anchor.set(0.5, 0);
timeTxt.y = 250;
LK.gui.top.addChild(timeTxt);
// Create tap instruction text
var instructionTxt = new Text2('Tap the orb as fast as you can!', {
size: 80,
fill: 0xFFFFFF
});
instructionTxt.anchor.set(0.5, 0);
instructionTxt.y = 350;
LK.gui.top.addChild(instructionTxt);
// Create and position the orb in the center of the screen
var orb = new Orb();
orb.x = 2048 / 2;
orb.y = 2732 / 2;
game.addChild(orb);
// Timer variables
var gameTime = 30; // 30 seconds game
var gameStarted = false;
var gameTimer = null;
// Function to start the game
function startGame() {
// Reset score
LK.setScore(0);
scoreTxt.setText('0');
// Reset timer
gameTime = 30;
timeTxt.setText('Time: ' + gameTime);
// Hide instruction
instructionTxt.alpha = 0;
// Start game timer
gameStarted = true;
if (gameTimer) {
LK.clearInterval(gameTimer);
}
gameTimer = LK.setInterval(function () {
gameTime--;
timeTxt.setText('Time: ' + gameTime);
if (gameTime <= 0) {
endGame();
}
}, 1000);
// Play background music
LK.playMusic('bgmusic', {
fade: {
start: 0,
end: 0.5,
duration: 1000
}
});
}
// Function to end the game
function endGame() {
gameStarted = false;
LK.clearInterval(gameTimer);
// Update high score if needed
if (LK.getScore() > storage.highScore) {
storage.highScore = LK.getScore();
highScoreTxt.setText('High Score: ' + storage.highScore);
// Animate the high score text
tween(highScoreTxt, {
scaleX: 1.5,
scaleY: 1.5
}, {
duration: 500,
easing: tween.easeOut,
onFinish: function onFinish() {
tween(highScoreTxt, {
scaleX: 1,
scaleY: 1
}, {
duration: 500,
easing: tween.elasticOut
});
}
});
}
// Fade out music
LK.playMusic('bgmusic', {
fade: {
start: 0.5,
end: 0,
duration: 800
}
});
// Show game over
LK.showGameOver();
}
// Check if the game should start when the player taps anywhere
game.down = function (x, y, obj) {
if (!gameStarted) {
startGame();
}
};
// Update function called every frame
game.update = function () {
// Add visual feedback - subtle pulsing of the orb when not tapped
if (!orb.isAnimating && gameStarted) {
var pulseScale = 1 + 0.05 * Math.sin(LK.ticks / 20);
orb.scale.set(pulseScale);
}
};
// Start with the instruction visible
instructionTxt.alpha = 1; ===================================================================
--- original.js
+++ change.js
@@ -1,6 +1,195 @@
-/****
+/****
+* Plugins
+****/
+var tween = LK.import("@upit/tween.v1");
+var storage = LK.import("@upit/storage.v1", {
+ highScore: 0
+});
+
+/****
+* Classes
+****/
+var Orb = Container.expand(function () {
+ var self = Container.call(this);
+ // Create and attach the orb asset
+ var orbGraphics = self.attachAsset('orb', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ // Initialize variables for animation and state
+ self.originalScale = 1;
+ self.isAnimating = false;
+ // Handle tap/click on the orb
+ self.down = function (x, y, obj) {
+ if (self.isAnimating) {
+ return;
+ }
+ // Play tap sound
+ LK.getSound('tap').play();
+ // Increment score
+ LK.setScore(LK.getScore() + 1);
+ // Update score display
+ scoreTxt.setText(LK.getScore());
+ // Animate the orb (shrink and grow)
+ self.isAnimating = true;
+ tween(orbGraphics, {
+ scaleX: 0.8,
+ scaleY: 0.8
+ }, {
+ duration: 100,
+ easing: tween.easeOut,
+ onFinish: function onFinish() {
+ tween(orbGraphics, {
+ scaleX: self.originalScale,
+ scaleY: self.originalScale
+ }, {
+ duration: 200,
+ easing: tween.elasticOut,
+ onFinish: function onFinish() {
+ self.isAnimating = false;
+ }
+ });
+ }
+ });
+ };
+ return self;
+});
+
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
backgroundColor: 0x000000
-});
\ No newline at end of file
+});
+
+/****
+* Game Code
+****/
+// Set the background color to black for the minimalist aesthetic
+game.setBackgroundColor(0x000000);
+// Set up score display
+var scoreTxt = new Text2('0', {
+ size: 150,
+ fill: 0xFFFFFF
+});
+scoreTxt.setText('0');
+scoreTxt.anchor.set(0.5, 0);
+LK.gui.top.addChild(scoreTxt);
+// Create high score display
+var highScoreTxt = new Text2('High Score: 0', {
+ size: 60,
+ fill: 0xAAAAAA
+});
+highScoreTxt.setText('High Score: ' + storage.highScore);
+highScoreTxt.anchor.set(0.5, 0);
+highScoreTxt.y = 170;
+LK.gui.top.addChild(highScoreTxt);
+// Create time display
+var timeTxt = new Text2('Time: 30', {
+ size: 60,
+ fill: 0xFFFFFF
+});
+timeTxt.anchor.set(0.5, 0);
+timeTxt.y = 250;
+LK.gui.top.addChild(timeTxt);
+// Create tap instruction text
+var instructionTxt = new Text2('Tap the orb as fast as you can!', {
+ size: 80,
+ fill: 0xFFFFFF
+});
+instructionTxt.anchor.set(0.5, 0);
+instructionTxt.y = 350;
+LK.gui.top.addChild(instructionTxt);
+// Create and position the orb in the center of the screen
+var orb = new Orb();
+orb.x = 2048 / 2;
+orb.y = 2732 / 2;
+game.addChild(orb);
+// Timer variables
+var gameTime = 30; // 30 seconds game
+var gameStarted = false;
+var gameTimer = null;
+// Function to start the game
+function startGame() {
+ // Reset score
+ LK.setScore(0);
+ scoreTxt.setText('0');
+ // Reset timer
+ gameTime = 30;
+ timeTxt.setText('Time: ' + gameTime);
+ // Hide instruction
+ instructionTxt.alpha = 0;
+ // Start game timer
+ gameStarted = true;
+ if (gameTimer) {
+ LK.clearInterval(gameTimer);
+ }
+ gameTimer = LK.setInterval(function () {
+ gameTime--;
+ timeTxt.setText('Time: ' + gameTime);
+ if (gameTime <= 0) {
+ endGame();
+ }
+ }, 1000);
+ // Play background music
+ LK.playMusic('bgmusic', {
+ fade: {
+ start: 0,
+ end: 0.5,
+ duration: 1000
+ }
+ });
+}
+// Function to end the game
+function endGame() {
+ gameStarted = false;
+ LK.clearInterval(gameTimer);
+ // Update high score if needed
+ if (LK.getScore() > storage.highScore) {
+ storage.highScore = LK.getScore();
+ highScoreTxt.setText('High Score: ' + storage.highScore);
+ // Animate the high score text
+ tween(highScoreTxt, {
+ scaleX: 1.5,
+ scaleY: 1.5
+ }, {
+ duration: 500,
+ easing: tween.easeOut,
+ onFinish: function onFinish() {
+ tween(highScoreTxt, {
+ scaleX: 1,
+ scaleY: 1
+ }, {
+ duration: 500,
+ easing: tween.elasticOut
+ });
+ }
+ });
+ }
+ // Fade out music
+ LK.playMusic('bgmusic', {
+ fade: {
+ start: 0.5,
+ end: 0,
+ duration: 800
+ }
+ });
+ // Show game over
+ LK.showGameOver();
+}
+// Check if the game should start when the player taps anywhere
+game.down = function (x, y, obj) {
+ if (!gameStarted) {
+ startGame();
+ }
+};
+// Update function called every frame
+game.update = function () {
+ // Add visual feedback - subtle pulsing of the orb when not tapped
+ if (!orb.isAnimating && gameStarted) {
+ var pulseScale = 1 + 0.05 * Math.sin(LK.ticks / 20);
+ orb.scale.set(pulseScale);
+ }
+};
+// Start with the instruction visible
+instructionTxt.alpha = 1;
\ No newline at end of file