Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Point is not a constructor' in or related to this line: 'var globalPlayerPosition = player.toGlobal(new Point(0, 0));' Line Number: 307
User prompt
please factor into the lookatplayer and shootatplayer functions, that they should work in the global scope, because player and the turretobstacle can be children of different containers.
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: speed is not defined' in or related to this line: 'turret.initialPosition(speed, angle, radius);' Line Number: 444
Code edit (1 edits merged)
Please save this source code
Code edit (20 edits merged)
Please save this source code
User prompt
please implement obstacleturrets shootatplayer method, so it sends turretshot in players direction
User prompt
please implement obstacleTurret's lookAtPlayer function, so it does what it says
Code edit (1 edits merged)
Please save this source code
Code edit (15 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'width')' in or related to this line: 'player.radius = orbits[currentOrbitIndex].width / 2 - 65;' Line Number: 783
Code edit (7 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'width')' in or related to this line: 'player.radius = orbits[currentOrbitIndex].width / 2 - 65;' Line Number: 767
Code edit (1 edits merged)
Please save this source code
Code edit (22 edits merged)
Please save this source code
User prompt
in the dragon move function, please adjust the segment's radius up and down to convey a wavelike, snakelike slithering movement of the whole dragons body.
Code edit (1 edits merged)
Please save this source code
Code edit (10 edits merged)
Please save this source code
User prompt
implement the obstacleseeker function determineDirection
Code edit (10 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'update')' in or related to this line: 'particles[i].update();' Line Number: 706
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -74,8 +74,16 @@
};
});
var GameOverScreen = Container.expand(function (orbitsJumped, energyCollected, finalScore) {
var self = Container.call(this);
+ var bgGraphics = self.attachAsset('gameoverBg', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ bgGraphics.width = 2048 - 400;
+ bgGraphics.height = 400;
+ bgGraphics.x = centerX;
+ bgGraphics.y = centerY;
var text = new Text2("Orbits jumped: ".concat(orbitsJumped, "\nEnergy Collected: ").concat(energyCollected, "\nFinal Score: (").concat(orbitsJumped, "+").concat(energyCollected, ") = ").concat(finalScore), {
size: 100,
fill: "#ffffff",
align: 'center',
@@ -532,156 +540,163 @@
maxEnemySpeed += 0.002;
playerSpeed += 0.002;
}
var stalling = false;
+var GAME_ENDED = false;
// Game logic
game.on('down', function (x, y, obj) {
- if (!stalling) {
- stalling = true;
+ if (!GAME_ENDED) {
+ if (!stalling) {
+ stalling = true;
+ }
}
});
game.on('up', function (x, y, obj) {
- if (powerupText) {
- game.removeChild(powerupText);
- powerupText = null;
- }
- if (!scaling) {
- player.jump(currentOrbitIndex);
- LK.gui.top.removeChild(instructionText);
- if (orbitsCreated % INCREASE_DIFFICULTY_EVERY_X_LEVELS == 0) {
- //maxEnemiesPerOrbit++;
- //maxEnemySpeed += 0.002;
- increaseDifficulty();
+ if (!GAME_ENDED) {
+ if (powerupText) {
+ game.removeChild(powerupText);
+ powerupText = null;
}
+ if (!scaling) {
+ player.jump(currentOrbitIndex);
+ LK.gui.top.removeChild(instructionText);
+ if (orbitsCreated % INCREASE_DIFFICULTY_EVERY_X_LEVELS == 0) {
+ //maxEnemiesPerOrbit++;
+ //maxEnemySpeed += 0.002;
+ increaseDifficulty();
+ }
+ }
+ if (stalling) {
+ stalling = false;
+ }
}
- if (stalling) {
- stalling = false;
- }
});
LK.on('tick', function () {
- if (!stalling) {
- player._update_migrated();
- }
- var t;
- if (powerup1Activated) {
- powerup1Activated = false;
- for (var i = obstacles.length - 1; i > 0; i--) {
- t = obstacles[i];
- if (t instanceof Collectible == false) {
- t.destroy();
- t._destroyed = true;
+ if (!GAME_ENDED) {
+ if (!stalling) {
+ player._update_migrated();
+ }
+ var t;
+ if (powerup1Activated) {
+ powerup1Activated = false;
+ for (var i = obstacles.length - 1; i > 0; i--) {
+ t = obstacles[i];
+ if (t instanceof Collectible == false) {
+ t.destroy();
+ t._destroyed = true;
+ }
}
}
- }
- if (scaling) {
- scalingCounter++;
- for (var i = 0; i < orbits.length; i++) {
- t = orbits[i];
- t.width += scalingSpeed;
- t.height += scalingSpeed;
- //player.radius += scalingSpeed * 0.1;
+ if (scaling) {
+ scalingCounter++;
+ for (var i = 0; i < orbits.length; i++) {
+ t = orbits[i];
+ t.width += scalingSpeed;
+ t.height += scalingSpeed;
+ //player.radius += scalingSpeed * 0.1;
+ }
+ //player.radius = orbits[currentOrbitIndex].width / 2 - 50;
+ player.radius = orbits[currentOrbitIndex].width / 2 - 65;
+ if (player.width < 100) {
+ player.width += 0.3;
+ player.height = player.width;
+ }
+ //player.scale.x = player.scale.y =
+ if (scalingCounter == scalingTarget / scalingSpeed) {
+ scaling = false;
+ scalingCounter = 0;
+ var orbit = game.addChild(new Orbit());
+ orbit.positionOrbit(4);
+ orbits.push(orbit);
+ //game.setChildIndex(player, game.children.length - 1);
+ game.setChildIndex(playerLayer, game.children.length - 1);
+ player.width = 100;
+ player.height = 100;
+ //game.setBackgroundColor(rainbowColors[(10 + currentOrbitIndex) % 15] + 0xdddddd);
+ /*
+ console.log('Player radius is now: ' + player.radius);
+ console.log('Orbits.length is now: ' + orbits.length);
+ console.log('CurrentOrbitIndex is now: ' + currentOrbitIndex);
+ console.log('width of currentorbit is now: ' + orbits[currentOrbitIndex].width);
+ */
+ }
}
- //player.radius = orbits[currentOrbitIndex].width / 2 - 50;
- player.radius = orbits[currentOrbitIndex].width / 2 - 65;
- if (player.width < 100) {
- player.width += 0.3;
- player.height = player.width;
- }
- //player.scale.x = player.scale.y =
- if (scalingCounter == scalingTarget / scalingSpeed) {
- scaling = false;
- scalingCounter = 0;
- var orbit = game.addChild(new Orbit());
- orbit.positionOrbit(4);
- orbits.push(orbit);
- //game.setChildIndex(player, game.children.length - 1);
- game.setChildIndex(playerLayer, game.children.length - 1);
- player.width = 100;
- player.height = 100;
- //game.setBackgroundColor(rainbowColors[(10 + currentOrbitIndex) % 15] + 0xdddddd);
- /*
- console.log('Player radius is now: ' + player.radius);
- console.log('Orbits.length is now: ' + orbits.length);
- console.log('CurrentOrbitIndex is now: ' + currentOrbitIndex);
- console.log('width of currentorbit is now: ' + orbits[currentOrbitIndex].width);
- */
- }
- }
- // Update orbits
- for (var i = orbits.length - 1; i > 0; i--) {
- //orbits[i].positionOrbit(i);
- var orb = orbits[i];
- //if (orb && orb.width > 2700) {
- if (orb && orb.width > 3500) {
- for (var j = 0; j < orb.children.length; j++) {
- t = orb.children[j];
- if (t instanceof Obstacle || t instanceof Powerup1) {
- // child is an instance of YourClass, do something with it
- t._destroyed = true;
+ // Update orbits
+ for (var i = orbits.length - 1; i > 0; i--) {
+ //orbits[i].positionOrbit(i);
+ var orb = orbits[i];
+ //if (orb && orb.width > 2700) {
+ if (orb && orb.width > 3500) {
+ for (var j = 0; j < orb.children.length; j++) {
+ t = orb.children[j];
+ if (t instanceof Obstacle || t instanceof Powerup1) {
+ // child is an instance of YourClass, do something with it
+ t._destroyed = true;
+ }
}
+ //orbits[i].destroy();
+ orb.destroy();
+ // Splice alters jump logic, so alter currentTargetOrbit too.
+ orbits.splice(i, 1);
+ currentOrbitIndex--;
}
- //orbits[i].destroy();
- orb.destroy();
- // Splice alters jump logic, so alter currentTargetOrbit too.
- orbits.splice(i, 1);
- currentOrbitIndex--;
}
- }
- // Update obstacles
- for (var i = obstacles.length - 1; i > 0; i--) {
- t = obstacles[i];
- //if (obstacles[i] && !obstacles[i]._destroyed) {
- if (t && !t._destroyed) {
- //obstacles[i]._move_migrated();
- t._move_migrated();
- //if (player.intersects(obstacles[i])) {
- //if (radIntersects(player, obstacles[i])) {
- if (radIntersects(player, t)) {
- //var t = obstacles[i];
- //console.log('collision occurred: (obstacle:', t.radius, t.angle % (Math.PI * 2), ') , (player: ', player.radius, player.angle % (Math.PI * 2));
- //var ta = (t.angle * (180 / Math.PI) + 180) % 360;
- //var pa = (player.angle * (180 / Math.PI) + 180) % 360;
- //console.log(ta, pa);
- //if (radIntersects(player, obstacles[i], 100)) {
- //if (obstacles[i] instanceof Powerup1) {
- if (t instanceof Powerup1) {
- //obstacles[i].destroy();
- t.destroy();
- //obstacles[i]._destroyed = true;
- t._destroyed = true;
- if (!powerup1Activated) {
- LK.effects.flashScreen(0xffffff, 1000);
- //LK.effects.flashScreen(rainbowColors[Math.floor(Math.random() * numColors)], 1000);
- powerup1Activated = true;
- showPowerupText();
+ // Update obstacles
+ for (var i = obstacles.length - 1; i > 0; i--) {
+ t = obstacles[i];
+ //if (obstacles[i] && !obstacles[i]._destroyed) {
+ if (t && !t._destroyed) {
+ //obstacles[i]._move_migrated();
+ t._move_migrated();
+ //if (player.intersects(obstacles[i])) {
+ //if (radIntersects(player, obstacles[i])) {
+ if (radIntersects(player, t)) {
+ //var t = obstacles[i];
+ //console.log('collision occurred: (obstacle:', t.radius, t.angle % (Math.PI * 2), ') , (player: ', player.radius, player.angle % (Math.PI * 2));
+ //var ta = (t.angle * (180 / Math.PI) + 180) % 360;
+ //var pa = (player.angle * (180 / Math.PI) + 180) % 360;
+ //console.log(ta, pa);
+ //if (radIntersects(player, obstacles[i], 100)) {
+ //if (obstacles[i] instanceof Powerup1) {
+ if (t instanceof Powerup1) {
+ //obstacles[i].destroy();
+ t.destroy();
+ //obstacles[i]._destroyed = true;
+ t._destroyed = true;
+ if (!powerup1Activated) {
+ LK.effects.flashScreen(0xffffff, 1000);
+ //LK.effects.flashScreen(rainbowColors[Math.floor(Math.random() * numColors)], 1000);
+ powerup1Activated = true;
+ showPowerupText();
+ }
+ } else if (t instanceof Collectible) {
+ t.destroy();
+ t._destroyed = true;
+ collectiblesCollected++;
+ var floatingText = new FloatingText("+1", player.x, player.y);
+ game.addChild(floatingText);
+ } else {
+ LK.effects.flashScreen(0xff0000, 1000);
+ var orbitsJumped = LK.getScore();
+ var energyCollected = collectiblesCollected;
+ var finalScore = orbitsJumped + energyCollected;
+ LK.setScore(finalScore);
+ var gameOverScreen = new GameOverScreen(orbitsJumped, energyCollected, finalScore);
+ game.addChild(gameOverScreen);
+ GAME_ENDED = true;
+ LK.setTimeout(function () {
+ LK.showGameOver(); //Calling this will destroy the 'Game' and reset entire game state.
+ }, 8000);
}
- } else if (t instanceof Collectible) {
- t.destroy();
- t._destroyed = true;
- collectiblesCollected++;
- var floatingText = new FloatingText("+1", player.x, player.y);
- game.addChild(floatingText);
- } else {
- LK.effects.flashScreen(0xff0000, 1000);
- var orbitsJumped = LK.getScore();
- var energyCollected = collectiblesCollected;
- var finalScore = orbitsJumped + energyCollected;
- LK.setScore(finalScore);
- var gameOverScreen = new GameOverScreen(orbitsJumped, energyCollected, finalScore);
- game.addChild(gameOverScreen);
- LK.on('tick', function () {});
- LK.setTimeout(function () {
- LK.showGameOver(); //Calling this will destroy the 'Game' and reset entire game state.
- }, 5000);
}
+ } else {
+ obstacles.splice(i, 1);
+ //console.log('obstacles.length is now: ' + obstacles.length);
}
- } else {
- obstacles.splice(i, 1);
- //console.log('obstacles.length is now: ' + obstacles.length);
}
- }
- if (PARTICLES_ON && particles.length > 0) {
- for (var i = particles.length - 1; i > 0; i++) {
- particles[i].update();
+ if (PARTICLES_ON && particles.length > 0) {
+ for (var i = particles.length - 1; i > 0; i++) {
+ particles[i].update();
+ }
}
}
});
\ No newline at end of file
Make the circle completely black on all pixels.
A white star. Flat vector art.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
The line-color should be white, and the circle a bit thinner.
a wonderful but not very dense starfield. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A glowing blue comic energy orb. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
I'd like a top down image of a super fine and thin white empty cicular band on a transparent background. It should be flatly white and with no other details, and of course perfectly round with blank space in the center. The band's width should be less than one percent of the width of the circle itself, as if a 1 cm band were laid out in a circle with a diameter of 100 cm. Single Game Texture. In-Game asset. 2d. Blank background.