User prompt
Please fix the bug: 'storage is not defined' in or related to this line: 'storage.bestScore = storage.bestScore || 0;' Line Number: 953 ↪💡 Consider importing and using the following plugins: @upit/storage.v1
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: 'Uncaught TypeError: LK.getMusic is not a function' in or related to this line: 'var bgMusic = LK.getMusic('BackgroundMusic');' Line Number: 1018
Code edit (4 edits merged)
Please save this source code
User prompt
when the game starts, start the backgroundmusic
Code edit (1 edits merged)
Please save this source code
Code edit (10 edits merged)
Please save this source code
User prompt
on first tap, start backgroundmusic
Code edit (12 edits merged)
Please save this source code
User prompt
in ObstacleExploding._move_migrated please update rotation, so that it's always facing centerx,centery
Code edit (1 edits merged)
Please save this source code
Code edit (12 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: game.add is not a function' in or related to this line: 'game.add(self.parent);' Line Number: 301
Code edit (8 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: trailgraphics is not defined' in or related to this line: 'trailgraphics.tint = 0xff0000;' Line Number: 138
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: particles.destroy is not a function' in or related to this line: 'particles.destroy();' Line Number: 1101
Code edit (3 edits merged)
Please save this source code
User prompt
explosiontrails should explode in a circular pattern
Code edit (2 edits merged)
Please save this source code
User prompt
Instead of just flashing the screen on player death, make the fireball it is explode in a bunch of fading trails like fireworks
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -1,15 +1,13 @@
/****
* Classes
****/
/****
-/****
TODO:
-* Stop the player glow after death - maybe replace with some other effect- like explosion.
-* Make turretshots lethal.(Or rework them
+* Prøv at lave en exploding enemy.
+* Make turretshots lethal. (Or rework them - not good for gameplay now).
* Try to think up a few more enemy types. Might need to slow difficulty progression down a bit to introduce them.
* What if holding mouse down didn't just stall movement, but move player the other way?
-* Update the instructions to explain the new hold to stall mechanic.
* Maybe give player 3 lives.
* Sound & Music.
* Would also be cool to be able to jump in AND out of orbits, but hard to implement. Or maybe just tap on the orbit to go to?
****/
@@ -121,10 +119,10 @@
self.alpha = 1;
self.update = function () {
self.x += self.speedX;
self.y += self.speedY;
- self.scale.x -= 0.01;
- self.scale.y -= 0.01;
+ self.scale.x -= 0.015;
+ self.scale.y -= 0.015;
//self.alpha -= 0.01;
//if (self.alpha <= 0) {
if (self.scale.x <= 0) {
self.destroy();
@@ -228,8 +226,49 @@
}
}
};
});
+var ObstacleExploding = Container.expand(function () {
+ var self = Container.call(this);
+ self.obstacleGraphics = self.attachAsset('obstacleExploding', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.orbitSpeed = 0; // This is set by the Orbit that instantiates this obstacle, so obstacles in same orbit have same speed.
+ self.rotatingRight = Math.random() < 0.5 ? true : false;
+ self.radius = 0;
+ self.initialPosition = function (speed, angle, radius) {
+ self.angle = angle;
+ self.orbitSpeed = speed;
+ self.radius = radius;
+ self.x = self.radius * Math.cos(self.angle);
+ self.y = self.radius * Math.sin(self.angle);
+ };
+ self._move_migrated = function () {
+ 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);
+ if (self.parent == orbits[currentOrbitIndex]) {
+ //todo: explode
+ for (var i = 0; i < 20; i++) {
+ var angle = i / 20 * Math.PI * 2;
+ var trail = new ExplosionTrail(self.x + Math.cos(angle) * 10, self.y + Math.sin(angle) * 10);
+ self.parent.addChild(trail);
+ }
+ self.destroy();
+ self._destroyed = true;
+ /*
+ self.scale.x += 0.04;
+ self.scale.y += 0.04;
+ if (self.scale.x > 3) {
+ self.destroy();
+ self._destroyed = true;
+ }
+ */
+ }
+ };
+});
var ObstacleSeeker = Container.expand(function () {
var self = Container.call(this);
self.obstacleGraphics = self.attachAsset('obstacleSeeker', {
anchorX: 0.5,
@@ -424,9 +463,9 @@
}
}
if (orbitsCreated > 20) {
// Static enemy possible
- if (Math.random() < 0.2) {
+ if (Math.random() < 0.33) {
self.addCollectible(1);
self.numBarriers = Math.ceil(Math.random() * maxEnemiesPerOrbit);
self.barrierSpeed = 0; // Setting speed to 0 makes the barrier the static type.
for (var i = 0; i < this.numBarriers; i++) {
@@ -438,9 +477,10 @@
// Default case, spawn X normal enemies
self.addCollectible(1);
self.numBarriers = Math.ceil(Math.random() * maxEnemiesPerOrbit);
for (var i = 0; i < this.numBarriers; i++) {
- self.addBarrier(self.barrierSpeed, i);
+ //self.addBarrier(self.barrierSpeed, i);
+ self.addObstacleExploding(self.barrierSpeed, i);
}
};
self.OBS_positionOrbit = function (i) {
self.x = 2048 / 2;
@@ -502,8 +542,16 @@
barrier.initialPosition(speed, angle, radius);
self.addChild(barrier);
obstacles.push(barrier);
};
+ self.addObstacleExploding = function (speed, index) {
+ var barrier = new ObstacleExploding();
+ var angle = Math.random() * (Math.PI * 2);
+ var radius = 880;
+ barrier.initialPosition(speed, angle, radius);
+ self.addChild(barrier);
+ obstacles.push(barrier);
+ };
self.addSeekerObstacle = function (speed, index) {
var seeker = new ObstacleSeeker();
var angle = Math.random() * (Math.PI * 2);
var radius = 880;
@@ -1078,10 +1126,10 @@
for (var i = particles.length - 1; i >= 0; i--) {
particles[i].destroy();
}
particles = [];
- for (var i = 0; i < 40; i++) {
- var angle = i / 40 * Math.PI * 2;
+ for (var i = 0; i < 30; i++) {
+ var angle = i / 30 * Math.PI * 2;
var trail = new ExplosionTrail(player.x + Math.cos(angle) * 10, player.y + Math.sin(angle) * 10);
game.addChild(trail);
}
var orbitsJumped = LK.getScore();
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.