Code edit (1 edits merged)
Please save this source code
User prompt
добавь эффект звезд между орбитами
User prompt
добавь на задний фон эффект звезд летящих в экран
User prompt
добавь разнообразные объекты на орбиты
User prompt
исправь отображение орбит
User prompt
сделай - игрок всегда смотрит в центр экрана
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading '0')' in or related to this line: 'var newOrbitRadius = orbitRadii[0];' Line Number: 34
User prompt
сделай "из центра с каждым прыжком появляется новая орбита сдвигая предыдущую наружу"
User prompt
after a player jump, the player should then continue circling at that orbit's distance from center.
User prompt
make sure player stays on topmost zindex after each new orbit is created.
User prompt
добавь: после прыжка орбита становиться на место предыдущей
User prompt
добавь: After the ship jumps to the next orbit, the orbit it was previously on becomes the position for the next orbit in the sequence. This means that the orbits are effectively rotating or shifting positions each time the ship makes a jump. The orbit that the ship jumps to takes the place of the orbit it just left, maintaining a consistent pattern of orbits for the ship to jump to. This creates a cyclical movement pattern where each orbit becomes the next one in the sequence after the ship jumps.
User prompt
измени очередность орбит
User prompt
добавь механику: after a player jump, the player should then continue circling at that orbit's distance from center.
User prompt
добавь механику: при нажатии на экран игрок перепрыгивает на следующую орбиту
User prompt
On tap, make player jump to the next orbit.
User prompt
Fix Bug: 'Uncaught TypeError: LK.Shape is not a constructor' in or related to this line: 'var orbitGraphics = new LK.Shape('ellipse', {' Line Number: 37
User prompt
Fix Bug: 'Uncaught TypeError: LK.Shape is not a constructor' in or related to this line: 'var orbitGraphics = new LK.Shape('ellipse', {' Line Number: 37
User prompt
добавь условные орбиты. орбиты появляются из центра. временно обозначь орбиты в виде окружностей.
User prompt
сделай игрок всегда смотрит в центр
User prompt
сделай игрок всегда двигается по кругу
User prompt
добавь игрока. игрок это корабль. постоянно движется по кругу радиусом 800 пикселей
User prompt
удали весь код
User prompt
уменьши радиус полета коробля
===================================================================
--- original.js
+++ change.js
@@ -65,21 +65,33 @@
var obstacleGraphics = self.attachAsset('obstacle', {
anchorX: 0.5,
anchorY: 0.5
});
- //self.angleSpeed = 0.01;
self.orbitSpeed = -0.01;
self.move = function () {
- // Obstacle move logic
- //var angleSpeed = -0.01 * self.parent.direction; //self.orbitSpeed;
- //self.radius = self.parent.width / 2 - self.width / 2;
self.radius = self.parent.width / 2 * (1900 / self.parent.width) - self.width / 2 * (100 / self.width);
self.angle = (self.angle || 0) + self.orbitSpeed;
self.angle %= Math.PI * 2;
self.x = self.radius * Math.cos(self.angle);
self.y = self.radius * Math.sin(self.angle);
};
});
+// New Obstacle Type class
+var ObstacleTypeB = Container.expand(function () {
+ var self = Container.call(this);
+ var obstacleGraphics = self.attachAsset('obstacleTypeB', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.orbitSpeed = 0.015;
+ self.move = function () {
+ self.radius = self.parent.width / 2 * (1900 / self.parent.width) - self.width / 2 * (100 / self.width);
+ self.angle = (self.angle || 0) + self.orbitSpeed;
+ self.angle %= Math.PI * 2;
+ self.x = self.radius * Math.cos(self.angle);
+ self.y = self.radius * Math.sin(self.angle);
+ };
+});
// Powerup class
var Powerup1 = Container.expand(function () {
var self = Container.call(this);
var powerup1Graphics = self.attachAsset('powerup1', {
@@ -138,18 +150,16 @@
//orbitGraphicsMask.alpha = 0.1;
orbitGraphicsMask.width = self.width - 200;
orbitGraphicsMask.height = self.height - 200;
self.addBarrier = function (speed, index) {
- var barrier = new Obstacle();
+ var barrier;
+ if (Math.random() < 0.5) {
+ barrier = new Obstacle();
+ } else {
+ barrier = new ObstacleTypeB();
+ }
barrier.orbitSpeed = speed;
- //barrier.angle = index * (Math.PI * 2 / 20);
barrier.angle = Math.random() * (Math.PI * 2);
- /*
- barrier.move = function () {
- barrier.angle += barrier.orbitSpeed * (self.direction === 1 ? 1 : -1);
- barrier.x = self.x + (self.width - barrier.width) / 2 * Math.cos(barrier.angle);
- barrier.y = self.y + (self.height - barrier.height) / 2 * Math.sin(barrier.angle);
- };*/
self.addChild(barrier);
obstacles.push(barrier);
};
self.addPowerup = function (index) {
астероид. 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.