User prompt
al tocar un botón del menú que suene el sonido "click"
User prompt
cuando estamos en el bosque que la luz del mouse sea menos brillante y que el bosque fuera del circulo sea tan oscuro que parezca negro, y que los assets que estaban regados por el bosque el sean mas pequeños y que estén mas dispersos ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
al presionar el botón "jugar acto 2" se nos muestre poco a poco al asset wendigo y que diga los siguientes diálogos (se pasa al siguiente dialogo al hacer click en la pantalla) wendigo: "Ahhh... ya lo vi... tu dibujo anterior. Sí, sí... lo recuerdo bien. No está mal, no, no... pero le falta algo, ¿no lo notas? Está... vacío. No tiene colores. Todo pálido, todo triste... como un cuerpo sin sangre." wendigo: "Pero no pasa nada, ¡yo sé por qué! Los colores se han escapado... se esconden en la oscuridad. Y para recuperarlos... necesitarás esto." ahí el asset de wendigo se oscurece y poco a poco se muestra el asset "linterna" después de dos segundos se oscurece y poco a poco se vuelve a mostrar a wendigo el cual dice los siguientes diálogos: "Una linterna... tu nueva amiga. Con ella podrás explorar, iluminar los rincones oscuros... y cuando la luz toque un color perdido, ¡oh, lo verás brillar!" wendigo: "Cuando encuentres uno, acércate... recógelo (tócalo)... guárdalo muy cerca de ti. Uno por uno, los colores volverán. Y tus dibujos... tu dibujo serán hermosos... más vivos... más... reales." wendigo: "¿Estás listo? Sígueme, pequeño artista... busquemos lo que falta." ahora el asset de wendigo se oscurece y se muestra de fondo el asset "bosque" y que al pasar el cursor del mouse sobre la pantalla que del cursor haya un circulo grande y solo ahí se vea el bosque porque fuera de ese circulo que todo el asset del bosque se vea oscuro prácticamente negro, y solo se vea con su brillo normal las zonas por donde pasa el cursor del mouse, y en el bosque spawnearan (aparecerán) aleatoriamente los assets: "yellow" "red" "green" "blue" por el bosque, estos también solo se verán cuando el circulo del cursor del mouse pase sobre ellos, pues cuando están fuera del circulo se verán oscuros prácticamente negros como el bosque, y cuando estén adentro del circulo de luz tendremos que presionarlos (clickearlos, tocarlos) y así se sumara un punto a un contador que aparecerá arriba en la pantalla este se llama "COLORES RECOLECTADOS" (sin las comillas) estos son hasta 4, y cada que presionemos uno de los assets ("yellow" "red" "green" "blue") se sumara un punto al contador y cuando toquemos los 4 assets la pantalla se oscurecerá y el contador y lo demás se oscurecerá al igual que la pantalla, ahora se vera poco a poco el asset wendigo y dice los siguientes diálogos: wendigo: "¡Jajaja! ¡Ahí están! ¡Los atrapaste a todos! Qué obediente eres, qué manitas más hábiles tienes..." wendigo: "Los colores te querían, ¿sabes? Gritaban en la oscuridad, pedían que los encontraras" wendigo: "¡Míralos! Brillan, se retuercen, danzan alrededor de ti como pequeñas luces vivas" wendigo: "Tu dibujo ya no estará vacío. Ahora... tendrá carne, tendrá voz" wendigo: "¿Ves? Te dije que sería divertido. Gracias... gracias por traerlos de regreso... ahora podremos jugar más, mucho más..." wendigo: "Has hecho algo hermoso... algo que nunca se olvidará" wendigo: "ahora ya no están solos. Y yo tampoco..." wendigo: "mañana nos volveremos a ver amigo :)" y el asset de wendigo se oscurece hasta que se vuelve a mostrar el menú pero ahora dice "jugar acto 3" (esto porque completamos el acto 2) ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
EN VEZ DE QUE EL TITULO DEL JUEGO APAREZCA COMO APARECE QUE EN SU LUGAR esté el asset: "BLACKPAINT"
User prompt
wendigoleyendo no se oscurece ni se cambia la pantalla al menú principal, arregla esto por favor quiero que el asset wendigoleyendo se oscurezca y se muestre en la pantalla el menú principal por favor ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
ahora el asset de wendigoleyendo no se desvanece y no se muestra el menu, arregla eso! quiero que despues de el ultimo click wendigoleyendo se desvanezca y se muestre el menu pero que ahora diga jugar acto 2, esto en contraste al inicio del juego donde dice jugar acto 1 porque estariamos jugarndo este mismo. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
al inicio del juego que diga "jugar acto 1", y después del ultimo dialogo de wendigoleyendo que en el menú el texto cambie a "jugar acto 2" y que al presionarlo no podamos jugar, quiero programar el segundo acto después, no ahora...
User prompt
NO FUNCIONA, DESPUES DE HACER CLICK CUANDO SE MUESTRA EL ULTIMO DIALOGO NO VOLVEMOS AL MENU DE INICIO CUANDO DEBERIAMOS DE VOLVER, DESPUES DE EL ULTIMO DIALOGO Y QUE HAGAMOS CLICK EN LA PANTALLA QUE VOLVAMOS AL MENU DE INICIO Y QUE el botón de play tiene al lado un mensaje que dice "jugar acto 2" pero que al presionarlo por ahora no pase nada... ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
después de hacer click en el dialogo de wendigoleyendo que su asset se oscurezca y ahora se muestre el menú de inicio pero ahora el botón de play tiene al lado un mensaje que dice "jugar acto 2" simbolizando que comenzaremos el segundo acto. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
después de que "wendigoleyendo" muestre su dialogo, que al hacer click que la imagen se oscurezca poco a poco hasta que se muestre el menú de inicio pero ahora el botón de play tiene al lado un mensaje que dice "jugar acto 2" simbolizando que comenzaremos el segundo acto. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
la función de borrador no funciona, arréglala, y abajo de los diálogos dice "Pensiona ESPACIO para continuar" has que en vez de decir eso diga "Haz CLICK en cualquier lugar para continuar"
User prompt
olvidaste programar que al presionar el botón de espacio pase para el siguiente dialogo
User prompt
al comenzar el juego que haya una pantalla negra con el titulo (texto) BLACK PAINT el botón de "jugar" (con un texto al lado que dice jugar acto 1) (AL PRESIONAR EL BOTON DE JUGAR TODA LA PANTALLA SE PONE EN NEGRO y poco a poco va mostrando el ASSET "wendigo" y se muestra un texto BLANCO que se va escribiendo el cual dice: wendigo: "¡Oh, hola, hola! No tengas miedo... mírame, ¿ves? Soy solo una criatura curiosa que vive entre líneas y colores. Nada peligroso por aquí... je, je." y que nos ponga abajo la letra espacio para pasar al siguiente dialogo (y que al presionarla pase al siguiente dialogo de wendigo) siguiente dialogo de wendigo: "Ahora... tengo una idea. ¿Quieres jugar conmigo? Te prometo que será divertido. El siguiente juego no es de correr ni de pelear... no, no, no. Será algo más fácil un juego de dibujos" que nos ponga abajo la letra espacio para pasar al siguiente dialogo. siguiente dialogo de wendigo: "¿Quieres intentarlo? No te preocupes, no pasara nada malo... solo tienes que dibujar... y seguir jugando conmigo"(que nos ponga abajo la letra espacio para pasar al siguiente dialogo.) después de este dialogo todo se oscurece y se nos presenta el juego estilo paint que hemos estado programando, pero que aparezca un nuevo dialogo (de wendigo) el cual dice lo siguiente: "este es el lienzo, tienes un lápiz, un aerógrafo, un borrador, una cubeta para rellenar lo dibujado, una linea para hacer trazos rectos, un rectángulo, y un circulo, espero te diviertas usándolo, cuando termines tu dibujo puedes mostrármelo presionando el botón enviar!" (que nos ponga abajo la letra espacio para pasar al siguiente dialogo.) programa el boton de enviar a un costado de la pantalla y cuando lo presionemos que se muestre el asset: "wendigoleyendo" y que se nos muestre un nuevo dialogo de wendigo: "bueno... no esta mal... podrías haberlo hecho mejor pero creo que es aceptable... nos vemos mañana nuevo amigo!" y que la imagen se oscurezca poco a poco hasta que se muestre el menú de inicio pero ahora el botón de play tiene al lado un mensaje que dice "jugar acto 2" simbolizando que comenzaremos el segundo acto. por otro lado que en el menú de inicio además de el botón de jugar esté el de "lenguaje" al presionar el de lenguaje que nos de la opción de ingles y español y que si elegimos español que todas las palabras que salgan en el juego estén en español (MENOS EL TITULO DEL JUEGO), pero en cambio si elegimos ingles que todas las palabras del juego estén en ese idioma. ↪💡 Consider importing and using the following plugins: @upit/storage.v1, @upit/tween.v1
User prompt
NO APARECEN LOS DIALOGOS... ARREGLA ESO Y QUE APAREZCAN DE COLOR BLANCO EN LA PARTE DE ABAJO DE LA PANTALLA
User prompt
no aparecen los texto/dialogo... arréglalo. y que el asset de wendigo y wendigo leyendo sean aun mas grandes
User prompt
los dialogos de wendigo y en general de las cinematicas que sean blancos, y que el asset de wendigo y el de wendigoleyendo que sean mucho mas grandes
User prompt
al comenzar el juego que haya una pantalla negra con el titulo (texto) BLACK PAINT el botón de "jugar" (con un texto al lado que dice jugar acto 1) (AL PRESIONAR EL BOTON DE JUGAR TODA LA PANTALLA SE PONE EN NEGRO y poco a poco va mostrando el ASSET "wendigo" y se muestra un texto que se va escribiendo el cual dice: wendigo: "¡Oh, hola, hola! No tengas miedo... mírame, ¿ves? Soy solo una criatura curiosa que vive entre líneas y colores. Nada peligroso por aquí... je, je." y que nos ponga abajo la letra espacio para pasar al siguiente dialogo (y que al presionarla pase al siguiente dialogo de wendigo) siguiente dialogo de wendigo: "Ahora... tengo una idea. ¿Quieres jugar conmigo? Te prometo que será divertido. El siguiente juego no es de correr ni de pelear... no, no, no. Será algo más fácil un juego de dibujos" que nos ponga abajo la letra espacio para pasar al siguiente dialogo. siguiente dialogo de wendigo: "¿Quieres intentarlo? No te preocupes, no pasara nada malo... solo tienes que dibujar... y seguir jugando conmigo"(que nos ponga abajo la letra espacio para pasar al siguiente dialogo.) después de este dialogo todo se oscurece y se nos presenta el juego estilo paint que hemos estado programando, pero que aparezca un nuevo dialogo (de wendigo) el cual dice lo siguiente: "este es el lienzo, tienes un lápiz, un aerógrafo, un borrador, una cubeta para rellenar lo dibujado, una linea para hacer trazos rectos, un rectángulo, y un circulo, espero te diviertas usándolo, cuando termines tu dibujo puedes mostrármelo presionando el botón enviar!" (que nos ponga abajo la letra espacio para pasar al siguiente dialogo.) programa el boton de enviar a un costado de la pantalla y cuando lo presionemos que se muestre el asset: "wendigoleyendo" y que se nos muestre un nuevo dialogo de wendigo: "bueno... no esta mal... podrías haberlo hecho mejor pero creo que es aceptable... nos vemos mañana nuevo amigo!" y que la imagen se oscurezca poco a poco hasta que se muestre el menú de inicio pero ahora el botón de play tiene al lado un mensaje que dice "jugar acto 2" simbolizando que comenzaremos el segundo acto. por otro lado que en el menú de inicio además de el botón de jugar esté el de "lenguaje" al presionar el de lenguaje que nos de la opción de ingles y español y que si elegimos español que todas las palabras que salgan en el juego estén en español (MENOS EL TITULO DEL JUEGO), pero en cambio si elegimos ingles que todas las palabras del juego estén en ese idioma. ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
NO SE QUE PASA PERO TOQUEMOS CUALQUIER COLOR DIBUJA EN NEGRO.... PORFAVOR ARREGLA ESTO NO SE PORQUE DIBUJA EN NEGRO ESO ESTA MAL PORFAVOR AYUDA
User prompt
AL TOCAR EL ASSET "GREEN" QUE DIBUJEMOS EN EL COLOR #7FFF00 AL TOCAR EL ASSET "YELLOW" QUE DIBUJEMOS EN EL COLOR #FFD700 AL TOCAR EL ASSET "RED" QUE DIBUJEMOS EN EL COLOR #FF0000 AL TOCAR EL ASSET "BLUE" QUE DIBUJEMOS EN EL COLOR #0000CD AL TOCAR EL ASSET "BLACK" QUE DIBUJEMOS EN EL COLOR #000000
User prompt
al tocar el asset "yellow" escribe en negro, eso esta MAL, ARREGLALO, ya lo sabes.... si tocamos el asset red dibuja rojo, si tocamos el asset yellow dibuja en amarillo, si tocamos el asset blue dibuja en azul, si dibuja en el asset green dibuja en color verde, si tocamos en asset black dibuja en negro.
User prompt
quiero que escriba en el lienzo blanco del centro, NO en el fondo gris. y los colores no funcionan ya que por mas que seleccionemos uno de los assets no se dibuja en el color que te indique. ARREGLALO.....
User prompt
en los colores agrega el asset "black"ahora esta dinujando en el fondo, no quiero eso, quiero que dibuje en el lienzo por donde pasamos el mouse, y que la cubeta no rellene con puntitos si no de manera completa con el color solido, y que al seleccionar un color DIBUJE CON EL MISMO (ejemplo: que al seleccionar presionando el asset: "blue" que dibuje en color azul, seleccionando el asset "yellow" que dibuje en amarillo, seleccionando el asset: "green" que dibuje en verde, seleccionando el asset "red" que dibuje en rojo, y que al presionar el asset "black" dibuje en negro.
User prompt
lo que has hecho para la cubeta transfiérelo para un nuevo pincel llamado aerógrafo, pero que no solo deje el patrón marcado, si no que vaya pintando y moviéndose hacia donde pintemos, y que la cubeta sea para rellenar el área el perímetro (borde) de algo dibujado, Y que los colores que aparezcan sean representados por los siguientes assets: "red" (al presionarlo que dibujo en color rojo) "blue" (al presionarlo que dibujo en color azul) "green" (al presionarlo que dibujo en color verde) "yellow" (al presionarlo que dibujo en color amarillo) y elimina los botones de deshacer y rehacer. y que haya un fondo gris y podamos pintar en un lienzo blanco el cual es apenas mas pequeño que el fondo (que no podamos pintar en el fondo, solo en el lienzo) también hay un bug en donde se oscurece la pantalla, arregla eso, y otro bug en el cual se hacen puntos solos, sin que yo haga nada. y hay un poco de lag cuando dibujamos mucho, no quiero que haya lag... y que cada que presionemos un boton o asset suene el asset "click". por otro lado, que ningún dibujo pueda estar arriba de los botones, NINGUNO.
User prompt
has que no se pueda dibujar sobre los botones, y que los colores seleccionables sean los siguientes: Celeste Rosa Marrón Blanco Negro Rojo Azul Amarillo Verde Naranja Violeta. también el lienzo que sea blanco (se ve un poco oscuro y no me gusta eso), y has que los textos estén el español, y elimina el texto: "TERROR PAINT" Y TAMBIEN ELIMINA LA HERRAMINETA: "Brush" y elimina "Fill" y añade la cubeta de relleno como algo que rellena todo lo que este adentro de un dibujo, y añade una flecha para ir atrás (deshacer una accion) y otra para adelante (para rehacer una accion) y que la flecha para adelante solo funcione si antes se uso la de ir atrás porque si no no tendría sentido,
User prompt
Please fix the bug: 'ReferenceError: horrorEffect is not defined' in or related to this line: 'horrorEffect.increaseIntensity();' Line Number: 191
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var BrushStroke = Container.expand(function (x, y, color, size) { var self = Container.call(this); var stroke = self.attachAsset('brushStroke', { anchorX: 0.5, anchorY: 0.5, tint: color, scaleX: size / 20, scaleY: size / 20 }); self.x = x; self.y = y; self.originalColor = color; self.corruptionLevel = 0; self.corrupt = function () { self.corruptionLevel += 0.1; if (self.corruptionLevel > 1) self.corruptionLevel = 1; var red = Math.floor(color >> 16 & 0xFF); var green = Math.floor(color >> 8 & 0xFF); var blue = Math.floor(color & 0xFF); red = Math.floor(red * (1 - self.corruptionLevel * 0.5)); green = Math.floor(green * (1 - self.corruptionLevel * 0.7)); blue = Math.floor(blue * (1 - self.corruptionLevel * 0.3)); var corruptedColor = red << 16 | green << 8 | blue; stroke.tint = corruptedColor; if (Math.random() < self.corruptionLevel * 0.1) { self.x += (Math.random() - 0.5) * 20; self.y += (Math.random() - 0.5) * 20; } }; return self; }); var ColorSwatch = Container.expand(function (color, x, y) { var self = Container.call(this); self.color = color; var swatch = self.attachAsset('colorSwatch', { anchorX: 0.5, anchorY: 0.5, tint: color }); self.x = x; self.y = y; self.down = function (x, y, obj) { currentColor = self.color; updateColorSelection(); }; return self; }); var DrawingTool = Container.expand(function (toolType, x, y) { var self = Container.call(this); self.toolType = toolType; self.isActive = false; var buttonBg = self.attachAsset('toolButton', { anchorX: 0.5, anchorY: 0.5 }); var toolLabel = new Text2(toolType, { size: 18, fill: 0xFFFFFF }); toolLabel.anchor.set(0.5, 0.5); self.addChild(toolLabel); self.x = x; self.y = y; self.setActive = function (active) { self.isActive = active; if (active) { buttonBg.tint = 0x666666; } else { buttonBg.tint = 0x333333; } }; self.down = function (x, y, obj) { currentTool = self.toolType; updateToolSelection(); }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x222222 }); /**** * Game Code ****/ // Drawing canvas var drawingCanvas = game.addChild(LK.getAsset('canvas', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 900 })); // Tool palette var tools = ['Lápiz', 'Borrador', 'Cubeta', 'Línea', 'Rectángulo', 'Círculo', 'Deshacer', 'Rehacer']; var toolButtons = []; var currentTool = 'Lápiz'; for (var i = 0; i < tools.length; i++) { var toolButton = new DrawingTool(tools[i], 150 + i * 90, 320); game.addChild(toolButton); toolButtons.push(toolButton); } // Color palette - Celeste, Rosa, Marrón, Blanco, Negro, Rojo, Azul, Amarillo, Verde, Naranja, Violeta var colors = [0x87CEEB, 0xFFB6C1, 0x8B4513, 0xFFFFFF, 0x000000, 0xFF0000, 0x0000FF, 0xFFFF00, 0x00FF00, 0xFF8000, 0x8A2BE2]; var colorSwatches = []; var currentColor = 0x000000; for (var j = 0; j < colors.length; j++) { var colorSwatch = new ColorSwatch(colors[j], 150 + j * 80, 450); game.addChild(colorSwatch); colorSwatches.push(colorSwatch); } // Drawing variables var isDrawing = false; var lastDrawX = 0; var lastDrawY = 0; var brushSize = 20; var strokes = []; var horrorTimer = 0; var corruptionTimer = 0; var shapeStartX = 0; var shapeStartY = 0; var isDrawingShape = false; // Drawing history for undo/redo var strokeHistory = []; var historyIndex = -1; var maxHistory = 50; function saveState() { historyIndex++; if (historyIndex < strokeHistory.length) { strokeHistory.splice(historyIndex); } var currentState = []; for (var i = 0; i < strokes.length; i++) { currentState.push({ x: strokes[i].x, y: strokes[i].y, color: strokes[i].originalColor, size: strokes[i].children[0].scaleX * 20 }); } strokeHistory.push(currentState); if (strokeHistory.length > maxHistory) { strokeHistory.shift(); historyIndex--; } } function undoAction() { if (historyIndex > 0) { historyIndex--; restoreState(strokeHistory[historyIndex]); } } function redoAction() { if (historyIndex < strokeHistory.length - 1) { historyIndex++; restoreState(strokeHistory[historyIndex]); } } function restoreState(state) { // Clear current strokes for (var i = 0; i < strokes.length; i++) { strokes[i].destroy(); } strokes = []; // Restore strokes from state for (var j = 0; j < state.length; j++) { var strokeData = state[j]; var stroke = new BrushStroke(strokeData.x, strokeData.y, strokeData.color, strokeData.size); game.addChild(stroke); strokes.push(stroke); } } // Initialize with empty state saveState(); // Functions function updateToolSelection() { for (var i = 0; i < toolButtons.length; i++) { toolButtons[i].setActive(toolButtons[i].toolType === currentTool); } } function updateColorSelection() { // Visual feedback for color selection could be added here } function isPointInCanvas(x, y) { var canvasLeft = drawingCanvas.x - drawingCanvas.width * 0.5; var canvasRight = drawingCanvas.x + drawingCanvas.width * 0.5; var canvasTop = drawingCanvas.y - drawingCanvas.height * 0.5; var canvasBottom = drawingCanvas.y + drawingCanvas.height * 0.5; return x >= canvasLeft && x <= canvasRight && y >= canvasTop && y <= canvasBottom; } function isPointInButton(x, y) { // Check tool buttons for (var i = 0; i < toolButtons.length; i++) { var button = toolButtons[i]; var buttonLeft = button.x - 40; var buttonRight = button.x + 40; var buttonTop = button.y - 40; var buttonBottom = button.y + 40; if (x >= buttonLeft && x <= buttonRight && y >= buttonTop && y <= buttonBottom) { return true; } } // Check color swatches for (var j = 0; j < colorSwatches.length; j++) { var swatch = colorSwatches[j]; var swatchLeft = swatch.x - 40; var swatchRight = swatch.x + 40; var swatchTop = swatch.y - 40; var swatchBottom = swatch.y + 40; if (x >= swatchLeft && x <= swatchRight && y >= swatchTop && y <= swatchBottom) { return true; } } return false; } function addBrushStroke(x, y) { if (isPointInCanvas(x, y)) { var stroke = new BrushStroke(x, y, currentColor, brushSize); game.addChild(stroke); strokes.push(stroke); if (Math.random() < 0.3) { LK.getSound('drawSound').play(); } } } function floodFill(startX, startY, fillColor) { // Simple flood fill - fill area around click point var fillRadius = 100; var fillSteps = 20; for (var i = 0; i < fillSteps; i++) { var angle = i / fillSteps * 2 * Math.PI; for (var r = 10; r < fillRadius; r += 15) { var fillX = startX + Math.cos(angle) * r; var fillY = startY + Math.sin(angle) * r; if (isPointInCanvas(fillX, fillY)) { var fillStroke = new BrushStroke(fillX, fillY, fillColor, brushSize * 0.8); game.addChild(fillStroke); strokes.push(fillStroke); } } } } function corruptDrawing() { for (var i = 0; i < strokes.length; i++) { if (Math.random() < 0.1) { strokes[i].corrupt(); } } } function triggerHorrorEvent() { if (Math.random() < 0.5) { LK.getSound('horrorAmbient').play(); } // Randomly corrupt some strokes corruptDrawing(); // Change canvas tint slightly if (Math.random() < 0.3) { var tintAmount = 0.05; var currentTint = drawingCanvas.tint || 0xffffff; var red = Math.floor((currentTint >> 16 & 0xFF) * (1 - tintAmount)); var green = Math.floor((currentTint >> 8 & 0xFF) * (1 - tintAmount * 0.5)); var blue = Math.floor((currentTint & 0xFF) * (1 - tintAmount * 0.3)); drawingCanvas.tint = red << 16 | green << 8 | blue; } } // Initialize tool selection updateToolSelection(); // Event handlers game.down = function (x, y, obj) { if (isPointInButton(x, y)) { return; } if (currentTool === 'Deshacer') { undoAction(); return; } else if (currentTool === 'Rehacer') { redoAction(); return; } if (isPointInCanvas(x, y)) { if (currentTool === 'Línea' || currentTool === 'Rectángulo' || currentTool === 'Círculo') { isDrawingShape = true; shapeStartX = x; shapeStartY = y; } else { isDrawing = true; } lastDrawX = x; lastDrawY = y; if (currentTool === 'Lápiz') { saveState(); addBrushStroke(x, y); } else if (currentTool === 'Borrador') { saveState(); // Find and remove nearby strokes for (var i = strokes.length - 1; i >= 0; i--) { var stroke = strokes[i]; var distance = Math.sqrt((stroke.x - x) * (stroke.x - x) + (stroke.y - y) * (stroke.y - y)); if (distance < brushSize) { stroke.destroy(); strokes.splice(i, 1); } } } else if (currentTool === 'Cubeta') { saveState(); floodFill(x, y, currentColor); } } }; game.move = function (x, y, obj) { if (isDrawing && isPointInCanvas(x, y)) { if (currentTool === 'Lápiz') { // Draw line between last position and current position var distance = Math.sqrt((x - lastDrawX) * (x - lastDrawX) + (y - lastDrawY) * (y - lastDrawY)); var steps = Math.floor(distance / 10); for (var i = 0; i <= steps; i++) { var interpolatedX = lastDrawX + (x - lastDrawX) * (i / steps); var interpolatedY = lastDrawY + (y - lastDrawY) * (i / steps); addBrushStroke(interpolatedX, interpolatedY); } } else if (currentTool === 'Borrador') { // Continue erasing for (var j = strokes.length - 1; j >= 0; j--) { var stroke = strokes[j]; var distance = Math.sqrt((stroke.x - x) * (stroke.x - x) + (stroke.y - y) * (stroke.y - y)); if (distance < brushSize) { stroke.destroy(); strokes.splice(j, 1); } } } lastDrawX = x; lastDrawY = y; } }; game.up = function (x, y, obj) { if (isDrawingShape && isPointInCanvas(x, y)) { saveState(); if (currentTool === 'Línea') { // Draw line from start to end var distance = Math.sqrt((x - shapeStartX) * (x - shapeStartX) + (y - shapeStartY) * (y - shapeStartY)); var steps = Math.floor(distance / 5); for (var i = 0; i <= steps; i++) { var lineX = shapeStartX + (x - shapeStartX) * (i / steps); var lineY = shapeStartY + (y - shapeStartY) * (i / steps); var lineStroke = new BrushStroke(lineX, lineY, currentColor, brushSize); game.addChild(lineStroke); strokes.push(lineStroke); } } else if (currentTool === 'Rectángulo') { // Draw rectangle outline var rectWidth = Math.abs(x - shapeStartX); var rectHeight = Math.abs(y - shapeStartY); var minX = Math.min(shapeStartX, x); var minY = Math.min(shapeStartY, y); // Top and bottom lines for (var j = 0; j <= rectWidth; j += 10) { var topStroke = new BrushStroke(minX + j, minY, currentColor, brushSize); var bottomStroke = new BrushStroke(minX + j, minY + rectHeight, currentColor, brushSize); game.addChild(topStroke); game.addChild(bottomStroke); strokes.push(topStroke); strokes.push(bottomStroke); } // Left and right lines for (var k = 0; k <= rectHeight; k += 10) { var leftStroke = new BrushStroke(minX, minY + k, currentColor, brushSize); var rightStroke = new BrushStroke(minX + rectWidth, minY + k, currentColor, brushSize); game.addChild(leftStroke); game.addChild(rightStroke); strokes.push(leftStroke); strokes.push(rightStroke); } } else if (currentTool === 'Círculo') { // Draw circle var centerX = (shapeStartX + x) / 2; var centerY = (shapeStartY + y) / 2; var radius = Math.sqrt((x - shapeStartX) * (x - shapeStartX) + (y - shapeStartY) * (y - shapeStartY)) / 2; var circumference = 2 * Math.PI * radius; var steps = Math.floor(circumference / 8); for (var l = 0; l < steps; l++) { var angle = l / steps * 2 * Math.PI; var circleX = centerX + Math.cos(angle) * radius; var circleY = centerY + Math.sin(angle) * radius; var circleStroke = new BrushStroke(circleX, circleY, currentColor, brushSize); game.addChild(circleStroke); strokes.push(circleStroke); } } } isDrawing = false; isDrawingShape = false; }; // Start ambient music LK.setTimeout(function () { LK.playMusic('creepyMusic'); }, 2000); // Main game loop game.update = function () { horrorTimer++; corruptionTimer++; // Trigger horror events based on drawing activity and time if (horrorTimer > 300 && strokes.length > 10) { // 5 seconds at 60fps if (Math.random() < 0.02) { // 2% chance per frame triggerHorrorEvent(); horrorTimer = 0; } } // Gradual corruption over time if (corruptionTimer > 180 && strokes.length > 0) { // 3 seconds if (Math.random() < 0.01) { corruptDrawing(); corruptionTimer = 0; } } // Make some strokes occasionally twitch for (var i = 0; i < strokes.length; i++) { if (strokes[i].corruptionLevel > 0.5 && Math.random() < 0.001) { var currentStroke = strokes[i]; tween(currentStroke, { rotation: (Math.random() - 0.5) * 0.2, scaleX: 1 + (Math.random() - 0.5) * 0.1, scaleY: 1 + (Math.random() - 0.5) * 0.1 }, { duration: 100, easing: tween.easeOut, onFinish: function onFinish() { tween(currentStroke, { rotation: 0, scaleX: 1, scaleY: 1 }, { duration: 200 }); } }); } } };
===================================================================
--- original.js
+++ change.js
@@ -102,22 +102,22 @@
x: 1024,
y: 900
}));
// Tool palette
-var tools = ['Pen', 'Brush', 'Eraser', 'Fill', 'Line', 'Rect', 'Circle'];
+var tools = ['Lápiz', 'Borrador', 'Cubeta', 'Línea', 'Rectángulo', 'Círculo', 'Deshacer', 'Rehacer'];
var toolButtons = [];
-var currentTool = 'Pen';
+var currentTool = 'Lápiz';
for (var i = 0; i < tools.length; i++) {
- var toolButton = new DrawingTool(tools[i], 150 + i * 100, 300);
+ var toolButton = new DrawingTool(tools[i], 150 + i * 90, 320);
game.addChild(toolButton);
toolButtons.push(toolButton);
}
-// Color palette
-var colors = [0x000000, 0xff0000, 0x00ff00, 0x0000ff, 0xffff00, 0xff8000, 0x8000ff, 0xffffff];
+// Color palette - Celeste, Rosa, Marrón, Blanco, Negro, Rojo, Azul, Amarillo, Verde, Naranja, Violeta
+var colors = [0x87CEEB, 0xFFB6C1, 0x8B4513, 0xFFFFFF, 0x000000, 0xFF0000, 0x0000FF, 0xFFFF00, 0x00FF00, 0xFF8000, 0x8A2BE2];
var colorSwatches = [];
var currentColor = 0x000000;
for (var j = 0; j < colors.length; j++) {
- var colorSwatch = new ColorSwatch(colors[j], 150 + j * 100, 420);
+ var colorSwatch = new ColorSwatch(colors[j], 150 + j * 80, 450);
game.addChild(colorSwatch);
colorSwatches.push(colorSwatch);
}
// Drawing variables
@@ -130,17 +130,60 @@
var corruptionTimer = 0;
var shapeStartX = 0;
var shapeStartY = 0;
var isDrawingShape = false;
-// UI Elements
-var titleText = new Text2('TERROR PAINT', {
- size: 60,
- fill: 0xFF0000
-});
-titleText.anchor.set(0.5, 0);
-titleText.x = 1024;
-titleText.y = 50;
-game.addChild(titleText);
+// Drawing history for undo/redo
+var strokeHistory = [];
+var historyIndex = -1;
+var maxHistory = 50;
+function saveState() {
+ historyIndex++;
+ if (historyIndex < strokeHistory.length) {
+ strokeHistory.splice(historyIndex);
+ }
+ var currentState = [];
+ for (var i = 0; i < strokes.length; i++) {
+ currentState.push({
+ x: strokes[i].x,
+ y: strokes[i].y,
+ color: strokes[i].originalColor,
+ size: strokes[i].children[0].scaleX * 20
+ });
+ }
+ strokeHistory.push(currentState);
+ if (strokeHistory.length > maxHistory) {
+ strokeHistory.shift();
+ historyIndex--;
+ }
+}
+function undoAction() {
+ if (historyIndex > 0) {
+ historyIndex--;
+ restoreState(strokeHistory[historyIndex]);
+ }
+}
+function redoAction() {
+ if (historyIndex < strokeHistory.length - 1) {
+ historyIndex++;
+ restoreState(strokeHistory[historyIndex]);
+ }
+}
+function restoreState(state) {
+ // Clear current strokes
+ for (var i = 0; i < strokes.length; i++) {
+ strokes[i].destroy();
+ }
+ strokes = [];
+ // Restore strokes from state
+ for (var j = 0; j < state.length; j++) {
+ var strokeData = state[j];
+ var stroke = new BrushStroke(strokeData.x, strokeData.y, strokeData.color, strokeData.size);
+ game.addChild(stroke);
+ strokes.push(stroke);
+ }
+}
+// Initialize with empty state
+saveState();
// Functions
function updateToolSelection() {
for (var i = 0; i < toolButtons.length; i++) {
toolButtons[i].setActive(toolButtons[i].toolType === currentTool);
@@ -155,8 +198,33 @@
var canvasTop = drawingCanvas.y - drawingCanvas.height * 0.5;
var canvasBottom = drawingCanvas.y + drawingCanvas.height * 0.5;
return x >= canvasLeft && x <= canvasRight && y >= canvasTop && y <= canvasBottom;
}
+function isPointInButton(x, y) {
+ // Check tool buttons
+ for (var i = 0; i < toolButtons.length; i++) {
+ var button = toolButtons[i];
+ var buttonLeft = button.x - 40;
+ var buttonRight = button.x + 40;
+ var buttonTop = button.y - 40;
+ var buttonBottom = button.y + 40;
+ if (x >= buttonLeft && x <= buttonRight && y >= buttonTop && y <= buttonBottom) {
+ return true;
+ }
+ }
+ // Check color swatches
+ for (var j = 0; j < colorSwatches.length; j++) {
+ var swatch = colorSwatches[j];
+ var swatchLeft = swatch.x - 40;
+ var swatchRight = swatch.x + 40;
+ var swatchTop = swatch.y - 40;
+ var swatchBottom = swatch.y + 40;
+ if (x >= swatchLeft && x <= swatchRight && y >= swatchTop && y <= swatchBottom) {
+ return true;
+ }
+ }
+ return false;
+}
function addBrushStroke(x, y) {
if (isPointInCanvas(x, y)) {
var stroke = new BrushStroke(x, y, currentColor, brushSize);
game.addChild(stroke);
@@ -165,8 +233,25 @@
LK.getSound('drawSound').play();
}
}
}
+function floodFill(startX, startY, fillColor) {
+ // Simple flood fill - fill area around click point
+ var fillRadius = 100;
+ var fillSteps = 20;
+ for (var i = 0; i < fillSteps; i++) {
+ var angle = i / fillSteps * 2 * Math.PI;
+ for (var r = 10; r < fillRadius; r += 15) {
+ var fillX = startX + Math.cos(angle) * r;
+ var fillY = startY + Math.sin(angle) * r;
+ if (isPointInCanvas(fillX, fillY)) {
+ var fillStroke = new BrushStroke(fillX, fillY, fillColor, brushSize * 0.8);
+ game.addChild(fillStroke);
+ strokes.push(fillStroke);
+ }
+ }
+ }
+}
function corruptDrawing() {
for (var i = 0; i < strokes.length; i++) {
if (Math.random() < 0.1) {
strokes[i].corrupt();
@@ -192,21 +277,33 @@
// Initialize tool selection
updateToolSelection();
// Event handlers
game.down = function (x, y, obj) {
+ if (isPointInButton(x, y)) {
+ return;
+ }
+ if (currentTool === 'Deshacer') {
+ undoAction();
+ return;
+ } else if (currentTool === 'Rehacer') {
+ redoAction();
+ return;
+ }
if (isPointInCanvas(x, y)) {
- if (currentTool === 'Line' || currentTool === 'Rect' || currentTool === 'Circle') {
+ if (currentTool === 'Línea' || currentTool === 'Rectángulo' || currentTool === 'Círculo') {
isDrawingShape = true;
shapeStartX = x;
shapeStartY = y;
} else {
isDrawing = true;
}
lastDrawX = x;
lastDrawY = y;
- if (currentTool === 'Pen' || currentTool === 'Brush') {
+ if (currentTool === 'Lápiz') {
+ saveState();
addBrushStroke(x, y);
- } else if (currentTool === 'Eraser') {
+ } else if (currentTool === 'Borrador') {
+ saveState();
// Find and remove nearby strokes
for (var i = strokes.length - 1; i >= 0; i--) {
var stroke = strokes[i];
var distance = Math.sqrt((stroke.x - x) * (stroke.x - x) + (stroke.y - y) * (stroke.y - y));
@@ -214,28 +311,26 @@
stroke.destroy();
strokes.splice(i, 1);
}
}
- } else if (currentTool === 'Fill') {
- // Simple fill - add a larger brush stroke
- var fillStroke = new BrushStroke(x, y, currentColor, brushSize * 3);
- game.addChild(fillStroke);
- strokes.push(fillStroke);
+ } else if (currentTool === 'Cubeta') {
+ saveState();
+ floodFill(x, y, currentColor);
}
}
};
game.move = function (x, y, obj) {
if (isDrawing && isPointInCanvas(x, y)) {
- if (currentTool === 'Pen' || currentTool === 'Brush') {
+ if (currentTool === 'Lápiz') {
// Draw line between last position and current position
var distance = Math.sqrt((x - lastDrawX) * (x - lastDrawX) + (y - lastDrawY) * (y - lastDrawY));
var steps = Math.floor(distance / 10);
for (var i = 0; i <= steps; i++) {
var interpolatedX = lastDrawX + (x - lastDrawX) * (i / steps);
var interpolatedY = lastDrawY + (y - lastDrawY) * (i / steps);
addBrushStroke(interpolatedX, interpolatedY);
}
- } else if (currentTool === 'Eraser') {
+ } else if (currentTool === 'Borrador') {
// Continue erasing
for (var j = strokes.length - 1; j >= 0; j--) {
var stroke = strokes[j];
var distance = Math.sqrt((stroke.x - x) * (stroke.x - x) + (stroke.y - y) * (stroke.y - y));
@@ -250,9 +345,10 @@
}
};
game.up = function (x, y, obj) {
if (isDrawingShape && isPointInCanvas(x, y)) {
- if (currentTool === 'Line') {
+ saveState();
+ if (currentTool === 'Línea') {
// Draw line from start to end
var distance = Math.sqrt((x - shapeStartX) * (x - shapeStartX) + (y - shapeStartY) * (y - shapeStartY));
var steps = Math.floor(distance / 5);
for (var i = 0; i <= steps; i++) {
@@ -261,9 +357,9 @@
var lineStroke = new BrushStroke(lineX, lineY, currentColor, brushSize);
game.addChild(lineStroke);
strokes.push(lineStroke);
}
- } else if (currentTool === 'Rect') {
+ } else if (currentTool === 'Rectángulo') {
// Draw rectangle outline
var rectWidth = Math.abs(x - shapeStartX);
var rectHeight = Math.abs(y - shapeStartY);
var minX = Math.min(shapeStartX, x);
@@ -285,9 +381,9 @@
game.addChild(rightStroke);
strokes.push(leftStroke);
strokes.push(rightStroke);
}
- } else if (currentTool === 'Circle') {
+ } else if (currentTool === 'Círculo') {
// Draw circle
var centerX = (shapeStartX + x) / 2;
var centerY = (shapeStartY + y) / 2;
var radius = Math.sqrt((x - shapeStartX) * (x - shapeStartX) + (y - shapeStartY) * (y - shapeStartY)) / 2;