User prompt
If we are low on health after 100 points, let the falling speed of the incoming heart be 16x
User prompt
If he has passed 100 points and only has 1 heart left, only 1 heart will spawn on the screen and think about it. If he can't catch it, he won't be able to get it, but if he clicks, he will get 1 life. After getting the life, it will not appear again.
User prompt
What you will add: bananas 14x after 150 scores, 15x after 160 scores, 16x after 170 scores, 17x after 180 scores, 18x after 190 scores, 19x after 200 scores, 20x. Do this banana acceleration.
User prompt
What you will add: bananas 9x after 90 scores, 9.5x after 100 scores, 10x after 110 scores, 10.5x after 120 scores, 11x after 130 scores, 12x after 140 scores, 13x. Do this banana acceleration.
User prompt
Things to add: Bananas increase 6x after 30 scores, 6.5x after 40 scores, 7x after 50 scores, 7.5x after 60 scores, 8x after 70 scores and 8.5x after 80 scores. Add these bananas to the speedup code.
User prompt
Increase your speed in this order. After 5 scores 2x, after 10 scores 3x, after 20 scores 5x% etc. I want you to do this.
User prompt
Please fix the bug: 'Uncaught TypeError: tween.to is not a function' in or related to this line: 'tween.to(self, 0.2, {' Line Number: 79 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Kalpleri sağ tarafa al.
Code edit (1 edits merged)
Please save this source code
User prompt
Don't Drop It
Initial prompt
Oyunda yukarıdan muzlar düşecek ve oyuncu tıklamazsa ve en aşağı düşerse oyunu kaybedecek. Muzlar yavaştan başlayıp git gide hızlanacak. Ve 15 skordan sonra bombalar düşmeye başlayacak. 3 tane de kalbimiz olacak. Bunu yap. Oyunun adı da "Don't Drop It"
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var FallingItem = Container.expand(function () {
var self = Container.call(this);
self.type = "banana"; // default type
self.speed = 2; // default speed
self.lastY = 0;
self.active = true;
self.graphics = null;
self.init = function (type, speed) {
self.type = type || "banana";
self.speed = speed || 2;
// Remove any existing graphics
if (self.graphics) {
self.removeChild(self.graphics);
}
// Create the appropriate graphics based on type
if (self.type === "banana") {
self.graphics = self.attachAsset('banana', {
anchorX: 0.5,
anchorY: 0.5
});
} else if (self.type === "bomb") {
self.graphics = self.attachAsset('bomb', {
anchorX: 0.5,
anchorY: 0.5
});
}
// Set initial position
self.x = Math.random() * (2048 - 200) + 100;
self.y = -100;
self.lastY = self.y;
// Interactive for tapping
self.interactive = true;
};
self.update = function () {
if (!self.active) return;
self.lastY = self.y;
self.y += self.speed;
};
self.down = function (x, y, obj) {
if (!self.active) return;
if (self.type === "banana") {
// Scored a point by tapping banana
LK.setScore(LK.getScore() + 1);
LK.getSound('pop').play();
self.remove();
} else if (self.type === "bomb") {
// Lost a life by tapping bomb
LK.getSound('explosion').play();
decreaseLife();
self.remove();
}
};
self.remove = function () {
self.active = false;
tween(self, {
alpha: 0,
scaleX: 0.3,
scaleY: 0.3
}, {
duration: 200,
onFinish: function onFinish() {
self.destroy();
}
});
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000
});
/****
* Game Code
****/
;
// Game constants
var SCREEN_WIDTH = 2048;
var SCREEN_HEIGHT = 2732;
var MAX_LIVES = 3;
var BOMB_THRESHOLD_SCORE = 15;
var SPAWN_INTERVAL_INITIAL = 60; // frames
var MIN_SPAWN_INTERVAL = 20; // frames
var INTERVAL_DECREMENT = 1;
// Game variables
var fallingItems = [];
var lives = MAX_LIVES;
var spawnCounter = 0;
var currentSpawnInterval = SPAWN_INTERVAL_INITIAL;
var currentSpeed = 2;
var isGameOver = false;
// Add background
var background = game.addChild(LK.getAsset('background', {
anchorX: 0,
anchorY: 0
}));
// Initialize score text
var scoreText = new Text2('Score: 0', {
size: 80,
fill: 0xFFFFFF
});
scoreText.anchor.set(0.5, 0);
scoreText.x = SCREEN_WIDTH / 2;
scoreText.y = 50;
game.addChild(scoreText);
// Create hearts container
var heartsContainer = new Container();
heartsContainer.x = 50;
heartsContainer.y = 50;
game.addChild(heartsContainer);
// Initialize hearts display
function initLives() {
// Clear existing hearts
while (heartsContainer.children.length > 0) {
heartsContainer.removeChildAt(0);
}
// Add hearts based on current lives
for (var i = 0; i < lives; i++) {
var heart = LK.getAsset('heart', {
anchorX: 0,
anchorY: 0,
x: i * 100,
y: 0
});
heartsContainer.addChild(heart);
}
}
// Function to decrease life
function decreaseLife() {
lives--;
initLives();
// Shake the screen
LK.effects.flashScreen(0xff0000, 300);
// Check for game over
if (lives <= 0) {
gameOver();
}
}
// Function to handle game over
function gameOver() {
if (isGameOver) return;
isGameOver = true;
LK.getSound('gameover').play();
LK.effects.flashScreen(0xff0000, 1000);
// Remove all falling items
for (var i = fallingItems.length - 1; i >= 0; i--) {
fallingItems[i].destroy();
}
fallingItems = [];
// Show game over screen
LK.setTimeout(function () {
LK.showGameOver();
}, 1000);
}
// Function to spawn a new falling item
function spawnItem() {
var isBomb = LK.getScore() >= BOMB_THRESHOLD_SCORE && Math.random() < 0.3;
var itemType = isBomb ? "bomb" : "banana";
var item = new FallingItem();
item.init(itemType, currentSpeed);
fallingItems.push(item);
game.addChild(item);
return item;
}
// Update game state each frame
game.update = function () {
if (isGameOver) return;
// Update all falling items
for (var i = fallingItems.length - 1; i >= 0; i--) {
var item = fallingItems[i];
// Check if item has fallen off screen
if (item.lastY < SCREEN_HEIGHT && item.y >= SCREEN_HEIGHT) {
if (item.type === "banana" && item.active) {
// Missed a banana - lose a life
decreaseLife();
item.remove();
} else if (item.type === "bomb" && item.active) {
// Bomb fell off screen - remove it with no penalty
item.destroy();
fallingItems.splice(i, 1);
}
}
// Remove destroyed items from array
if (!item.active || item.alpha <= 0) {
fallingItems.splice(i, 1);
}
}
// Spawn new items at intervals
spawnCounter++;
if (spawnCounter >= currentSpawnInterval) {
spawnItem();
spawnCounter = 0;
// Increase difficulty based on score thresholds
var score = LK.getScore();
// Set speed multiplier based on score thresholds
var speedMultiplier = 1;
if (score >= 150) {
speedMultiplier = 13;
} else if (score >= 140) {
speedMultiplier = 12;
} else if (score >= 130) {
speedMultiplier = 11;
} else if (score >= 120) {
speedMultiplier = 10.5;
} else if (score >= 110) {
speedMultiplier = 10;
} else if (score >= 100) {
speedMultiplier = 9.5;
} else if (score >= 90) {
speedMultiplier = 9;
} else if (score >= 80) {
speedMultiplier = 8.5;
} else if (score >= 70) {
speedMultiplier = 8;
} else if (score >= 60) {
speedMultiplier = 7.5;
} else if (score >= 50) {
speedMultiplier = 7;
} else if (score >= 40) {
speedMultiplier = 6.5;
} else if (score >= 30) {
speedMultiplier = 6;
} else if (score >= 20) {
speedMultiplier = 5;
} else if (score >= 10) {
speedMultiplier = 3;
} else if (score >= 5) {
speedMultiplier = 2;
}
currentSpeed = 2 * speedMultiplier;
currentSpawnInterval = Math.max(MIN_SPAWN_INTERVAL, SPAWN_INTERVAL_INITIAL - score * INTERVAL_DECREMENT);
}
// Update score text
scoreText.setText('Score: ' + LK.getScore());
};
// Initialize the game
function initGame() {
// Reset game variables
lives = MAX_LIVES;
LK.setScore(0);
spawnCounter = 0;
currentSpawnInterval = SPAWN_INTERVAL_INITIAL;
currentSpeed = 2;
isGameOver = false;
fallingItems = [];
// Initialize UI
initLives();
scoreText.setText('Score: 0');
// Play background music
LK.playMusic('gameMusic');
}
// Start the game
initGame(); ===================================================================
--- original.js
+++ change.js
@@ -204,9 +204,23 @@
// Increase difficulty based on score thresholds
var score = LK.getScore();
// Set speed multiplier based on score thresholds
var speedMultiplier = 1;
- if (score >= 80) {
+ if (score >= 150) {
+ speedMultiplier = 13;
+ } else if (score >= 140) {
+ speedMultiplier = 12;
+ } else if (score >= 130) {
+ speedMultiplier = 11;
+ } else if (score >= 120) {
+ speedMultiplier = 10.5;
+ } else if (score >= 110) {
+ speedMultiplier = 10;
+ } else if (score >= 100) {
+ speedMultiplier = 9.5;
+ } else if (score >= 90) {
+ speedMultiplier = 9;
+ } else if (score >= 80) {
speedMultiplier = 8.5;
} else if (score >= 70) {
speedMultiplier = 8;
} else if (score >= 60) {
Pixel banana. In-Game asset. High contrast. No shadows
Pixel art Bomb.. In-Game asset. High contrast. No shadows
Pixel art Heart. In-Game asset. High contrast. No shadows
Pixel art Forest background. In-Game asset. High contrast. No shadows
Purple color "+1" in pixels art style . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
Simple empty clean pixel art background in brown. In-Game asset. 2d. High contrast. No shadows. Game menu background.
Menu button. Pixel art dark brown.. In-Game asset. 2d. High contrast. No shadows No writing inside