User prompt
Добавить звук chainsaw после пересечения игрока и противника
User prompt
Добавить звук jump после нажатия на экран
User prompt
Migrate to the latest version of LK
Code edit (1 edits merged)
Please save this source code
User prompt
сохранять очки, которые игрок заработал и отображать в overlay
User prompt
удалить gameOverScoreTxt
User prompt
исправить ошибку, когда таймер не идет
User prompt
добавить количество набранных очков в overlay
User prompt
удалить счетчик очков в центре экрана
User prompt
after 60 point Create a new obstacle every 18 ticks
User prompt
after 15 point Create a new obstacle every 18 ticks
Code edit (5 edits merged)
Please save this source code
User prompt
При пересечении птицы и облака, на первом плане птица
User prompt
картинка облака не перекрывает картинку птицы
User prompt
облако не перекрывает птицу
User prompt
птица поверх облака
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -61,10 +61,9 @@
anchorY: 0.5,
x: 2048 / 2,
y: 2048 / 2
}));
-// Add bird to the game
-var bird = new Bird();
+var bird = game.addChild(new Bird());
bird.x = 350; // Start in the middle of the screen horizontally
bird.y = 1366; // Start in the middle of the screen vertically
// Add touch event listener to make bird move up and down smoothly
game.on('down', function (obj) {
@@ -81,9 +80,9 @@
LK.on('tick', function () {
bird.move();
// Create a new obstacle every 42 ticks (approximately 0.7 seconds)
obstacleCreationCounter++;
- if (score < 15 && obstacleCreationCounter >= 36 || score >= 15 && score < 40 && obstacleCreationCounter >= 30 || score >= 40 && score < 53 && obstacleCreationCounter >= 24 || score >= 53 && obstacleCreationCounter >= 24) {
+ if (score < 15 && obstacleCreationCounter >= 36 || score >= 15 && score < 30 && obstacleCreationCounter >= 30 || score >= 30 && score < 45 && obstacleCreationCounter >= 24 || score >= 45 && obstacleCreationCounter >= 24) {
var newObstacle = game.addChild(new Obstacle());
newObstacle.x = 2048; // Start at the right edge of the screen
newObstacle.y = Math.random() * 2732; // Start at a random height
// After 10 points, randomly change obstacle speed between -4 and -9
@@ -125,12 +124,8 @@
game.addChild(gameOverScoreTxt);
LK.showGameOver();
}
}
- // Update the position of all clouds
- for (var i = 0; i < clouds.length; i++) {
- clouds[i].x += clouds[i].speedX;
- }
// Check if bird has fallen off the screen or risen above the screen
var dx = bird.x - 2048 / 2;
var dy = bird.y - 2670 / 2;
var distance = Math.sqrt(dx * dx + dy * dy);
@@ -155,38 +150,8 @@
// Brown obstacles;
var obstacle = game.addChild(new Obstacle());
obstacle.x = 2120; // Start at the right edge of the screen
obstacle.y = Math.random() * 2732; // Start at a random height;
-// Create an array to store additional clouds
-var clouds = [];
-// Add the first cloud after 1 second
-LK.setTimeout(function () {
- var cloud = game.addChild(LK.getAsset('cloud', {
- anchorX: 0.5,
- anchorY: 0.5,
- x: 2300,
- y: Math.random() * (2732 / 3),
- scaleX: 2,
- scaleY: 2
- }));
- cloud.speedX = -2;
- clouds.push(cloud);
-}, 1000);
-// Add subsequent clouds every 10 seconds
-LK.setInterval(function () {
- var cloud = game.addChild(LK.getAsset('cloud', {
- anchorX: 0.5,
- anchorY: 0.5,
- x: 2230,
- y: Math.random() * (2732 / 3),
- scaleX: 2,
- scaleY: 2
- }));
- cloud.speedX = -2;
- clouds.push(cloud);
-}, 10000);
-// Add bird to the game after adding the cloud
-game.addChild(bird);
// Initialize score counter
var score = 0;
var scoreTxt = new Text2(score.toString(), {
size: 100,
@@ -197,6 +162,5 @@
// Update score every 2 seconds
LK.setInterval(function () {
score++;
scoreTxt.setText(score.toString());
-}, 1300);
-;
\ No newline at end of file
+}, 1300);
\ No newline at end of file
голубое небо, горизонт и зеленое поле. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Мультяшный квадратный сюрикен. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
button leaderboards. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.