Code edit (3 edits merged)
Please save this source code
User prompt
первый obstacle создается с делеем 3 секунды
Code edit (2 edits merged)
Please save this source code
User prompt
(LK.ticks % 300 === 0) уменьшается на 50 каждые 10 секунд
Code edit (9 edits merged)
Please save this source code
User prompt
obstacle создаются рандомно раз в 200
Code edit (1 edits merged)
Please save this source code
User prompt
Создавать один рандомный obstacle каждые 300
User prompt
Из массива obstacle сделать рандомное создание одного из obstacle, но оставить всем obstacle свое положение (не объединять в одно место)
User prompt
Создавать каждые 300 одного из obstacle
User prompt
Из массива obstacle сделать рандомное создание одного из obstacle
User prompt
Please fix the bug: 'ReferenceError: Can't find variable: obstacle1' in or related to this line: 'if (child === obstacle1 && player.intersects(obstacle1) || child === obstacle2 && player.intersects(obstacle2) || child === obstacle3 && player.intersects(obstacle3) || child === obstacle4 && player.intersects(obstacle4) || child === obstacle5 && player.intersects(obstacle5) || child === obstacle6 && player.intersects(obstacle6) || child === obstacle7 && player.intersects(obstacle7) || child === obstacle8 && player.intersects(obstacle8) || child === obstacle9 && player.intersects(obstacle9)) {' Line Number: 599
User prompt
добавить все obstacle в один массив
User prompt
не работают столкновения с obstacle, исправь
User prompt
Please fix the bug: 'ReferenceError: Can't find variable: obstacle1' in or related to this line: 'if (child === obstacle1 && player.intersects(obstacle1) || child === obstacle2 && player.intersects(obstacle2) || child === obstacle3 && player.intersects(obstacle3) || child === obstacle4 && player.intersects(obstacle4) || child === obstacle5 && player.intersects(obstacle5) || child === obstacle6 && player.intersects(obstacle6) || child === obstacle7 && player.intersects(obstacle7) || child === obstacle8 && player.intersects(obstacle8) || child === obstacle9 && player.intersects(obstacle9)) {' Line Number: 630
User prompt
каждый obstacle создается поочереди в рандомном порядке, начальное положение каждого obstacle не изменяется
User prompt
можешь исправить?
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: obstacle9 is not defined' in or related to this line: 'if (child === obstacle1 && player.intersects(obstacle1) || child === obstacle2 && player.intersects(obstacle2) || child === obstacle3 && player.intersects(obstacle3) || child === obstacle4 && player.intersects(obstacle4) || child === obstacle5 && player.intersects(obstacle5) || child === obstacle6 && player.intersects(obstacle6) || child === obstacle7 && player.intersects(obstacle7) || child === obstacle8 && player.intersects(obstacle8) || child === obstacle9 && player.intersects(obstacle9)) {' Line Number: 741
User prompt
obstacle9 создается каждые 9000 дистанции
User prompt
Please fix the bug: 'ReferenceError: obstacle1 is not defined' in or related to this line: 'if (child === obstacle1 && player.intersects(obstacle1) || child === obstacle2 && player.intersects(obstacle2) || child === obstacle3 && player.intersects(obstacle3) || child === obstacle4 && player.intersects(obstacle4) || child === obstacle5 && player.intersects(obstacle5) || child === obstacle6 && player.intersects(obstacle6) || child === obstacle7 && player.intersects(obstacle7) || child === obstacle8 && player.intersects(obstacle8) || child === obstacle9 && player.intersects(obstacle9)) {' Line Number: 592
User prompt
obstacle1,obstacle2,obstacle3,obstacle4,obstacle5,obstacle6,obstacle7,obstacle8,obstacle9 создаются в случайной очередности с дистанцией между ними 3000
Code edit (2 edits merged)
Please save this source code
User prompt
добавить obstacle9 аналогично obstacle8
User prompt
Добавить obstacle8 аналогично obstacle7
===================================================================
--- original.js
+++ change.js
@@ -167,8 +167,14 @@
/****
* Game Code
****/
var obstacles = [];
+var obstacleInterval = 300; // Initial interval for obstacle creation
+var intervalDecreaseTimer = LK.setInterval(function () {
+ if (obstacleInterval > 50) {
+ obstacleInterval -= 50; // Decrease interval by 50 every 10 seconds
+ }
+}, 10000);
function createObstacle(assetId, x, y, rotation) {
var obstacle = game.addChild(LK.getAsset(assetId, {
anchorX: 0.5,
anchorY: 0.5
@@ -600,9 +606,9 @@
// Update lastY and lastX for player
player.lastY = player.y;
player.lastX = player.x;
// Create a random obstacle every 200 ticks
- if (LK.ticks % 300 === 0) {
+ if (LK.ticks % obstacleInterval === 0) {
createRandomObstacle();
}
game.children.forEach(function (child) {
if (child !== player && child !== buttonTop && child !== buttonBot) {
@@ -611,12 +617,10 @@
LK.setScore(LK.getScore() + 1); // Increase score by 1
scoreText.setText(LK.getScore().toString()); // Update score display
return;
}
- if (obstacles.includes(child) && player.intersects(child)) {
- LK.showGameOver(); // Trigger game over when player collides with any obstacle
- return;
- }
+ //if (obstacles.includes(child) && player.intersects(child)) {
+ //LK.showGameOver(); // Trigger game over when player collides with any obstacle
// Removed code related to undefined prepImages and prepFImages variables
if (child.lastWasIntersecting === undefined) {
child.lastWasIntersecting = false;
}
создать мультяшного сидячего персонажа. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
snowball. 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
Алмаз, мультяшный. 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
Ufo (летающая тарелка). Мультяшная. 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
Мультяшный рыбак зимой сидит рыбачит. 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
Куст в снегу мультяшный. 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
Рука белая. Иконка. 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
снежинка. мультяшная. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
text: New Record! Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows