User prompt
mejora la caja de colision de los circulos para que no se sobrepongan encima de otros
User prompt
cambia el nombre del juego a: The amazing digital chaos!
User prompt
mejora el hitbox de la colision entre los circulos que no son pares, para que no se sobrepongan por encima de las otras
User prompt
borra estos elementos: House, Character 1, Character 2 y Character 3
User prompt
borra una lo de las skins porfavor
User prompt
borra estos elementos del juego ya que no cumplen ninguna funcion: DECORATION, FLOOR Y TREE
User prompt
elimina el boton de personajes y pon uno de Skins, para cambiar la skin de Todos los circulos
User prompt
vuelve a agregar el circulo numero 3 porfa
User prompt
haz que las fisicas de los circulos sea mejor, que cuando otro circulo lo golpee se mueva mas como si fuese una canica real
User prompt
haz que los circulos den vueltas su imagen cuando para que no se vean tan duros cuando se mueven o caen ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
haz que todos los circulos sean mas grandes
User prompt
elimina el boton de la sensibilidad y en su lugar agrega un boton llamado Reiniciar, para reiniciar el nivel, en el modo pausa
User prompt
haz que los circulos sean todos mas grandes y que al momento de que dos se fusionen, se combiertan en uno solo ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
bien, ahora haz que cuando un circulo toque a otro de su mismo tipo, se fusionen y hagan uno mas grande, haciendo que de los dos, solo salga 1 mas grande ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
arregla el error, al momento de hacer click en la pantalla el juego detecta como que perdi, arregla eso
User prompt
arregla el error de perder si tocas la pantalla ya que los circulos no caen en el frasco
User prompt
haz mas grande el frasco, como 2 veces mas grande de lo que es para que ocupe casi toda la pantalla, y soluciona el error al hacer click en la pantalla, y haz que los circulos caigan en el frasco, y solamente se pueda perder si los circulos llegan a pasar por encima de la boca de el frasco
User prompt
haz que el frasco sea mucho mas grande, que se vea bastante bien, y haz que los circulos al momento de hacer click, caigan en el frasco
User prompt
ahora, el inicio del juego y las cosas de la pausa dejalos tal y como estan, pero el juego cambialo, haz que sea una plantilla de juego como Suika Game, osea genera un Frasco gigante en el cual van a ir callendo circulos de diversos tamaños
User prompt
que los colores de los nombres de CONTINUAR, MENU PRINCIPAL y SENSIBILIDAD de la pausa sean de color negro
User prompt
haz que los botones de CONTINUAR, MENU PRINCIPAL y SENSIBILIDAD de la pausa, tengan sus propios diseños para que yo pueda cambiar y asi no tengan el mismo diseño que el boton de jugar
User prompt
haz que los personajes sean un poco mas grandes
User prompt
haz que el color de las letras de Jugar sea de color Negro, y que el color de las letras de Personajes sea tambien negro
User prompt
quitale los efectos verdes del boton de Jugar para que solo quede el boton que dice Jugar y el diseño de boton que yo implemente, lo mismo haz con el boton de Personajes
User prompt
haz que el diseño del boton de Personajes no sea el mismo que el de Jugar, asi yo puedo personalizar su diseño
/**** * Plugins ****/ var storage = LK.import("@upit/storage.v1"); var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Circle = Container.expand(function (circleType) { var self = Container.call(this); var circleGraphics = self.attachAsset('circle' + circleType, { anchorX: 0.5, anchorY: 0.5 }); self.circleType = circleType; self.size = circleType; self.velocityX = 0; self.velocityY = 0; self.radius = [90, 120, 150, 180, 210, 240, 270][circleType - 1]; self.lastY = 0; self.lastIntersecting = false; self.update = function () { // Apply gravity with slight variation based on size (heavier objects fall slightly faster) var gravityForce = 0.4 + self.radius / 1000; // Larger circles have slightly more gravity self.velocityY += gravityForce; // Apply velocity self.x += self.velocityX; self.y += self.velocityY; // Apply air resistance (less friction for more realistic movement) self.velocityX *= 0.995; // Very slight air resistance self.velocityY *= 0.999; // Even less resistance on Y axis // Add rotation based on horizontal velocity to make circles look more natural circleGraphics.rotation += self.velocityX * 0.01; // Container collision detection var containerLeft = containerX + 20; var containerRight = containerX + containerWidth - 20; var containerBottom = containerY + containerHeight - 20; // Side walls collision with improved bouncing if (self.x - self.radius < containerLeft) { self.x = containerLeft + self.radius; self.velocityX = Math.abs(self.velocityX) * 0.7; // More bounce } if (self.x + self.radius > containerRight) { self.x = containerRight - self.radius; self.velocityX = -Math.abs(self.velocityX) * 0.7; // More bounce } // Bottom collision with better restitution if (self.y + self.radius > containerBottom) { self.y = containerBottom - self.radius; // Add some bounce to vertical velocity instead of stopping completely self.velocityY = -Math.abs(self.velocityY) * 0.3; // Small bounce self.velocityX *= 0.85; // Less friction loss } // Circle-to-circle collision with other circles for (var i = 0; i < circles.length; i++) { var other = circles[i]; if (other !== self) { var dx = self.x - other.x; var dy = self.y - other.y; var distance = Math.sqrt(dx * dx + dy * dy); // Use more conservative effective radius to prevent overlap var effectiveRadius1 = self.radius; var effectiveRadius2 = other.radius; if (self.circleType !== other.circleType) { // Reduce effective radius by 15% for non-matching circles to create better separation effectiveRadius1 *= 0.8; effectiveRadius2 *= 0.8; } var minDistance = effectiveRadius1 + effectiveRadius2; if (distance < minDistance && distance > 0) { // Same size circles merge if (self.circleType === other.circleType && self.circleType < 7) { // Prevent multiple merges of the same circles if (self.shouldMerge || other.shouldMerge) { return; } // Create new larger circle var newCircle = new Circle(self.circleType + 1); newCircle.x = (self.x + other.x) / 2; newCircle.y = (self.y + other.y) / 2; newCircle.velocityX = (self.velocityX + other.velocityX) / 2; newCircle.velocityY = (self.velocityY + other.velocityY) / 2; // Start small and animate to full size newCircle.scaleX = 0.3; newCircle.scaleY = 0.3; tween(newCircle, { scaleX: 1, scaleY: 1 }, { duration: 300, easing: tween.bounceOut }); // Mark both circles for merging into the same new circle self.shouldMerge = true; other.shouldMerge = true; self.mergeInto = newCircle; other.mergeInto = newCircle; score += self.circleType * 10; scoreText.setText('Score: ' + score); return; } // Enhanced collision response with better separation var overlap = minDistance - distance; var normalX = dx / distance; var normalY = dy / distance; // For non-matching circles, add stronger separation force var separationMultiplier = 1.0; if (self.circleType !== other.circleType) { separationMultiplier = 1.5; // Stronger separation for non-matching circles } // Separate circles based on their relative masses (size) var mass1 = self.radius * self.radius; // Mass proportional to area var mass2 = other.radius * other.radius; var totalMass = mass1 + mass2; var ratio1 = mass2 / totalMass; // Heavier objects move less var ratio2 = mass1 / totalMass; // Enhanced position correction with stronger separation var separationForce = overlap * separationMultiplier; self.x += normalX * separationForce * ratio1; self.y += normalY * separationForce * ratio1; other.x -= normalX * separationForce * ratio2; other.y -= normalY * separationForce * ratio2; // Ensure circles don't overlap by adding minimum separation var minSeparation = 5; // Minimum pixels between circles if (distance < effectiveRadius1 + effectiveRadius2 + minSeparation) { var extraSeparation = (effectiveRadius1 + effectiveRadius2 + minSeparation - distance) * 0.5; self.x += normalX * extraSeparation; self.y += normalY * extraSeparation; other.x -= normalX * extraSeparation; other.y -= normalY * extraSeparation; } // Realistic velocity exchange with conservation of momentum var relativeVelocityX = self.velocityX - other.velocityX; var relativeVelocityY = self.velocityY - other.velocityY; var separatingVelocity = relativeVelocityX * normalX + relativeVelocityY * normalY; // Only resolve if objects are moving towards each other if (separatingVelocity < 0) { // Coefficient of restitution (bounciness) - marble-like behavior var restitution = 0.75; var impulse = -(1 + restitution) * separatingVelocity / (1 / mass1 + 1 / mass2); // Apply impulse to velocities var impulseX = impulse * normalX; var impulseY = impulse * normalY; self.velocityX += impulseX / mass1; self.velocityY += impulseY / mass1; other.velocityX -= impulseX / mass2; other.velocityY -= impulseY / mass2; // Add some tangential friction for more realistic behavior var tangentX = -normalY; var tangentY = normalX; var tangentialVelocity = relativeVelocityX * tangentX + relativeVelocityY * tangentY; var friction = 0.1; var frictionImpulse = tangentialVelocity * friction; self.velocityX -= frictionImpulse * tangentX / mass1; self.velocityY -= frictionImpulse * tangentY / mass1; other.velocityX += frictionImpulse * tangentX / mass2; other.velocityY += frictionImpulse * tangentY / mass2; } } } } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB }); /**** * Game Code ****/ // Keep menu assets // Suika Game assets // Game state management var gameState = 'menu'; // 'menu', 'playing', 'paused', or 'settings' var sensitivity = storage.sensitivity || 0.5; // Default sensitivity // Suika Game variables var containerX = (2048 - 1600) / 2; var containerY = 200; var containerWidth = 1600; var containerHeight = 2000; var circles = []; var score = 0; var nextCircleType = 1; var currentCircle = null; var dropLine = null; var gameStarted = false; // Create container walls var leftWall = LK.getAsset('containerWall', { anchorX: 0, anchorY: 0 }); leftWall.x = containerX; leftWall.y = containerY; var rightWall = LK.getAsset('containerWall', { anchorX: 0, anchorY: 0 }); rightWall.x = containerX + containerWidth - 20; rightWall.y = containerY; var bottomWall = LK.getAsset('containerBottom', { anchorX: 0, anchorY: 0 }); bottomWall.x = containerX; bottomWall.y = containerY + containerHeight - 20; // Score display var scoreText = new Text2('Score: 0', { size: 60, fill: 0x000000 }); scoreText.anchor.set(0.5, 0); scoreText.x = containerX + containerWidth / 2; scoreText.y = 200; // Next circle preview var nextCirclePreview = LK.getAsset('nextCirclePreview', { anchorX: 0.5, anchorY: 0.5 }); nextCirclePreview.x = containerX + containerWidth + 100; nextCirclePreview.y = 400; var nextCircleText = new Text2('Next:', { size: 40, fill: 0x000000 }); nextCircleText.anchor.set(0.5, 0.5); nextCircleText.x = nextCirclePreview.x; nextCircleText.y = nextCirclePreview.y - 60; // Create forest background elements var forestElements = []; // Create animated fog effects var fogElements = []; for (var i = 0; i < 12; i++) { var fog = LK.getAsset('fog', { anchorX: 0.5, anchorY: 0.5 }); fog.x = Math.random() * 2048; fog.y = 1200 + Math.random() * 800; fog.tint = 0x4a4a4a; // Gray fog fog.alpha = 0.2 + Math.random() * 0.3; fog.scaleX = 1 + Math.random() * 2; fog.scaleY = 0.8 + Math.random() * 1.2; fog.fogSpeed = 0.5 + Math.random() * 1; fog.fogDirection = Math.random() * Math.PI * 2; game.addChild(fog); fogElements.push(fog); } // Create shadow elements array var shadowElements = []; // Create start screen elements var titleText = new Text2('The amazing digital chaos!', { size: 120, fill: 0xFFD700 }); titleText.anchor.set(0.5, 0.5); titleText.x = 2048 / 2; titleText.y = 2732 / 3; var playButton = LK.getAsset('furniture', { anchorX: 0.5, anchorY: 0.5 }); playButton.x = 2048 / 2; playButton.y = 2732 / 2 - 100; // Move play button up playButton.scaleX = 2.5; // Much larger playButton.scaleY = 1.8; // Taller // Add border effect with second button behind var playButtonBorder = LK.getAsset('furniture', { anchorX: 0.5, anchorY: 0.5 }); playButtonBorder.x = playButton.x; playButtonBorder.y = playButton.y; playButtonBorder.tint = 0x000000; // Black border playButtonBorder.scaleX = 2.6; // Slightly larger for border playButtonBorder.scaleY = 1.9; game.addChild(playButtonBorder); game.addChild(playButton); // Add main button after border var playButtonText = new Text2('JUGAR', { size: 100, // Larger text fill: 0x000000 // Black color }); playButtonText.anchor.set(0.5, 0.5); playButtonText.x = playButton.x; playButtonText.y = playButton.y; // Add start screen elements game.addChild(titleText); game.addChild(playButton); game.addChild(playButtonText); // Store references for easy removal (including horror elements) var menuElements = [titleText, playButtonBorder, playButton, playButtonText].concat(forestElements).concat(fogElements); // Create pause button (only visible during gameplay) var pauseButton = LK.getAsset('furniture', { anchorX: 0.5, anchorY: 0.5 }); pauseButton.x = 2048 - 100; pauseButton.y = 150; pauseButton.tint = 0x666666; pauseButton.scaleX = 0.8; pauseButton.scaleY = 0.8; var pauseButtonText = new Text2('||', { size: 60, fill: 0xFFFFFF }); pauseButtonText.anchor.set(0.5, 0.5); pauseButtonText.x = pauseButton.x; pauseButtonText.y = pauseButton.y; // Pause menu elements var pauseMenuElements = []; var pauseTitle = new Text2('PAUSA', { size: 120, fill: 0xFFD700 }); pauseTitle.anchor.set(0.5, 0.5); pauseTitle.x = 2048 / 2; pauseTitle.y = 800; var resumeButton = LK.getAsset('continueButton', { anchorX: 0.5, anchorY: 0.5 }); resumeButton.x = 2048 / 2; resumeButton.y = 1200; resumeButton.scaleX = 2; resumeButton.scaleY = 1.2; var resumeButtonText = new Text2('CONTINUAR', { size: 80, fill: 0x000000 }); resumeButtonText.anchor.set(0.5, 0.5); resumeButtonText.x = resumeButton.x; resumeButtonText.y = resumeButton.y; var menuButton = LK.getAsset('mainMenuButton', { anchorX: 0.5, anchorY: 0.5 }); menuButton.x = 2048 / 2; menuButton.y = 1400; menuButton.scaleX = 2; menuButton.scaleY = 1.2; var menuButtonText = new Text2('MENU PRINCIPAL', { size: 70, fill: 0x000000 }); menuButtonText.anchor.set(0.5, 0.5); menuButtonText.x = menuButton.x; menuButtonText.y = menuButton.y; var restartButton = LK.getAsset('sensitivityButton', { anchorX: 0.5, anchorY: 0.5 }); restartButton.x = 2048 / 2; restartButton.y = 1600; restartButton.scaleX = 2; restartButton.scaleY = 1.2; var restartButtonText = new Text2('REINICIAR', { size: 70, fill: 0x000000 }); restartButtonText.anchor.set(0.5, 0.5); restartButtonText.x = restartButton.x; restartButtonText.y = restartButton.y; pauseMenuElements = [pauseTitle, resumeButton, resumeButtonText, menuButton, menuButtonText, restartButton, restartButtonText]; // Settings screen elements var settingsScreenElements = []; var settingsTitle = new Text2('AJUSTAR SENSIBILIDAD', { size: 100, fill: 0xFFD700 }); settingsTitle.anchor.set(0.5, 0.5); settingsTitle.x = 2048 / 2; settingsTitle.y = 800; var sensitivityText = new Text2('Sensibilidad: ' + Math.round(sensitivity * 100) + '%', { size: 80, fill: 0xFFFFFF }); sensitivityText.anchor.set(0.5, 0.5); sensitivityText.x = 2048 / 2; sensitivityText.y = 1200; var decreaseButton = LK.getAsset('furniture', { anchorX: 0.5, anchorY: 0.5 }); decreaseButton.x = 2048 / 2 - 200; decreaseButton.y = 1400; decreaseButton.tint = 0xFF4444; decreaseButton.scaleX = 1.5; decreaseButton.scaleY = 1.2; var decreaseButtonText = new Text2('-', { size: 100, fill: 0xFFFFFF }); decreaseButtonText.anchor.set(0.5, 0.5); decreaseButtonText.x = decreaseButton.x; decreaseButtonText.y = decreaseButton.y; var increaseButton = LK.getAsset('furniture', { anchorX: 0.5, anchorY: 0.5 }); increaseButton.x = 2048 / 2 + 200; increaseButton.y = 1400; increaseButton.tint = 0x44FF44; increaseButton.scaleX = 1.5; increaseButton.scaleY = 1.2; var increaseButtonText = new Text2('+', { size: 100, fill: 0xFFFFFF }); increaseButtonText.anchor.set(0.5, 0.5); increaseButtonText.x = increaseButton.x; increaseButtonText.y = increaseButton.y; var backFromSettingsButton = LK.getAsset('furniture', { anchorX: 0.5, anchorY: 0.5 }); backFromSettingsButton.x = 2048 / 2; backFromSettingsButton.y = 1700; backFromSettingsButton.tint = 0x888888; backFromSettingsButton.scaleX = 1.8; backFromSettingsButton.scaleY = 1.2; var backFromSettingsButtonText = new Text2('VOLVER', { size: 70, fill: 0xFFFFFF }); backFromSettingsButtonText.anchor.set(0.5, 0.5); backFromSettingsButtonText.x = backFromSettingsButton.x; backFromSettingsButtonText.y = backFromSettingsButton.y; settingsScreenElements = [settingsTitle, sensitivityText, decreaseButton, decreaseButtonText, increaseButton, increaseButtonText, backFromSettingsButton, backFromSettingsButtonText]; // Function to start the game function startGame() { gameState = 'playing'; // Remove menu elements for (var i = 0; i < menuElements.length; i++) { game.removeChild(menuElements[i]); } // Add game elements game.addChild(leftWall); game.addChild(rightWall); game.addChild(bottomWall); game.addChild(scoreText); game.addChild(nextCirclePreview); game.addChild(nextCircleText); // Add pause button game.addChild(pauseButton); game.addChild(pauseButtonText); // Initialize first circle generateNextCircle(); gameStarted = true; } // Function to show pause menu function showPauseMenu() { gameState = 'paused'; // Add pause menu elements for (var i = 0; i < pauseMenuElements.length; i++) { game.addChild(pauseMenuElements[i]); } } // Function to resume game function resumeGame() { gameState = 'playing'; // Remove pause menu elements for (var i = 0; i < pauseMenuElements.length; i++) { game.removeChild(pauseMenuElements[i]); } } // Function to show settings screen function showSettings() { gameState = 'settings'; // Remove pause menu elements for (var i = 0; i < pauseMenuElements.length; i++) { game.removeChild(pauseMenuElements[i]); } // Add settings elements for (var i = 0; i < settingsScreenElements.length; i++) { game.addChild(settingsScreenElements[i]); } } // Function to go back to pause menu from settings function backToPauseMenu() { gameState = 'paused'; // Remove settings elements for (var i = 0; i < settingsScreenElements.length; i++) { game.removeChild(settingsScreenElements[i]); } // Add pause menu elements for (var i = 0; i < pauseMenuElements.length; i++) { game.addChild(pauseMenuElements[i]); } } // Function to restart game function restartGame() { gameState = 'playing'; // Remove pause menu elements for (var i = 0; i < pauseMenuElements.length; i++) { game.removeChild(pauseMenuElements[i]); } // Remove all circles for (var i = 0; i < circles.length; i++) { game.removeChild(circles[i]); } circles = []; if (currentCircle) { game.removeChild(currentCircle); currentCircle = null; } if (dropLine) { game.removeChild(dropLine); dropLine = null; } // Reset game state score = 0; nextCircleType = 1; scoreText.setText('Score: 0'); // Generate new next circle generateNextCircle(); gameStarted = true; } // Function to return to main menu from pause function returnToMainMenu() { gameState = 'menu'; // Remove pause menu elements for (var i = 0; i < pauseMenuElements.length; i++) { game.removeChild(pauseMenuElements[i]); } // Remove game elements game.removeChild(leftWall); game.removeChild(rightWall); game.removeChild(bottomWall); game.removeChild(scoreText); game.removeChild(nextCirclePreview); game.removeChild(nextCircleText); if (currentCircle) { game.removeChild(currentCircle); currentCircle = null; } if (dropLine) { game.removeChild(dropLine); dropLine = null; } // Remove all circles for (var i = 0; i < circles.length; i++) { game.removeChild(circles[i]); } circles = []; game.removeChild(pauseButton); game.removeChild(pauseButtonText); // Reset game state score = 0; nextCircleType = 1; gameStarted = false; // Add menu elements back for (var i = 0; i < menuElements.length; i++) { game.addChild(menuElements[i]); } } // Movement controls var keys = { up: false, down: false, left: false, right: false }; // Touch/mouse controls var isDragging = false; var lastTouchX = 0; var lastTouchY = 0; function generateNextCircle() { nextCircleType = Math.floor(Math.random() * 4) + 1; // Random circle type 1-4 // Update preview game.removeChild(nextCirclePreview); nextCirclePreview = LK.getAsset('circle' + nextCircleType, { anchorX: 0.5, anchorY: 0.5 }); nextCirclePreview.x = containerX + containerWidth + 100; nextCirclePreview.y = 400; nextCirclePreview.scaleX = 0.6; nextCirclePreview.scaleY = 0.6; game.addChild(nextCirclePreview); } game.down = function (x, y, obj) { if (gameState === 'menu') { // Check if play button was clicked var playButtonBounds = { left: playButton.x - playButton.width * playButton.scaleX / 2, right: playButton.x + playButton.width * playButton.scaleX / 2, top: playButton.y - playButton.height * playButton.scaleY / 2, bottom: playButton.y + playButton.height * playButton.scaleY / 2 }; if (x >= playButtonBounds.left && x <= playButtonBounds.right && y >= playButtonBounds.top && y <= playButtonBounds.bottom) { startGame(); } } else if (gameState === 'playing') { // Check if pause button was clicked var pauseButtonBounds = { left: pauseButton.x - pauseButton.width * pauseButton.scaleX / 2, right: pauseButton.x + pauseButton.width * pauseButton.scaleX / 2, top: pauseButton.y - pauseButton.height * pauseButton.scaleY / 2, bottom: pauseButton.y + pauseButton.height * pauseButton.scaleY / 2 }; if (x >= pauseButtonBounds.left && x <= pauseButtonBounds.right && y >= pauseButtonBounds.top && y <= pauseButtonBounds.bottom) { showPauseMenu(); } else if (x >= containerX + 20 && x <= containerX + containerWidth - 20) { // Create and drop a circle var newCircle = new Circle(nextCircleType); newCircle.x = Math.max(containerX + 50, Math.min(x, containerX + containerWidth - 50)); newCircle.y = containerY + 50; newCircle.velocityY = 2; newCircle.velocityX = 0; newCircle.lastY = newCircle.y; newCircle.lastIntersecting = false; game.addChild(newCircle); circles.push(newCircle); generateNextCircle(); } } else if (gameState === 'paused') { // Handle pause menu interactions var resumeButtonBounds = { left: resumeButton.x - resumeButton.width * resumeButton.scaleX / 2, right: resumeButton.x + resumeButton.width * resumeButton.scaleX / 2, top: resumeButton.y - resumeButton.height * resumeButton.scaleY / 2, bottom: resumeButton.y + resumeButton.height * resumeButton.scaleY / 2 }; var menuButtonBounds = { left: menuButton.x - menuButton.width * menuButton.scaleX / 2, right: menuButton.x + menuButton.width * menuButton.scaleX / 2, top: menuButton.y - menuButton.height * menuButton.scaleY / 2, bottom: menuButton.y + menuButton.height * menuButton.scaleY / 2 }; var restartButtonBounds = { left: restartButton.x - restartButton.width * restartButton.scaleX / 2, right: restartButton.x + restartButton.width * restartButton.scaleX / 2, top: restartButton.y - restartButton.height * restartButton.scaleY / 2, bottom: restartButton.y + restartButton.height * restartButton.scaleY / 2 }; if (x >= resumeButtonBounds.left && x <= resumeButtonBounds.right && y >= resumeButtonBounds.top && y <= resumeButtonBounds.bottom) { resumeGame(); } else if (x >= menuButtonBounds.left && x <= menuButtonBounds.right && y >= menuButtonBounds.top && y <= menuButtonBounds.bottom) { returnToMainMenu(); } else if (x >= restartButtonBounds.left && x <= restartButtonBounds.right && y >= restartButtonBounds.top && y <= restartButtonBounds.bottom) { restartGame(); } } else if (gameState === 'settings') { // Handle settings interactions var decreaseButtonBounds = { left: decreaseButton.x - decreaseButton.width * decreaseButton.scaleX / 2, right: decreaseButton.x + decreaseButton.width * decreaseButton.scaleX / 2, top: decreaseButton.y - decreaseButton.height * decreaseButton.scaleY / 2, bottom: decreaseButton.y + decreaseButton.height * decreaseButton.scaleY / 2 }; var increaseButtonBounds = { left: increaseButton.x - increaseButton.width * increaseButton.scaleX / 2, right: increaseButton.x + increaseButton.width * increaseButton.scaleX / 2, top: increaseButton.y - increaseButton.height * increaseButton.scaleY / 2, bottom: increaseButton.y + increaseButton.height * increaseButton.scaleY / 2 }; var backFromSettingsButtonBounds = { left: backFromSettingsButton.x - backFromSettingsButton.width * backFromSettingsButton.scaleX / 2, right: backFromSettingsButton.x + backFromSettingsButton.width * backFromSettingsButton.scaleX / 2, top: backFromSettingsButton.y - backFromSettingsButton.height * backFromSettingsButton.scaleY / 2, bottom: backFromSettingsButton.y + backFromSettingsButton.height * backFromSettingsButton.scaleY / 2 }; if (x >= decreaseButtonBounds.left && x <= decreaseButtonBounds.right && y >= decreaseButtonBounds.top && y <= decreaseButtonBounds.bottom) { sensitivity = Math.max(0.1, sensitivity - 0.1); storage.sensitivity = sensitivity; sensitivityText.setText('Sensibilidad: ' + Math.round(sensitivity * 100) + '%'); } else if (x >= increaseButtonBounds.left && x <= increaseButtonBounds.right && y >= increaseButtonBounds.top && y <= increaseButtonBounds.bottom) { sensitivity = Math.min(1.0, sensitivity + 0.1); storage.sensitivity = sensitivity; sensitivityText.setText('Sensibilidad: ' + Math.round(sensitivity * 100) + '%'); } else if (x >= backFromSettingsButtonBounds.left && x <= backFromSettingsButtonBounds.right && y >= backFromSettingsButtonBounds.top && y <= backFromSettingsButtonBounds.bottom) { backToPauseMenu(); } } }; game.move = function (x, y, obj) { // No movement tracking needed for Suika Game }; game.up = function (x, y, obj) { if (gameState === 'playing') { isDragging = false; } }; // Suika Game helper functions can be added here if needed // Main game update game.update = function () { // Animate fog elements in menu if (gameState === 'menu') { for (var i = 0; i < fogElements.length; i++) { var fog = fogElements[i]; fog.x += Math.cos(fog.fogDirection) * fog.fogSpeed; fog.y += Math.sin(fog.fogDirection) * fog.fogSpeed * 0.3; fog.alpha += Math.sin(LK.ticks * 0.02 + i) * 0.01; // Keep fog within bounds and wrap around if (fog.x < -100) fog.x = 2148; if (fog.x > 2148) fog.x = -100; if (fog.y < 1000) fog.y = 2200; if (fog.y > 2200) fog.y = 1000; } } if (gameState === 'playing') { // Handle circle merging var mergedCircles = []; var circlesToRemove = []; for (var i = circles.length - 1; i >= 0; i--) { var circle = circles[i]; if (circle.shouldMerge && circle.mergeInto) { // Only add the merged circle once if (mergedCircles.indexOf(circle.mergeInto) === -1) { game.addChild(circle.mergeInto); mergedCircles.push(circle.mergeInto); circles.push(circle.mergeInto); circle.mergeInto.lastY = circle.mergeInto.y; circle.mergeInto.lastIntersecting = false; } // Mark circle for removal circlesToRemove.push(circle); } } // Remove all circles that merged for (var j = 0; j < circlesToRemove.length; j++) { var circleToRemove = circlesToRemove[j]; game.removeChild(circleToRemove); var index = circles.indexOf(circleToRemove); if (index > -1) { circles.splice(index, 1); } } // Check for game over (circle reaches above container mouth) for (var i = 0; i < circles.length; i++) { var circle = circles[i]; // Only check game over if circle has been falling for a while and has low velocity if (circle.y - circle.radius < containerY + 50 && Math.abs(circle.velocityY) < 2 && circle.y > containerY) { // Game over condition - circle reached above container mouth and has settled LK.showGameOver(); return; } } } };
===================================================================
--- original.js
+++ change.js
@@ -58,15 +58,15 @@
if (other !== self) {
var dx = self.x - other.x;
var dy = self.y - other.y;
var distance = Math.sqrt(dx * dx + dy * dy);
- // Use smaller effective radius for non-matching circles to prevent overlap
+ // Use more conservative effective radius to prevent overlap
var effectiveRadius1 = self.radius;
var effectiveRadius2 = other.radius;
if (self.circleType !== other.circleType) {
- // Reduce effective radius by 10% for non-matching circles to create better separation
- effectiveRadius1 *= 0.85;
- effectiveRadius2 *= 0.85;
+ // Reduce effective radius by 15% for non-matching circles to create better separation
+ effectiveRadius1 *= 0.8;
+ effectiveRadius2 *= 0.8;
}
var minDistance = effectiveRadius1 + effectiveRadius2;
if (distance < minDistance && distance > 0) {
// Same size circles merge
@@ -99,29 +99,38 @@
score += self.circleType * 10;
scoreText.setText('Score: ' + score);
return;
}
- // Improved collision response with better physics
+ // Enhanced collision response with better separation
var overlap = minDistance - distance;
- var halfOverlap = overlap * 0.5;
var normalX = dx / distance;
var normalY = dy / distance;
- // For non-matching circles, add extra separation force to prevent overlap
+ // For non-matching circles, add stronger separation force
var separationMultiplier = 1.0;
if (self.circleType !== other.circleType) {
- separationMultiplier = 1.3; // Extra separation for non-matching circles
+ separationMultiplier = 1.5; // Stronger separation for non-matching circles
}
// Separate circles based on their relative masses (size)
var mass1 = self.radius * self.radius; // Mass proportional to area
var mass2 = other.radius * other.radius;
var totalMass = mass1 + mass2;
var ratio1 = mass2 / totalMass; // Heavier objects move less
var ratio2 = mass1 / totalMass;
- // Position correction with mass consideration and extra separation
- self.x += normalX * overlap * ratio1 * separationMultiplier;
- self.y += normalY * overlap * ratio1 * separationMultiplier;
- other.x -= normalX * overlap * ratio2 * separationMultiplier;
- other.y -= normalY * overlap * ratio2 * separationMultiplier;
+ // Enhanced position correction with stronger separation
+ var separationForce = overlap * separationMultiplier;
+ self.x += normalX * separationForce * ratio1;
+ self.y += normalY * separationForce * ratio1;
+ other.x -= normalX * separationForce * ratio2;
+ other.y -= normalY * separationForce * ratio2;
+ // Ensure circles don't overlap by adding minimum separation
+ var minSeparation = 5; // Minimum pixels between circles
+ if (distance < effectiveRadius1 + effectiveRadius2 + minSeparation) {
+ var extraSeparation = (effectiveRadius1 + effectiveRadius2 + minSeparation - distance) * 0.5;
+ self.x += normalX * extraSeparation;
+ self.y += normalY * extraSeparation;
+ other.x -= normalX * extraSeparation;
+ other.y -= normalY * extraSeparation;
+ }
// Realistic velocity exchange with conservation of momentum
var relativeVelocityX = self.velocityX - other.velocityX;
var relativeVelocityY = self.velocityY - other.velocityY;
var separatingVelocity = relativeVelocityX * normalX + relativeVelocityY * normalY;
Niebla terrorifica. In-Game asset. 2d. High contrast. No shadows
marco de boton de inicio sin palabras en el. In-Game asset. 2d. High contrast. No shadows
una estrella hermosa con cara kawai que en su frente diga Dazai. In-Game asset. 2d. High contrast. No shadows
una luna redondita kawai con lentes de sol, en su frente lleva una sinta que dice STAR. In-Game asset. 2d. High contrast. No shadows
sacale el fondo de color negro, dejando solo al personaje con el redondeado rojo
un oso redondo. In-Game asset. 2d. High contrast. No shadows
un monito en una imagen redonda, el monito lleva gafas de sol, es de plastico y tiene una sonrisa. In-Game asset. 2d. High contrast. No shadows
un oso redondito, con una aureola, cara kawai y con los brazitos juntitos como rezando y cantando. In-Game asset. 2d. High contrast. No shadows
Nube realista de noche. In-Game asset. 2d. High contrast. No shadows
un edificio pixel art por la noche. In-Game asset. 2d. High contrast. No shadows
un boton color rojo, dentro de el hay un dibujo de dos flechas como indicando que se mezcla algo. In-Game asset. 2d. High contrast. No shadows
un boton redondo color amarillo, dentro de el hay un dinujo de una corona brillante. In-Game asset. 2d. High contrast. No shadows
una tabla de madera alargada como si fuese de una cocina. In-Game asset. 2d. High contrast. No shadows
Una luna brillante. In-Game asset. 2d. High contrast. No shadows
un corazon pixeleado al estilo de DELTARUNE u Undertale. In-Game asset. 2d. High contrast. No shadows
Jevil, un jefe del capitulo 1 de deltarune, es pixleado y el fondo detras de este es color blanco. In-Game asset. 2d. High contrast. No shadows
un diamante, es pixeleado, solo mejora su calidad, no cambies su forma
haz que este trebol blanco, sea pixeleado de 16x16
Jevil de deltarune capitulo uno siendo golpeado en el estomago echandose un poco para atras aunque con una risa loca en su rostro (pixeleado con fondo blanco). In-Game asset. 2d. High contrast. No shadows
Una caja sorpresa cerrada en blanco y negro pixeleado en 16x16 pixeles, en la caja hay un dibujo de unos ojos y sonrisa de Jevil de deltarune. el fondo de la imagen es de color rojo
un corazon de color blanco con bordes negros, el mismo que lanza Jevil en deltarune capitulo 1, el corazon es pixeleado 16x16 (el fondo de la imagen sea roja). In-Game asset. 2d. High contrast. No shadows
una bomba redonda, color blanco con bordes de color negro, es pixeleada de 16x16 (la imagen tiene fondo rojo). In-Game asset. 2d. High contrast. No shadows