User prompt
Particles of word shoild have random colors but allt he particles of a word the same color amonst them
User prompt
Particles in word shoild have rabdom colors
User prompt
The color of the particles of the words should be random but all have tge same color
User prompt
But the prticles of the word should have the same cllor
User prompt
The particles in the word should also have random colors every time they are formed
User prompt
Words letters should also be random
User prompt
Each particle shoild have a different random bright fluor color, even the unused ones
User prompt
Down word is still not centered. Fix it please
User prompt
Center Down word too
User prompt
Center the word Left
User prompt
Center the unused particles
User prompt
Up left and down are not centered. Plase center them.
User prompt
Right does not fit in the screen adjust it please
User prompt
Direction words are not very clear can you make them more reqdable. Also add a lot of colour
User prompt
Remove the text that says wipe the direction and also cneter the text that tells qhich direction
User prompt
Use the paricle and the movement but end up forming the word up down left or rigth and player has to swipe that way to add a pount βͺπ‘ Consider importing and using the following plugins: @upit/tween.v1
User prompt
I just want a simple tap game, using all this tween effects. βͺπ‘ Consider importing and using the following plugins: @upit/tween.v1
Remix started
Copy Tween toy
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Particle = Container.expand(function () { var self = Container.call(this); var particleGraphics = self.attachAsset('particle', { anchorX: 0.5, anchorY: 0.5 }); self.tint = 0xffffff * Math.random(); self.rotation = Math.PI * 2 * Math.random(); particleGraphics.blendMode = 1; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ var scoreDisplay; var currentDirection = null; var swipeStartX = null; var swipeStartY = null; var isCorrectSwipe = false; var canSwipe = true; for (var i = 0; i < 500; i++) { var particle = game.addChild(new Particle()); var angle = Math.random() * Math.PI * 2; var radius = Math.random() * 200; particle.x = 1024 + Math.cos(angle) * radius; particle.y = 1366 + Math.sin(angle) * radius; particle.scale.set(4, 4); } // Create letter positions for directional words - centered on screen var letterPositions = { UP: [ // U { x: 724, y: 1200 }, { x: 724, y: 1300 }, { x: 724, y: 1400 }, { x: 724, y: 1500 }, { x: 824, y: 1500 }, { x: 924, y: 1500 }, { x: 1024, y: 1200 }, { x: 1024, y: 1300 }, { x: 1024, y: 1400 }, { x: 1024, y: 1500 }, // P { x: 1224, y: 1200 }, { x: 1224, y: 1300 }, { x: 1224, y: 1400 }, { x: 1224, y: 1500 }, { x: 1324, y: 1200 }, { x: 1424, y: 1200 }, { x: 1424, y: 1300 }, { x: 1324, y: 1350 }, { x: 1424, y: 1350 }], DOWN: [ // D { x: 424, y: 1200 }, { x: 424, y: 1300 }, { x: 424, y: 1400 }, { x: 424, y: 1500 }, { x: 524, y: 1200 }, { x: 624, y: 1250 }, { x: 624, y: 1450 }, { x: 524, y: 1500 }, // O { x: 824, y: 1250 }, { x: 824, y: 1450 }, { x: 874, y: 1200 }, { x: 974, y: 1200 }, { x: 1024, y: 1250 }, { x: 1024, y: 1450 }, { x: 874, y: 1500 }, { x: 974, y: 1500 }, // W { x: 1224, y: 1200 }, { x: 1244, y: 1300 }, { x: 1264, y: 1400 }, { x: 1284, y: 1500 }, { x: 1374, y: 1400 }, { x: 1464, y: 1400 }, { x: 1484, y: 1500 }, { x: 1504, y: 1400 }, { x: 1524, y: 1300 }, { x: 1544, y: 1200 }, // N { x: 1674, y: 1200 }, { x: 1674, y: 1300 }, { x: 1674, y: 1400 }, { x: 1674, y: 1500 }, { x: 1744, y: 1280 }, { x: 1814, y: 1360 }, { x: 1884, y: 1440 }, { x: 1954, y: 1200 }, { x: 1954, y: 1300 }, { x: 1954, y: 1400 }, { x: 1954, y: 1500 }], LEFT: [ // L { x: 624, y: 1200 }, { x: 624, y: 1300 }, { x: 624, y: 1400 }, { x: 624, y: 1500 }, { x: 724, y: 1500 }, { x: 824, y: 1500 }, // E { x: 1024, y: 1200 }, { x: 1024, y: 1300 }, { x: 1024, y: 1400 }, { x: 1024, y: 1500 }, { x: 1124, y: 1200 }, { x: 1224, y: 1200 }, { x: 1124, y: 1350 }, { x: 1124, y: 1500 }, { x: 1224, y: 1500 }, // F { x: 1424, y: 1200 }, { x: 1424, y: 1300 }, { x: 1424, y: 1400 }, { x: 1424, y: 1500 }, { x: 1524, y: 1200 }, { x: 1624, y: 1200 }, { x: 1524, y: 1350 }, // T { x: 1824, y: 1200 }, { x: 1924, y: 1200 }, { x: 2024, y: 1200 }, { x: 1924, y: 1300 }, { x: 1924, y: 1400 }, { x: 1924, y: 1500 }], RIGHT: [ // Shifted left by 225px to fit on screen // R { x: 49, // 274 - 225 y: 1200 }, { x: 49, // 274 - 225 y: 1300 }, { x: 49, // 274 - 225 y: 1400 }, { x: 49, // 274 - 225 y: 1500 }, { x: 149, // 374 - 225 y: 1200 }, { x: 249, // 474 - 225 y: 1200 }, { x: 249, // 474 - 225 y: 1300 }, { x: 149, // 374 - 225 y: 1350 }, { x: 249, // 474 - 225 y: 1400 }, { x: 349, // 574 - 225 y: 1500 }, // I { x: 549, // 774 - 225 y: 1200 }, { x: 649, // 874 - 225 y: 1200 }, { x: 749, // 974 - 225 y: 1200 }, { x: 649, // 874 - 225 y: 1300 }, { x: 649, // 874 - 225 y: 1400 }, { x: 549, // 774 - 225 y: 1500 }, { x: 649, // 874 - 225 y: 1500 }, { x: 749, // 974 - 225 y: 1500 }, // G { x: 949, // 1174 - 225 y: 1250 }, { x: 999, // 1224 - 225 y: 1200 }, { x: 1099, // 1324 - 225 y: 1200 }, { x: 1149, // 1374 - 225 y: 1200 }, { x: 949, // 1174 - 225 y: 1350 }, { x: 949, // 1174 - 225 y: 1450 }, { x: 999, // 1224 - 225 y: 1500 }, { x: 1099, // 1324 - 225 y: 1500 }, { x: 1149, // 1374 - 225 y: 1450 }, { x: 1149, // 1374 - 225 y: 1400 }, { x: 1099, // 1324 - 225 y: 1400 }, // H { x: 1349, // 1574 - 225 y: 1200 }, { x: 1349, // 1574 - 225 y: 1300 }, { x: 1349, // 1574 - 225 y: 1400 }, { x: 1349, // 1574 - 225 y: 1500 }, { x: 1449, // 1674 - 225 y: 1350 }, { x: 1549, // 1774 - 225 y: 1350 }, { x: 1649, // 1874 - 225 y: 1200 }, { x: 1649, // 1874 - 225 y: 1300 }, { x: 1649, // 1874 - 225 y: 1400 }, { x: 1649, // 1874 - 225 y: 1500 }, // T { x: 1799, // 2024 - 225 y: 1200 }, { x: 1899, // 2124 - 225 y: 1200 }, { x: 1999, // 2224 - 225 y: 1200 }, { x: 1899, // 2124 - 225 y: 1300 }, { x: 1899, // 2124 - 225 y: 1400 }, { x: 1899, // 2124 - 225 y: 1500 }] }; // Initialize score display scoreDisplay = new Text2(LK.getScore().toString(), { size: 100, // Set a nice size for the score fill: 0xFFFFFF // White color for visibility }); scoreDisplay.anchor.set(0.5, 0); // Anchor to its top-center point LK.gui.top.addChild(scoreDisplay); // Add to the GUI at the top-center of the screen game.move = function (x, y) { // Not used for swipe detection, but required by engine }; game.up = function (x, y) { if (!canSwipe || swipeStartX === null || swipeStartY === null) return; var swipeDeltaX = x - swipeStartX; var swipeDeltaY = y - swipeStartY; var swipeThreshold = 100; var detectedDirection = null; if (Math.abs(swipeDeltaX) > Math.abs(swipeDeltaY)) { if (swipeDeltaX > swipeThreshold) { detectedDirection = 'RIGHT'; } else if (swipeDeltaX < -swipeThreshold) { detectedDirection = 'LEFT'; } } else { if (swipeDeltaY > swipeThreshold) { detectedDirection = 'DOWN'; } else if (swipeDeltaY < -swipeThreshold) { detectedDirection = 'UP'; } } if (detectedDirection === currentDirection) { // Correct swipe! isCorrectSwipe = true; LK.setScore(LK.getScore() + 1); scoreDisplay.setText(LK.getScore().toString()); // Flash green for correct LK.effects.flashScreen(0x00FF00, 300); // Check win condition if (LK.getScore() >= 20) { LK.showYouWin(); return; } // Start next round canSwipe = false; showNextDirection(); } else if (detectedDirection !== null) { // Wrong swipe LK.effects.flashScreen(0xFF0000, 300); } swipeStartX = null; swipeStartY = null; }; function showNextDirection() { // Choose random direction var directions = ['UP', 'DOWN', 'LEFT', 'RIGHT']; currentDirection = directions[Math.floor(Math.random() * directions.length)]; var directionColors = { UP: 0xFFFF00, // Bright Yellow DOWN: 0x00FFFF, // Bright Cyan LEFT: 0x00FF00, // Bright Green RIGHT: 0xFF00FF // Bright Magenta }; // Get particles var particles = []; for (var i = 0; i < game.children.length; i++) { if (game.children[i] instanceof Particle) { particles.push(game.children[i]); } } // Animate particles to scatter first var scatterDuration = 500; particles.forEach(function (particle, index) { var angle = Math.random() * Math.PI * 2; var radius = 300 + Math.random() * 700; tween(particle, { x: 1024 + Math.cos(angle) * radius, y: 1366 + Math.sin(angle) * radius, scaleX: 0.5, scaleY: 0.5, rotation: Math.random() * Math.PI * 2, tint: 0x666666 }, { duration: scatterDuration, easing: tween.easeOut }); }); // After scatter, form the word LK.setTimeout(function () { var positions = letterPositions[currentDirection]; var tweenFunctions = [tween.easeIn, tween.easeOut, tween.elasticOut, tween.bounceOut, tween.easeInOut]; var randomTweenFunction = tweenFunctions[Math.floor(Math.random() * tweenFunctions.length)]; particles.forEach(function (particle, index) { if (index < positions.length) { // Form letter tween(particle, { x: positions[index].x, y: positions[index].y, scaleX: 1.2, // Increased scale for better readability scaleY: 1.2, // Increased scale for better readability rotation: 0, tint: directionColors[currentDirection] // Apply specific vibrant color for the current word }, { duration: 800, easing: randomTweenFunction, delay: index * 10 }); } else { // Extra particles float around var angle = Math.random() * Math.PI * 2; var radius = 200 + Math.random() * 300; tween(particle, { x: 1024 + Math.cos(angle) * radius, y: 600 + Math.sin(angle) * radius, scaleX: 0.2, scaleY: 0.2, rotation: Math.random() * Math.PI * 2, tint: 0x444444 }, { duration: 1000, easing: tween.linear }); } }); // Enable swiping after animation LK.setTimeout(function () { canSwipe = true; }, 900); }, scatterDuration + 100); } // Start the first round showNextDirection(); game.down = function (x, y) { if (!canSwipe) return; swipeStartX = x; swipeStartY = y; isCorrectSwipe = false; };
===================================================================
--- original.js
+++ change.js
@@ -45,278 +45,278 @@
var letterPositions = {
UP: [
// U
{
- x: 824,
+ x: 724,
y: 1200
}, {
- x: 824,
+ x: 724,
y: 1300
}, {
- x: 824,
+ x: 724,
y: 1400
}, {
+ x: 724,
+ y: 1500
+ }, {
x: 824,
y: 1500
}, {
x: 924,
y: 1500
}, {
x: 1024,
- y: 1500
- }, {
- x: 1124,
y: 1200
}, {
- x: 1124,
+ x: 1024,
y: 1300
}, {
- x: 1124,
+ x: 1024,
y: 1400
}, {
- x: 1124,
+ x: 1024,
y: 1500
},
// P
{
- x: 1324,
+ x: 1224,
y: 1200
}, {
- x: 1324,
+ x: 1224,
y: 1300
}, {
- x: 1324,
+ x: 1224,
y: 1400
}, {
- x: 1324,
+ x: 1224,
y: 1500
}, {
- x: 1424,
+ x: 1324,
y: 1200
}, {
- x: 1524,
+ x: 1424,
y: 1200
}, {
- x: 1524,
+ x: 1424,
y: 1300
}, {
- x: 1424,
+ x: 1324,
y: 1350
}, {
- x: 1524,
+ x: 1424,
y: 1350
}],
DOWN: [
// D
{
- x: 274,
+ x: 424,
y: 1200
}, {
- x: 274,
+ x: 424,
y: 1300
}, {
- x: 274,
+ x: 424,
y: 1400
}, {
- x: 274,
+ x: 424,
y: 1500
}, {
- x: 374,
+ x: 524,
y: 1200
}, {
- x: 474,
+ x: 624,
y: 1250
}, {
- x: 474,
+ x: 624,
y: 1450
}, {
- x: 374,
+ x: 524,
y: 1500
},
// O
{
- x: 674,
+ x: 824,
y: 1250
}, {
- x: 674,
+ x: 824,
y: 1450
}, {
- x: 724,
+ x: 874,
y: 1200
}, {
- x: 824,
+ x: 974,
y: 1200
}, {
- x: 874,
+ x: 1024,
y: 1250
}, {
- x: 874,
+ x: 1024,
y: 1450
}, {
- x: 724,
+ x: 874,
y: 1500
}, {
- x: 824,
+ x: 974,
y: 1500
},
// W
{
- x: 1074,
+ x: 1224,
y: 1200
}, {
- x: 1094,
+ x: 1244,
y: 1300
}, {
- x: 1114,
+ x: 1264,
y: 1400
}, {
- x: 1134,
+ x: 1284,
y: 1500
}, {
- x: 1224,
+ x: 1374,
y: 1400
}, {
- x: 1314,
+ x: 1464,
y: 1400
}, {
- x: 1334,
+ x: 1484,
y: 1500
}, {
- x: 1354,
+ x: 1504,
y: 1400
}, {
- x: 1374,
+ x: 1524,
y: 1300
}, {
- x: 1394,
+ x: 1544,
y: 1200
},
// N
{
- x: 1524,
+ x: 1674,
y: 1200
}, {
- x: 1524,
+ x: 1674,
y: 1300
}, {
- x: 1524,
+ x: 1674,
y: 1400
}, {
- x: 1524,
+ x: 1674,
y: 1500
}, {
- x: 1594,
+ x: 1744,
y: 1280
}, {
- x: 1664,
+ x: 1814,
y: 1360
}, {
- x: 1734,
+ x: 1884,
y: 1440
}, {
- x: 1804,
+ x: 1954,
y: 1200
}, {
- x: 1804,
+ x: 1954,
y: 1300
}, {
- x: 1804,
+ x: 1954,
y: 1400
}, {
- x: 1804,
+ x: 1954,
y: 1500
}],
LEFT: [
// L
{
- x: 574,
+ x: 624,
y: 1200
}, {
- x: 574,
+ x: 624,
y: 1300
}, {
- x: 574,
+ x: 624,
y: 1400
}, {
- x: 574,
+ x: 624,
y: 1500
}, {
- x: 674,
+ x: 724,
y: 1500
}, {
- x: 774,
+ x: 824,
y: 1500
},
// E
{
- x: 974,
+ x: 1024,
y: 1200
}, {
- x: 974,
+ x: 1024,
y: 1300
}, {
- x: 974,
+ x: 1024,
y: 1400
}, {
- x: 974,
+ x: 1024,
y: 1500
}, {
- x: 1074,
+ x: 1124,
y: 1200
}, {
- x: 1174,
+ x: 1224,
y: 1200
}, {
- x: 1074,
+ x: 1124,
y: 1350
}, {
- x: 1074,
+ x: 1124,
y: 1500
}, {
- x: 1174,
+ x: 1224,
y: 1500
},
// F
{
- x: 1374,
+ x: 1424,
y: 1200
}, {
- x: 1374,
+ x: 1424,
y: 1300
}, {
- x: 1374,
+ x: 1424,
y: 1400
}, {
- x: 1374,
+ x: 1424,
y: 1500
}, {
- x: 1474,
+ x: 1524,
y: 1200
}, {
- x: 1574,
+ x: 1624,
y: 1200
}, {
- x: 1474,
+ x: 1524,
y: 1350
},
// T
{
- x: 1774,
+ x: 1824,
y: 1200
}, {
- x: 1874,
+ x: 1924,
y: 1200
}, {
- x: 1974,
+ x: 2024,
y: 1200
}, {
- x: 1874,
+ x: 1924,
y: 1300
}, {
- x: 1874,
+ x: 1924,
y: 1400
}, {
- x: 1874,
+ x: 1924,
y: 1500
}],
RIGHT: [
// Shifted left by 225px to fit on screen