User prompt
Create a new BlockBreakParticle class which duplicates all the logic in the BlockSparkParticle, however instead of a shapeBox assets, randomize between the blockX1-4 assets
Code edit (1 edits merged)
Please save this source code
User prompt
Replace the: "game.addChild(LK.getAsset('shapeBox', { width: game.width, height: LIGHT_LEVEL, tint: 0x000000 }));" with a black tinted glow class instance with 5 layers, a 10 rangeX, and maintaining the 0,0 anchor
User prompt
re-revert the lockSymbol to a basic asset and tint it 0xFF4D00
Code edit (2 edits merged)
Please save this source code
User prompt
when completing the fadeout of the locksymbol, destroy it and reset the lockSymbol variable
Code edit (1 edits merged)
Please save this source code
User prompt
go back to using a bordersymbol for the lockSymbol
User prompt
reduce the scalex and scaley of the locksymbol by the inverse of the self.scalex and y
User prompt
Replace the lockSymbol BorderedSymbol class with simple asset of the same id
Code edit (1 edits merged)
Please save this source code
User prompt
rotate the lockSymbol to the opposite of self.rotation
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: lockSymbol is not defined' in or related to this line: 'tween(lockSymbol, {' Line Number: 930
User prompt
Before creating a new lockSymbol, check if one exists and destroy it
Code edit (1 edits merged)
Please save this source code
User prompt
In the rotate function for blockblank, lastly, attach a new BorderedSymbol with an iconLock asset. After a 500ms delay this should fade out over 500ms ↪💡 Consider importing and using the following plugins: @upit/tween.v1, @upit/tween.v1
User prompt
when clicking on a blockblank and it's not cracked, attach a new BorderedSymbol with an iconLock asset. After a 500ms delay this should fade out over 500ms ↪💡 Consider importing and using the following plugins: @upit/tween.v1, @upit/tween.v1
User prompt
randomize the BlockSparkParticle shapeBox rotation between 0 and pi
Code edit (1 edits merged)
Please save this source code
User prompt
BlockSparkParticles should also be randomly offset from their origin between 0 and 50 distance along their angle
User prompt
BlockSparkParticles should also be randomly offset from their origin between 0 and 50 distance along their angle
Code edit (1 edits merged)
Please save this source code
User prompt
BlockSparkParticles should be affected by a tiny bit of gravity and also have a 0.5 alpha instead of 0.25
Code edit (6 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -509,8 +509,43 @@
}
});
return self;
});
+var BlockBreakParticle = ConfigContainer.expand(function (config) {
+ var self = ConfigContainer.call(this, config);
+ var blockAssets = ['blockX1', 'blockX2', 'blockX3', 'blockX4'];
+ var randomAsset = blockAssets[Math.floor(Math.random() * blockAssets.length)];
+ var shapeBox = self.attachAsset(randomAsset, {
+ width: 10,
+ height: 10,
+ anchorX: 0.5,
+ anchorY: 0.5,
+ rotation: Math.random() * Math.PI // Random rotation between 0 and pi
+ });
+ // Set initial random direction and speed
+ var angle = Math.random() * 2 * Math.PI;
+ var offset = Math.random() * 50; // Random offset between 0 and 50
+ self.x += Math.cos(angle) * offset;
+ self.y += Math.sin(angle) * offset;
+ self.vx = Math.cos(angle) * 10;
+ self.vy = Math.sin(angle) * 10;
+ // Update function to move the particle
+ self.update = function () {
+ self.vy += 0.5; // Apply gravity effect
+ self.x += self.vx;
+ self.y += self.vy;
+ };
+ // Tween to fade out the particle
+ tween(self, {
+ alpha: 0
+ }, {
+ duration: 350,
+ onFinish: function onFinish() {
+ self.callDestroy();
+ }
+ });
+ return self;
+});
var Block = ConfigContainer.expand(function (config) {
var self = ConfigContainer.call(this, config);
self.isRotating = false;
self.disabled = config.disabled;
@@ -985,9 +1020,9 @@
var lightManager = game.addChild(new Container());
game.addChild(new Glow({
width: game.width,
height: LIGHT_LEVEL,
- rangeY: 10,
+ rangeY: 20,
layers: 5,
solid: true
}));
var blockManager = game.addChild(new BlockManager());