Code edit (1 edits merged)
Please save this source code
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
@@ -92,8 +92,44 @@
self.addChild(powerup);
obstacles.push(powerup);
};
});
+var Particle = Container.expand(function () {
+ var self = Container.call(this);
+ var particleGraphics = self.attachAsset('particle', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 8;
+ self.dead = false;
+ particleGraphics.blendMode = 1;
+ self.alpha = 0.75;
+ self.update = function () {
+ self.y += self.speed;
+ self.alpha -= 0.0167;
+ if (self.alpha <= 0) {
+ self.alpha = 0.75;
+ self.y = player.y + player.height / 2 + (Math.random() * 50 - 25);
+ self.x = player.x + (Math.random() * 50 - 25);
+ }
+ };
+});
+/*
+var rainbowColors = [0xFF0000,
+// Red
+0xFF7F00,
+// Orange
+0xFFFF00,
+// Yellow
+0x00FF00,
+// Green
+0x0000FF,
+// Blue
+0x4B0082,
+// Indigo
+0x8B00FF // Violet
+];*/
+// Initialize player
/****
TODO:
* Maybe player should change orbit direction (and/or speed) with the orbit he jumps into?
* Make sure orbits don't have too many obstacles.
@@ -124,9 +160,9 @@
self.radius = 0; // Fallback radius if targetOrbit is not defined
}
self.x = 2048 / 2 + self.radius * Math.cos(self.angle);
self.y = 2732 / 2 + self.radius * Math.sin(self.angle);
- game.setBackgroundColor(rainbowColors[currentOrbitIndex % rainbowColors.length]);
+ game.setBackgroundColor(rainbowColors[(orbitsCreated + 4) % rainbowColors.length]);
//self.scale.x = 0.70;
//self.scale.y = 0.70;
self.width = 70;
self.height = self.width;
@@ -173,9 +209,9 @@
/****
* Initialize Game
****/
var game = new LK.Game({
- backgroundColor: 0x000000 // Init game with black background
+ backgroundColor: 0x444488 // Init game with black background
});
/****
* Game Code
@@ -232,18 +268,20 @@
var showPowerupText = function showPowerupText() {
powerupText = new Text2('Powerup Activated!\nAll visible obstacles cleared!\nTap to continue', {
size: 100,
fill: "#bbbbbb",
- align: 'center'
+ align: 'center',
+ stroke: "#000000",
+ strokeThickness: 10
});
powerupText.y = 2700 / 2;
powerupText.x = 2048 / 2;
powerupText.anchor.set(0.5, 0.5);
//instructionText.x = 2048 / 2; // Center horizontally
//instructionText.y = 2732 - instructionText.height / 2; // Position at the bottom
game.addChild(powerupText);
LK.setTimeout(function () {
- var fadeDuration = 3000;
+ var fadeDuration = 4000;
var fadeStep = 30;
var fadeInterval = fadeDuration / fadeStep;
var currentStep = 0;
var fadeOutInterval = LK.setInterval(function () {
@@ -293,13 +331,15 @@
// Blue
0x4B0082,
// Indigo
0x8B00FF // Violet
-];*/
+];*/
// Initialize player
var scoreTxt = new Text2('0', {
size: 150,
- fill: "#ffffff"
+ fill: "#ffffff",
+ stroke: "#000000",
+ strokeThickness: 20
});
LK.gui.top.addChild(scoreTxt);
// Initialize orbits
function createOrbits() {
@@ -323,8 +363,20 @@
//instructionText.y = 2732 - instructionText.height / 2; // Position at the bottom
LK.gui.top.addChild(instructionText);
//game.setBackgroundColor(rainbowColors[7] + 0xdddddd);
player = game.addChild(new Player());
+var particleContainer = new Container();
+game.addChild(particleContainer);
+// Initialize particles array
+var particles = [];
+// Create particles
+for (var i = 0; i < 20; i++) {
+ var particle = new Particle();
+ particle.x = player.x;
+ particle.y = player.y + player.height / 2;
+ particleContainer.addChild(particle);
+ particles.push(particle);
+}
//player.x = 2048 / 2;
//player.y = 2732 / 2 - 200; // Start the player 200px above the center
/*
console.log('Player radius is now: ' + player.radius);
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.