Code edit (17 edits merged)
Please save this source code
User prompt
the platform should scroll down slowly at start and increasing the speed progressivly
Code edit (2 edits merged)
Please save this source code
User prompt
the platform should scroll down slowly
Code edit (1 edits merged)
Please save this source code
User prompt
the platform scroll down should not be instant but smooth
Code edit (8 edits merged)
Please save this source code
User prompt
when a platform goes to the bottom of the screen, it's moved to the top of the screen at a new random X position and new width.
User prompt
when the player land on a platform, all platform should scroll down of the gap distance
Code edit (9 edits merged)
Please save this source code
User prompt
the platform should be placed randomly on screen from bottom to top, with a small gap between them
Code edit (1 edits merged)
Please save this source code
User prompt
the player should not pass trough platform
User prompt
the platform should have a random width, from 10% to 50% of the width.
User prompt
the player should jump from a platform to another one
User prompt
the player should jump higher
User prompt
the player should follow the X mouse position
User prompt
the platform should be placed randomly on screen
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'push')' in or related to this line: 'obstacles.push(game.addChild(platform));' Line Number: 68
User prompt
the platform should be static and all present at the begining
Initial prompt
Jump to Climb
===================================================================
--- original.js
+++ change.js
@@ -37,12 +37,11 @@
};
});
var Obstacle = Container.expand(function () {
var self = Container.call(this);
- self.speedY = 1;
+ self.speedY = platformSpeed;
self.update = function () {
self.y += self.speedY;
- self.speedY += 0.01;
};
var obstacleGraphics = self.attachAsset('obstacle', {
anchorX: 0.5,
anchorY: 0.5
@@ -65,8 +64,9 @@
hero.x = pos.x;
});
var obstacles = [];
var gap = 400;
+var platformSpeed = 1;
for (var i = 0; i < 10; i++) {
var platform = new Obstacle();
platform.width = (Math.random() * (0.3 - 0.1) + 0.1) * 2048;
platform.x = Math.random() * (2048 - platform.width);
@@ -81,8 +81,9 @@
hero.jump();
});
LK.on('tick', function () {
hero.update();
+ platformSpeed += 0.01;
// Game tick
for (var i = 0; i < obstacles.length; i++) {
obstacles[i].update();
}
@@ -90,8 +91,8 @@
if (obstacles[i].y > 2732) {
obstacles[i].y = 0;
obstacles[i].x = Math.random() * (2048 - obstacles[i].width);
obstacles[i].width = (Math.random() * (0.3 - 0.1) + 0.1) * 2048;
- obstacles[i].speedY = 1;
+ obstacles[i].speedY = platformSpeed;
}
}
});
\ No newline at end of file
a little squirrel with sun glasses and earring. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d flat leaf green horizontal platform. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
acorn. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.