Code edit (7 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: 626
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (11 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: collectible is not a constructor' in or related to this line: 'var collectible = new collectible();' Line Number: 130
Code edit (1 edits merged)
Please save this source code
Code edit (13 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: scoreText is not defined' in or related to this line: 'scoreText.x -= 20;' Line Number: 384
Code edit (1 edits merged)
Please save this source code
Code edit (5 edits merged)
Please save this source code
User prompt
make a fullscreen background asset and attach it before anything else
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (17 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: particles is not defined' in or related to this line: 'particles.push(particle);' Line Number: 386
Code edit (1 edits merged)
Please save this source code
User prompt
with each jump, set the background color of the game to a new color from the rainbowcolors,
Code edit (1 edits merged)
Please save this source code
User prompt
Migrate to the latest version of LK
Remix started
Copy Orbit Jump
===================================================================
--- original.js
+++ change.js
@@ -1,7 +1,15 @@
/****
* Classes
****/
+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;
+});
// Obstacle class
var Obstacle = Container.expand(function () {
var self = Container.call(this);
var obstacleGraphics = self.attachAsset('obstacle', {
@@ -64,8 +72,9 @@
for (var j = 0; j < this.numBarriers; j++) {
self.addBarrier(self.barrierSpeed, j);
//console.log('adding barrier: ', j);
}
+ self.addCollectible();
}
};
/*
var orbitGraphicsMask = self.attachAsset('blackSphere', {
@@ -102,8 +111,15 @@
self.addChild(powerup);
obstacles.push(powerup);
}
};
+ self.addCollectible = function () {
+ var collectible = new Collectible();
+ collectible.orbitSpeed = 0.01 + Math.random() * 0.015 * self.direction;
+ collectible.angle = Math.random() * (Math.PI * 2);
+ self.addChild(collectible);
+ obstacles.push(collectible);
+ };
});
var Particle = Container.expand(function (i) {
var self = Container.call(this);
var particleGraphics = self.attachAsset('particle', {
@@ -136,15 +152,17 @@
});
// Initialize player
/****
TODO:
+* 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.
+* 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?
-*
-* Maybe player should change orbit direction (and/or speed) with the orbit he jumps into?
+* 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).
@@ -336,23 +354,8 @@
}
return colors;
}();
var powerup1Activated = false;
-/*
-var rainbowColors = [0xFF0000,
-// Red
-0xFF7F00,
-// Orange
-0xFFFF00,
-// Yellow
-0x00FF00,
-// Green
-0x0000FF,
-// Blue
-0x4B0082,
-// Indigo
-0x8B00FF // Violet
-];*/
// Initialize player
var scoreText = new Text2('0', {
size: 150,
align: 'center',
@@ -409,21 +412,32 @@
console.log('Orbits.length is now: ' + orbits.length);
console.log('CurrentOrbitIndex is now: ' + currentOrbitIndex);
console.log('width of currentorbit is now: ' + orbits[currentOrbitIndex].width);
*/
+var stalling = false;
// Game logic
game.on('down', function (x, y, obj) {
+ 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 (stalling) {
+ stalling = false;
+ }
});
LK.on('tick', function () {
- player._update_migrated();
+ if (!stalling) {
+ player._update_migrated();
+ }
if (powerup1Activated) {
powerup1Activated = false;
for (var i = obstacles.length - 1; i > 0; i--) {
obstacles[i].destroy();
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.