User prompt
Que la ventana de Tokio Payments se llame Total de Tokens.
User prompt
Que las letras de Tokyo Pavement sean rojas.
User prompt
que las letras de precio de token sean de color rojo.
User prompt
que las letras del total de tokens sean más grandes
User prompt
que las letras del total de tokens sean más grandes.
User prompt
que las letras del total de tokens sean más grandes.
User prompt
Que el juego sea dos tantos más rápido.
User prompt
elimina el pago cada vez que se marca un número en las tarjetas
User prompt
Elimina el pavo por líneas verticales y diagonales.
User prompt
Tana de Skor se pasea un poco más abajo.
User prompt
que la ventana de score se pase un poco más a la izquierda
User prompt
La ventana de Score se pase un poco mas a la izquierda.
User prompt
que la ventana del score se pase un poco más a la izquierda
User prompt
la ventana de score se pase un poco mas abajo
User prompt
Que la ventana de score tenga un texto que diga puntuación y los números.
User prompt
que la ventana de score se pasen un poco más abajo
User prompt
de la ventana, que los números de la ventana de score se pasen un poco más abajo.
User prompt
los de la ventana de score se pasen un poco más abajo
User prompt
que los números de la ventana de score sean de color rojo
User prompt
Que los números del pago de puntuación sean de color amarillo.
User prompt
Que los números de pago de puntuación se pasen arriba del cartón de arriba.
User prompt
Los números de pago de puntuación se pasan un poquito más abajo.
User prompt
Los números de pago de puntuación se pasan un poquito más abajo.
User prompt
Que los números del paro de puntuación sean de color negro.
User prompt
que las letras de total de token sean un poquito más grandes
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var BingoCard = Container.expand(function (cardIndex) { var self = Container.call(this); self.cardIndex = cardIndex; self.numbers = []; self.bingoNumbers = []; self.cardBg = self.attachAsset('bingoCard', { anchorX: 0.5, anchorY: 0.5 }); // Generate 15 random unique numbers between 1-75 self.generateNumbers = function () { var availableNumbers = []; for (var i = 1; i <= 75; i++) { availableNumbers.push(i); } for (var j = 0; j < 15; j++) { var randomIndex = Math.floor(Math.random() * availableNumbers.length); self.numbers.push(availableNumbers[randomIndex]); availableNumbers.splice(randomIndex, 1); } }; self.createNumberGrid = function () { var startX = -270; var startY = -90; var spacingX = 135; var spacingY = 90; for (var row = 0; row < 3; row++) { self.bingoNumbers[row] = []; for (var col = 0; col < 5; col++) { var numberIndex = row * 5 + col; var bingoNumber = new BingoNumber(self.numbers[numberIndex], self.cardIndex, row, col); bingoNumber.x = startX + col * spacingX; bingoNumber.y = startY + row * spacingY; self.addChild(bingoNumber); self.bingoNumbers[row][col] = bingoNumber; } } }; self.generateNumbers(); self.createNumberGrid(); return self; }); var BingoNumber = Container.expand(function (number, cardIndex, row, col) { var self = Container.call(this); self.number = number; self.cardIndex = cardIndex; self.row = row; self.col = col; self.isMarked = false; self.bg = self.attachAsset('bingoNumber', { anchorX: 0.5, anchorY: 0.5 }); self.numberText = new Text2(number.toString(), { size: 43, fill: 0x000000 }); self.numberText.anchor.set(0.5, 0.5); self.addChild(self.numberText); self.markNumber = function () { if (!self.isMarked) { self.isMarked = true; self.removeChild(self.bg); self.bg = self.attachAsset('markedNumber', { anchorX: 0.5, anchorY: 0.5 }); // Replace the text with white color self.removeChild(self.numberText); self.numberText = new Text2(self.number.toString(), { size: 43, fill: 0xFFFFFF }); self.numberText.anchor.set(0.5, 0.5); self.addChild(self.numberText); LK.getSound('numberMarked').play(); // Check for completed lines checkForCompletedLines(self.cardIndex); } }; self.down = function (x, y, obj) { // Numbers are now automatically marked, no manual interaction needed }; return self; }); var BingoWindow = Container.expand(function () { var self = Container.call(this); // Create celebration window background self.windowBg = self.attachAsset('bingoWindow', { anchorX: 0.5, anchorY: 0.5 }); // Create BINGO text self.bingoText = new Text2('BINGO!', { size: 120, fill: 0x000000 }); self.bingoText.anchor.set(0.5, 0.5); self.addChild(self.bingoText); // Position at center of screen self.x = 1024; self.y = 1366; // Start invisible self.alpha = 0; self.scaleX = 0.1; self.scaleY = 0.1; self.show = function () { // Animate window appearance tween(self, { alpha: 1, scaleX: 1, scaleY: 1 }, { duration: 500, easing: tween.easeOut }); // Add pulsing animation to text tween(self.bingoText, { scaleX: 1.2, scaleY: 1.2 }, { duration: 300, easing: tween.easeInOut, onFinish: function onFinish() { tween(self.bingoText, { scaleX: 1, scaleY: 1 }, { duration: 300, easing: tween.easeInOut }); } }); // Auto-hide after 3 seconds LK.setTimeout(function () { self.hide(); }, 3000); }; self.hide = function () { tween(self, { alpha: 0, scaleX: 0.1, scaleY: 0.1 }, { duration: 300, easing: tween.easeIn, onFinish: function onFinish() { if (self.parent) { self.parent.removeChild(self); } } }); }; return self; }); var NumberBubble = Container.expand(function (number) { var self = Container.call(this); self.number = number; self.speed = -3; self.floatSpeed = 0; // Create bubble background self.bubbleBg = self.attachAsset('numberBubble', { anchorX: 0.5, anchorY: 0.5 }); // Create number text self.numberText = new Text2(number.toString(), { size: 32, fill: 0xFFFFFF }); self.numberText.anchor.set(0.5, 0.5); self.addChild(self.numberText); // Calculate position in three horizontal rows var bubblesPerRow = 25; // 25 bubbles per row (75 total / 3 rows) var bubbleSpacing = 80; // Spacing between bubbles var rowSpacing = 90; // Spacing between rows var startX = 50; // Start position for each row var startY = 120; // Y position for first row var currentBubbleCount = numberBubbles.length; // Calculate which row and position within row var row = Math.floor(currentBubbleCount / bubblesPerRow); var positionInRow = currentBubbleCount % bubblesPerRow; // Set target position in three rows var targetX = startX + positionInRow * bubbleSpacing; var targetY = startY + row * rowSpacing; // Initialize position at bottom of screen for animation self.x = targetX; self.y = 2732 + 50; // Start below screen self.lastY = self.y; // Animate bubble entrance to target position tween(self, { y: targetY, scaleX: 1.0, scaleY: 1.0 }, { duration: 1500, easing: tween.easeOut }); // Add floating animation tween(self.bubbleBg, { rotation: Math.PI * 2 }, { duration: 4000, easing: tween.linear }); self.update = function () { // Bubbles stay fixed in position - no floating animation }; return self; }); var PaymentWindow = Container.expand(function () { var self = Container.call(this); // Load accumulated payments from storage, default to 0 self.totalPayments = storage.tokyoPayments || 0; // Create window background self.windowBg = self.attachAsset('paymentWindow', { anchorX: 0.5, anchorY: 0.5 }); // Create payment text self.paymentText = new Text2('Tokyo Payments: $' + self.totalPayments, { size: 45, fill: 0xffff00 }); self.paymentText.anchor.set(0.5, 0.5); self.addChild(self.paymentText); // Method to add payment self.addPayment = function (amount) { self.totalPayments += amount; self.paymentText.setText('Tokyo Payments: $' + self.totalPayments); // Save to storage storage.tokyoPayments = self.totalPayments; // Flash animation for payment addition tween(self.windowBg, { tint: 0xffd700 }, { duration: 200 }); tween(self.windowBg, { tint: 0xffffff }, { duration: 200 }); }; // Method to reset payments self.resetPayments = function () { self.totalPayments = 0; self.paymentText.setText('Tokyo Payments: $' + self.totalPayments); storage.tokyoPayments = self.totalPayments; }; return self; }); var TokenWindow = Container.expand(function (cardIndex) { var self = Container.call(this); self.cardIndex = cardIndex; // Define predefined price options self.priceOptions = [10, 20, 30, 50, 100]; // Load saved price index from storage, default to 0 if not found var storageKey = 'tokenPrice_' + cardIndex; self.currentPriceIndex = storage[storageKey] || 0; // Create window background self.windowBg = self.attachAsset('tokenWindow', { anchorX: 0.5, anchorY: 0.5 }); // Create price text with saved price self.priceText = new Text2('Token Price: ' + self.priceOptions[self.currentPriceIndex], { size: 40, fill: 0xFFFFFF }); self.priceText.anchor.set(0.5, 0.5); self.addChild(self.priceText); // Add tap event to cycle through prices and save to storage self.down = function (x, y, obj) { self.currentPriceIndex = (self.currentPriceIndex + 1) % self.priceOptions.length; self.priceText.setText('Token Price: ' + self.priceOptions[self.currentPriceIndex]); // Save the selected price index to storage storage[storageKey] = self.currentPriceIndex; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x1a1a2e }); /**** * Game Code ****/ var bingoCards = []; var currentCalledNumber = null; var calledNumbers = []; var availableNumbers = []; var callTimer = null; var completedLines = 0; var gameStarted = false; var startButton = null; var numberBubbles = []; var bingoWindow = null; var paymentWindow = null; // Initialize available numbers for (var i = 1; i <= 75; i++) { availableNumbers.push(i); } // Create score display var scoreLabel = new Text2('Puntuación:', { size: 50, fill: 0xff0000 }); scoreLabel.anchor.set(0.5, 0); scoreLabel.x = -300; LK.gui.top.addChild(scoreLabel); scoreLabel.y = 250; var scoreText = new Text2('0', { size: 60, fill: 0xff0000 }); scoreText.anchor.set(0.5, 0); scoreText.x = -300; LK.gui.top.addChild(scoreText); scoreText.y = 300; // Create current called number display var calledNumberContainer = new Container(); var calledNumberBg = LK.getAsset('calledNumberBg', { anchorX: 0.5, anchorY: 0.5 }); calledNumberContainer.addChild(calledNumberBg); var calledNumberText = new Text2('--', { size: 36, fill: 0xFFFFFF }); calledNumberText.anchor.set(0.5, 0.5); calledNumberContainer.addChild(calledNumberText); game.addChild(calledNumberContainer); calledNumberContainer.x = 1024; calledNumberContainer.y = 150; // Create info text var infoText = new Text2('Tap START to begin the game!', { size: 30, fill: 0xFFFFFF }); infoText.anchor.set(0.5, 0.5); game.addChild(infoText); infoText.x = 1024; infoText.y = 250; // Create start button startButton = new Container(); var startButtonBg = LK.getAsset('startButton', { anchorX: 0.5, anchorY: 0.5 }); startButton.addChild(startButtonBg); var startButtonText = new Text2('START', { size: 32, fill: 0xFFFFFF }); startButtonText.anchor.set(0.5, 0.5); startButton.addChild(startButtonText); startButton.x = 1024; startButton.y = 2500; game.addChild(startButton); startButton.down = function (x, y, obj) { if (!gameStarted) { gameStarted = true; game.removeChild(startButton); startButton = null; infoText.setText('Cards fill automatically as numbers are called!'); // Start the game LK.setTimeout(callNextNumber, 125); } }; // Create bingo cards - centered on screen for (var c = 0; c < 4; c++) { var card = new BingoCard(c); var row = Math.floor(c / 2); var col = c % 2; // Center cards on 2048x2732 screen - 2 cards per row var cardSpacingX = 900; // Space between cards horizontally var cardSpacingY = 780; // Space between cards vertically - increased separation var totalWidth = cardSpacingX; // Width for 2 cards var totalHeight = cardSpacingY; // Height for 2 rows var startX = (2048 - totalWidth) / 2; // Center horizontally var startY = 950; // Position below the UI elements - moved down card.x = startX + col * cardSpacingX; card.y = startY + row * cardSpacingY; game.addChild(card); bingoCards.push(card); // Create token price window below each card var tokenWindow = new TokenWindow(c); tokenWindow.x = card.x; tokenWindow.y = card.y + 350; // Position below the card game.addChild(tokenWindow); } // Create payment window at the top right of the screen paymentWindow = new PaymentWindow(); paymentWindow.x = 1700; // Position at top right paymentWindow.y = 400; game.addChild(paymentWindow); function callNextNumber() { if (availableNumbers.length > 0) { var randomIndex = Math.floor(Math.random() * availableNumbers.length); currentCalledNumber = availableNumbers[randomIndex]; availableNumbers.splice(randomIndex, 1); calledNumbers.push(currentCalledNumber); calledNumberText.setText(currentCalledNumber.toString()); LK.getSound('numberCalled').play(); // Create red bubble for the called number var bubble = new NumberBubble(currentCalledNumber); game.addChild(bubble); numberBubbles.push(bubble); // Automatically mark the called number on all cards with reduced probability for (var cardIndex = 0; cardIndex < bingoCards.length; cardIndex++) { var card = bingoCards[cardIndex]; for (var row = 0; row < 3; row++) { for (var col = 0; col < 5; col++) { var bingoNumber = card.bingoNumbers[row][col]; if (bingoNumber.number === currentCalledNumber && !bingoNumber.isMarked) { // Only mark the number 70% of the time to reduce card fill probability if (Math.random() < 0.7) { bingoNumber.markNumber(); LK.setScore(LK.getScore() + 10); scoreText.setText(LK.getScore()); } } } } } // Flash the called number tween(calledNumberBg, { tint: 0xffff00 }, { duration: 200 }); tween(calledNumberBg, { tint: 0xffffff }, { duration: 200 }); // Schedule next number call var delay = Math.max(250 - completedLines * 12, 125); callTimer = LK.setTimeout(callNextNumber, delay); } } function checkForCompletedLines(cardIndex) { var card = bingoCards[cardIndex]; var newLinesCompleted = 0; var horizontalLinesCompleted = 0; // Check horizontal lines for (var row = 0; row < 3; row++) { var lineComplete = true; for (var col = 0; col < 5; col++) { if (!card.bingoNumbers[row][col].isMarked) { lineComplete = false; break; } } if (lineComplete) { newLinesCompleted++; horizontalLinesCompleted++; } } // Check vertical lines for (var col = 0; col < 5; col++) { var lineComplete = true; for (var row = 0; row < 3; row++) { if (!card.bingoNumbers[row][col].isMarked) { lineComplete = false; break; } } if (lineComplete) { newLinesCompleted++; } } // Check diagonal lines (3x5 grid diagonals) // Left diagonal (top-left to bottom-right) if (card.bingoNumbers[0][0].isMarked && card.bingoNumbers[1][2].isMarked && card.bingoNumbers[2][4].isMarked) { newLinesCompleted++; } // Right diagonal (top-right to bottom-left) if (card.bingoNumbers[0][4].isMarked && card.bingoNumbers[1][2].isMarked && card.bingoNumbers[2][0].isMarked) { newLinesCompleted++; } if (newLinesCompleted > 0) { completedLines += newLinesCompleted; LK.getSound('lineComplete').play(); LK.setScore(LK.getScore() + newLinesCompleted * 100); scoreText.setText(LK.getScore()); // Add payment based on token price for this card var tokenStorageKey = 'tokenPrice_' + cardIndex; var tokenPriceIndex = storage[tokenStorageKey] || 0; var priceOptions = [10, 20, 30, 50, 100]; var tokenPrice = priceOptions[tokenPriceIndex]; var paymentAmount = tokenPrice * newLinesCompleted; paymentWindow.addPayment(paymentAmount); // Show BINGO celebration window for horizontal line completion if (horizontalLinesCompleted > 0) { bingoWindow = new BingoWindow(); game.addChild(bingoWindow); bingoWindow.show(); } // Flash the card tween(card.cardBg, { tint: 0x00ff00 }, { duration: 300 }); tween(card.cardBg, { tint: 0xffffff }, { duration: 300 }); // Check for full card completion var allMarked = true; for (var r = 0; r < 3; r++) { for (var c = 0; c < 5; c++) { if (!card.bingoNumbers[r][c].isMarked) { allMarked = false; break; } } if (!allMarked) break; } if (allMarked) { LK.setScore(LK.getScore() + 500); scoreText.setText(LK.getScore()); // Check win condition - 3 completed lines or 1 full card if (completedLines >= 3) { LK.clearTimeout(callTimer); LK.setTimeout(function () { LK.showYouWin(); }, 6000); } } } } // Game will start when start button is pressed game.update = function () { // Update score display scoreText.setText(LK.getScore()); // Bubbles now stay at the top, no cleanup needed // Check if all numbers have been called if (availableNumbers.length === 0 && calledNumbers.length === 75) { LK.clearTimeout(callTimer); if (completedLines >= 1) { LK.setTimeout(function () { LK.showYouWin(); }, 6000); } else { LK.setTimeout(function () { LK.showGameOver(); }, 6000); } } };
===================================================================
--- original.js
+++ change.js
@@ -321,17 +321,17 @@
});
scoreLabel.anchor.set(0.5, 0);
scoreLabel.x = -300;
LK.gui.top.addChild(scoreLabel);
-scoreLabel.y = 200;
+scoreLabel.y = 250;
var scoreText = new Text2('0', {
size: 60,
fill: 0xff0000
});
scoreText.anchor.set(0.5, 0);
scoreText.x = -300;
LK.gui.top.addChild(scoreText);
-scoreText.y = 250;
+scoreText.y = 300;
// Create current called number display
var calledNumberContainer = new Container();
var calledNumberBg = LK.getAsset('calledNumberBg', {
anchorX: 0.5,