domingo, 6 de marzo de 2016

Nerdy Run Día 8 - Creando un mini-juego de Preguntas | Nerdy Run Day 8 - Creating a Quiz mini-game

Español | English

Día 8. Para hoy tenía planeado crear el 3° mini-juego que iba a ser una juego de preguntas y respuestas, con orientación a la química. El problema de este tipo de mini-juego no es crearlo en sí sino no hacerlo repetitivo. No queremos que se muestren siempre las mismas preguntas en el mismo orden sino el jugador no tiene que pensar sino recordar la secuencia de las respuestas.

Los elementos básicos del juego son: 4 botones y un texto. La idea del juego es que el texto muestre la palabra de un elemento químico y uno debe clickear en su símbolo correspondiente, luego se puede hacer algo como poner "vidas" en las que si el jugador erra, se restan. Pero de nuevo, lo importante es la aleatoriedad, queremos que se muestren preguntas distintas cada vez.

Para elegir los elementos elegí aquellos cuyos símbolos químicos se parecían a otros o podrían confundir al jugador. Como por ejemplo, para el Hierro (Iron en Inglés) el símbolo es Fe, pero para los que no lo conoce, se pueden confundir con Ir, el símbolo de Iridio. La idea también era de crear una lista de 5 elementos que serían las preguntas "fáciles", a medida que vamos avanzando podemos cambiar a las preguntas más "difíciles".

Para crear el juego primero creé 2 Array, una que contenía el nombre de los elementos y otra que contenía todos los símbolos que van a aparecer en pantalla (1 opción correcta y 3 falsas para cada elemento). El hecho de crear Arrays es para manejar más adecuadamente la cantidad de variables y también para poder mostrar la pregunta y sus opciones.

Para crear esta situación, primero debemos pensar como va a ser la lógica del juego: carga el juego, y depende la pregunta que nos dan, varían los distintas respuestas. Por lo que las respuestas dependen de que pregunta se haga. Esto nos permite entonces poder crear una declaración Switch en la que analizaremos que valor vuelve para si nosotros devolver las opciones adecuadas.




Lo último que me queda por terminar es el checkeo de la solución, es decir, si al clickear en una solución esta es correcta o errónea. Luego de terminar esto haré un tutorial sobre como crear este mini-juego de forma más técnica.

-L


------------------------------------------------------------------------------
English

Day 8. For today I've planned to create the 3° mini-game which is going to be a Quiz game, chemistry oriented. The problem with this kind of game isn't create it but to not make it repetitive. We don't want the same questions to be showned always in the same order because the player rather thank thinking, needs to memorize the sequence of the answers.

The basic elements of the game are: 4 buttons and one text. The idea of the game is that a text shows the name of a chemical element and one has to click on the element's symbol, then, one can add "lives" on which if the player fails, they began to disappear. But again, the important thing is the randomness, we want different questions every time.

To select which elements I would use I selected those elements whose chemical symbol is similar to others. For example, the symbol of element Iron is Fe, but for those who don't know this, they may be tricked with the symbol Ir, which is the symbol of Iridium. The idea is also to create a list of 5 elements which would be the "easy" questions, as the player goes on, we can use another list of more "difficult" elements.

For the game I created 2 Arrays, one contains the name of the elements and the other has all the symbols that would be displayed (1 correct answer and 3 fake answers for each element). The fact of creating the Arrays is to handle in the right way all the variables and also to later be able to display the question and it's options.

To create this situation, we first need to think in the logic of the game: load the game, according the element given, the options vary. So the options depend on which question is asked. This let us make a Switch Statement in which we will analyze which value we are given in order to show the right options.

 


Finally, what I need to finish the mini-game is to finish the check-answer function, in other words, to see if the option clicked is the right one. After finishing this mini-game I'll create a more technical tutorial to create this type of game.

-L

No hay comentarios.:

Publicar un comentario