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
User prompt
before gameover, show a screen for five seconds, with the text: "Orbits jumped: XX\nEnergy Collected: YY\nFinal Score: (XX+YY) = ZZ"
Code edit (15 edits merged)
Please save this source code
User prompt
when a collectible is collected, show a little textlabel with the text "+1" floating up from the point instead of flashing the screen blue.
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: 650
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of null (reading 'width')' in or related to this line: 'self.radius = self.parent.width / 2 * (1900 / self.parent.width) - self.width / 2; // * (100 / self.width);' Line Number: 59
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -1,19 +1,36 @@
/****
* Classes
****/
+/****
+TODO:
+* Make particle tail jump when player jumps.
+* Instead of flash blue on collectible pickup, show a +1 sign.
+* What if holding mouse down didn't just stall movement, but move player the other way?
+* Maybe rotate enemies a little bit every frame, back and forth, so that they seem more alive and less alike. (Looks a bit silly).
+* Update the instructions to explain the new hold to stall mechanic.
+* Maybe only allow hold for as long as collected energy from collectibels allows? Show a draining meter live when player holds.
+* I often accidently press play again on game over, so maybe make an extra screen before gameover is shown.
+* Collectibles and a shop (but a shop for what?) Lives?
+* Implement the seeker type enemy.
+* Figure out why stuff shows up in the center on start?
+* Sound & Music.
+* Maybe skip player and obstacle updating while scaling?
+* 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?
+****/
var Collectible = Container.expand(function (i) {
var self = Container.call(this);
var particleGraphics = self.attachAsset('energyPill', {
anchorX: 0.5,
anchorY: 0.5
});
self.orbitSpeed = 0; // set by the orbit that spawns it.
self.growing = Math.random() <= 0.5 ? true : false;
+ self.radius = 0;
self._move_migrated = function () {
- if (self.parent) {
+ /*if (self.parent) {
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);
@@ -43,11 +60,11 @@
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;
- if (self.parent) {
+ /*if (self.parent) {
self.radius = self.parent.width / 2 * (1900 / self.parent.width) - self.width / 2;
- }
+ }*/
self.radius = 0;
self._move_migrated = function () {
//self.radius = self.parent.width / 2 * (1900 / self.parent.width) - self.width / 2 * (100 / self.width);
//self.radius = self.parent.width / 2 * (1900 / self.parent.width) - self.width / 2; // * (100 / self.width);
@@ -157,8 +174,9 @@
// TODO: Maybe orbitspeed should always be 0 (or close to 0) for these collectibles, But they should pulse in place instead.
//collectible.orbitSpeed = 0.01 + Math.random() * 0.015 * self.direction;
collectible.orbitSpeed = 0.0005 * self.direction;
collectible.angle = Math.random() * (Math.PI * 2);
+ collectible.radius = 880;
self.addChild(collectible);
obstacles.push(collectible);
};
});
@@ -189,31 +207,15 @@
self.scale.y = 1;
self.y = player.y; // + Math.random() * player.height / 4; // + player.height / 2 + (Math.random() * 50 - 25);
self.x = player.x; // + Math.random() * player.width / 4; // + (Math.random() * 50 - 25);
}
+ } else {
+ self.x += 20 * Math.cos(player.angle);
+ self.y += 20 * Math.sin(player.angle);
}
};
});
// Initialize player
-/****
-TODO:
-* What if holding mouse down didn't just stall movement, but move player the other way?
-* Maybe rotate enemies a little bit every frame, back and forth, so that they seem more alive and less alike. (Looks a bit silly).
-* Update the instructions to explain the new hold to stall mechanic.
-* Maybe only allow hold for as long as collected energy from collectibels allows? Show a draining meter live when player holds.
-* I often accidently press play again on game over, so maybe make an extra screen before gameover is shown.
-* Collectibles and a shop (but a shop for what?) Lives?
-* Implement the seeker type enemy.
-* Slower movement at start, then it increases as game progresses.
-* Figure out why stuff shows up in the center on start?
-* Center items better on orbits, or get better orbit graphics (by manual upload perhaps?)
-* Sound & Music.
-* Make sure orbits don't have too many obstacles.
-* Maybe skip player and obstacle updating while scaling?
-* Current min and max speeds of obstacles should be closer to each other.
-* Rotate orbits with obstacles statically distributed on them instead of calculating obstacle positions (for performance).
-* 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?
-****/
// Player class
var Player = Container.expand(function () {
var self = Container.call(this);
var playerGraphics = self.attachAsset('player', {
@@ -288,9 +290,8 @@
/****
* Game Code
****/
-// Initialize player
/****
TODO:
* 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.
@@ -306,8 +307,9 @@
* Current min and max speeds of obstacles should be closer to each other.
* Rotate orbits with obstacles statically distributed on them instead of calculating obstacle positions (for performance).
* 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?
****/
+// Initialize player
var centerX = 2048 / 2;
var centerY = 2732 / 2;
var ENEMY_WOBBLE = false;
var PARTICLES_ON = true;
@@ -628,9 +630,9 @@
obstacles.splice(i, 1);
//console.log('obstacles.length is now: ' + obstacles.length);
}
}
- if (PARTICLES_ON) {
+ if (PARTICLES_ON && particles.length > 0) {
for (var i = particles.length - 1; i > 0; i++) {
particles[i].update();
}
}
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.