From 9f6d6853ad3888205ac22d2246fef604c512ef85 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Thu, 10 Oct 2019 16:14:38 -0300 Subject: [PATCH] Add LICENSE and README files to the distributions Add WASD key usage to game Signed-off-by: Chris Cromer --- build.gradle | 24 +++++++++++++++++ src/dist/LICENSE | 11 ++++++++ src/dist/README | 26 +++++++++++++++++++ .../java/cl/cromer/azaraka/Constantes.java | 2 +- .../java/cl/cromer/azaraka/object/Player.java | 4 +++ 5 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 src/dist/LICENSE create mode 100644 src/dist/README diff --git a/build.gradle b/build.gradle index a0af9da..16e9224 100644 --- a/build.gradle +++ b/build.gradle @@ -61,6 +61,30 @@ build { dependsOn copyDependencies } +plugins.withType(DistributionPlugin) { + distTar { + // This is a correct assignment and works as intended + //noinspection GroovyAssignabilityCheck + archiveExtension = "tar.gz" + compression = Compression.GZIP + } +} + +task createDocs { + def docs = file("$buildDir/docs") + outputs.dir docs +} + +distributions { + main { + contents { + from(createDocs) { + into 'docs' + } + } + } +} + jar.dependsOn(copyDependencies) tasks.withType(JavaCompile) { diff --git a/src/dist/LICENSE b/src/dist/LICENSE new file mode 100644 index 0000000..fc8dc52 --- /dev/null +++ b/src/dist/LICENSE @@ -0,0 +1,11 @@ +Copyright 2019 Chris Cromer + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/dist/README b/src/dist/README new file mode 100644 index 0000000..a715441 --- /dev/null +++ b/src/dist/README @@ -0,0 +1,26 @@ +Hace miles de años en una edad próspera, un guerrero poderoso llamado Tomak conquistó al continente Azaraka. +Tomak robó las 2 gemas mágicas, la gema de la vida y la gema de la muerte. Usando su magia, manchó las gemas +con el mal causando que el mundo cayera en un edad oscura. La tierra se ha vuelto estéril, los lagos y ríos se +han secado, la gente está enferma y moribunda y no hay esperanza. Tomak ocultó las gemas en la mazmorra de un +castillo para protegerlas. Después de muchos años un mago de una tierra lejana llegó a ayudar Azaraka. +Para restablecer el equilibrio en el mundo el mago debe encontrar las llaves para abrir los cofres que +contienen las gemas y llevarlos al portal mágico para purificar las gemas y salvar Azaraka. Pero Tomak +se ha enterado que el mago llegó a Azaraka y está esperando en la mazmorra para matar el mago. +¿Puede nuestro héroe salvar al mundo, o fracasará y nos dejará para siempre en la oscuridad y la +desesperación? + +¿Cómo jugar? +Mover para arriba: + W ó flecha arriba +Mover para la izquerda: + A ó flecha izquerda +Mover para abajo: + S ó flecha abajo +Mover a la derecha: + D o flecha derecha +Interactuar: + Barra espaciadora + +Pistas: + ¡Al tener una gema el portal se activa! + ¡Al tener las dos gemas la salida se abre! diff --git a/src/main/java/cl/cromer/azaraka/Constantes.java b/src/main/java/cl/cromer/azaraka/Constantes.java index 50869a4..1548317 100644 --- a/src/main/java/cl/cromer/azaraka/Constantes.java +++ b/src/main/java/cl/cromer/azaraka/Constantes.java @@ -37,7 +37,7 @@ public interface Constantes { /** * Whether or not the player should be controlled by AI */ - boolean PLAYER_AI = true; + boolean PLAYER_AI = false; /** * Make logs */ diff --git a/src/main/java/cl/cromer/azaraka/object/Player.java b/src/main/java/cl/cromer/azaraka/object/Player.java index c26bce1..32e8cbe 100644 --- a/src/main/java/cl/cromer/azaraka/object/Player.java +++ b/src/main/java/cl/cromer/azaraka/object/Player.java @@ -95,15 +95,19 @@ public class Player extends Object implements Constantes { } } switch (keyCode) { + case KeyEvent.VK_W: case KeyEvent.VK_UP: moveUp(); break; + case KeyEvent.VK_S: case KeyEvent.VK_DOWN: moveDown(); break; + case KeyEvent.VK_A: case KeyEvent.VK_LEFT: moveLeft(); break; + case KeyEvent.VK_D: case KeyEvent.VK_RIGHT: moveRight(); break;