raa0121 6 gadi atpakaļ
revīzija
684f963f11

+ 125 - 0
.gitignore

@@ -0,0 +1,125 @@
+## Java
+
+*.class
+*.war
+*.ear
+hs_err_pid*
+
+## Robovm
+/ios/robovm-build/
+
+## GWT
+/html/war/
+/html/gwt-unitCache/
+.apt_generated/
+.gwt/
+gwt-unitCache/
+www-test/
+.gwt-tmp/
+
+## Android Studio and Intellij and Android in general
+/android/libs/armeabi/
+/android/libs/armeabi-v7a/
+/android/libs/arm64-v8a/
+/android/libs/x86/
+/android/libs/x86_64/
+/android/gen/
+.idea/
+*.ipr
+*.iws
+*.iml
+/android/out/
+com_crashlytics_export_strings.xml
+
+## Eclipse
+
+.classpath
+.project
+.metadata/
+/android/bin/
+/core/bin/
+/desktop/bin/
+/html/bin/
+/ios/bin/
+/ios-moe/bin/
+*.tmp
+*.bak
+*.swp
+*~.nib
+.settings/
+.loadpath
+.externalToolBuilders/
+*.launch
+
+## NetBeans
+
+/nbproject/private/
+/android/nbproject/private/
+/core/nbproject/private/
+/desktop/nbproject/private/
+/html/nbproject/private/
+/ios/nbproject/private/
+/ios-moe/nbproject/private/
+
+/build/
+/android/build/
+/core/build/
+/desktop/build/
+/html/build/
+/ios/build/
+/ios-moe/build/
+
+/nbbuild/
+/android/nbbuild/
+/core/nbbuild/
+/desktop/nbbuild/
+/html/nbbuild/
+/ios/nbbuild/
+/ios-moe/nbbuild/
+
+/dist/
+/android/dist/
+/core/dist/
+/desktop/dist/
+/html/dist/
+/ios/dist/
+/ios-moe/dist/
+
+/nbdist/
+/android/nbdist/
+/core/nbdist/
+/desktop/nbdist/
+/html/nbdist/
+/ios/nbdist/
+/ios-moe/nbdist/
+
+nbactions.xml
+nb-configuration.xml
+
+## Gradle
+
+/local.properties
+.gradle/
+gradle-app.setting
+/build/
+/android/build/
+/core/build/
+/desktop/build/
+/html/build/
+/ios/build/
+/ios-moe/build/
+
+## OS Specific
+.DS_Store
+Thumbs.db
+
+## iOS
+/ios/xcode/*.xcodeproj/*
+!/ios/xcode/*.xcodeproj/xcshareddata
+!/ios/xcode/*.xcodeproj/project.pbxproj
+/ios/xcode/native/
+
+/ios-moe/xcode/*.xcodeproj/*
+!/ios-moe/xcode/*.xcodeproj/xcshareddata
+!/ios-moe/xcode/*.xcodeproj/project.pbxproj
+/ios-moe/xcode/native/

+ 84 - 0
build.gradle

@@ -0,0 +1,84 @@
+buildscript {
+    
+
+    repositories {
+        mavenLocal()
+        mavenCentral()
+        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
+        jcenter()
+    }
+    dependencies {
+        classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
+        
+
+    }
+}
+
+allprojects {
+    apply plugin: "eclipse"
+    apply plugin: "idea"
+
+    version = '1.0'
+    ext {
+        appName = "DuelSimulation"
+        gdxVersion = '1.9.7'
+        roboVMVersion = '2.3.1'
+        box2DLightsVersion = '1.4'
+        ashleyVersion = '1.7.0'
+        aiVersion = '1.8.0'
+    }
+
+    repositories {
+        mavenLocal()
+        mavenCentral()
+        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
+        maven { url "https://oss.sonatype.org/content/repositories/releases/" }
+    }
+}
+
+project(":desktop") {
+    apply plugin: "java"
+
+
+    dependencies {
+        compile project(":core")
+        compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
+        compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
+        compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
+        compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
+        
+    }
+}
+
+project(":html") {
+    apply plugin: "gwt"
+    apply plugin: "war"
+
+
+    dependencies {
+        compile project(":core")
+        compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
+        compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
+        compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
+        compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion:sources"
+        compile "com.badlogicgames.gdx:gdx-box2d-gwt:$gdxVersion:sources"
+        
+    }
+}
+
+project(":core") {
+    apply plugin: "java"
+
+
+    dependencies {
+        compile "com.badlogicgames.gdx:gdx:$gdxVersion"
+        compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
+        compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
+        compile 'io.reactivex.rxjava2:rxkotlin:2.1.0'
+        
+    }
+}
+
+tasks.eclipse.doLast {
+    delete ".project"
+}

BIN
core/assets/fonts/Cica-Regular.ttf


BIN
core/assets/player.png


BIN
core/assets/teki.png


BIN
core/assets/tile.png


+ 37 - 0
core/build.gradle

@@ -0,0 +1,37 @@
+apply plugin: "java"
+apply plugin: 'kotlin'
+
+sourceCompatibility = 1.6
+[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
+
+sourceSets.main.java.srcDirs = [ "src/" ]
+
+
+eclipse.project {
+    name = appName + "-core"
+}
+buildscript {
+    ext.kotlin_version = '1.1.51'
+    repositories {
+        mavenCentral()
+    }
+    dependencies {
+        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+    }
+}
+repositories {
+    mavenCentral()
+}
+dependencies {
+    compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
+}
+compileKotlin {
+    kotlinOptions {
+        jvmTarget = "1.8"
+    }
+}
+compileTestKotlin {
+    kotlinOptions {
+        jvmTarget = "1.8"
+    }
+}

+ 5 - 0
core/src/ExeBattle.gwt.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://google-web-toolkit.googlecode.com/svn/trunk/distro-source/core/src/gwt-module.dtd">
+<module>
+	<source path="info/raa0121/duelsimulation" />
+</module>

+ 15 - 0
core/src/info/raa0121/exebattle/Deck.kt

@@ -0,0 +1,15 @@
+package info.raa0121.exebattle
+
+class Deck {
+    companion object {
+        const val MIN_NUM: Int = 60
+        const val MAX_NUM: Int = 60
+    }
+
+    init {
+
+    }
+    fun draw(num: Int) {
+
+    }
+}

+ 118 - 0
core/src/info/raa0121/exebattle/ExeBattle.kt

@@ -0,0 +1,118 @@
+package info.raa0121.exebattle
+
+import com.badlogic.gdx.ApplicationAdapter
+import com.badlogic.gdx.Gdx
+import com.badlogic.gdx.Input
+import com.badlogic.gdx.files.FileHandle
+import com.badlogic.gdx.graphics.Color
+import com.badlogic.gdx.graphics.GL20
+import com.badlogic.gdx.graphics.Texture
+import com.badlogic.gdx.graphics.g2d.SpriteBatch
+import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator
+import com.badlogic.gdx.graphics.g2d.BitmapFont
+import com.badlogic.gdx.graphics.g2d.TextureRegion
+
+
+class ExeBattle : ApplicationAdapter() {
+    private var batch: SpriteBatch? = null
+    private var fontGenerator: FreeTypeFontGenerator? = null
+    private var debugBitmapFont: BitmapFont? = null
+    private var playerHPBitmapFont: BitmapFont? = null
+    private var tekiHPBitmapFont: BitmapFont? = null
+    private var tile: Texture? = null
+    private var playerImage: Texture? = null
+    private var playerImageStand: TextureRegion? = null
+    private var playerImageShoot: TextureRegion? = null
+    private var tekiImage: Texture? = null
+    private var tekiImageStand: TextureRegion? = null
+    private var tekiImageShoot: TextureRegion? = null
+    private var playerX = 116f
+    private var playerY = 130f
+    private var tekiX = 431f
+    private var tekiY = 130f
+    private var playerHP = 1000
+    private var tekiHP = 100
+
+    override fun create() {
+        batch = SpriteBatch()
+        val font: FileHandle  = Gdx.files.internal("fonts/Cica-Regular.ttf")
+        tile = Texture(Gdx.files.internal("tile.png"))
+        playerImage = Texture(Gdx.files.internal("player.png"))
+        playerImageStand = TextureRegion(playerImage, 0, 0, 88,124)
+        playerImageShoot = TextureRegion(playerImage, 88, 0, 88, 124)
+        tekiImage = Texture(Gdx.files.internal("teki.png"))
+        tekiImageShoot = TextureRegion(tekiImage, 0, 0, 88,124)
+        tekiImageStand = TextureRegion(tekiImage, 88, 0, 88, 124)
+        fontGenerator = FreeTypeFontGenerator(font)
+        val debugFontParam = FreeTypeFontGenerator.FreeTypeFontParameter()
+        debugFontParam.size = 18;
+        debugFontParam.incremental = true
+        debugFontParam.color = Color.BLUE
+        debugBitmapFont = fontGenerator?.generateFont(debugFontParam)
+        val playerHPFontParam = FreeTypeFontGenerator.FreeTypeFontParameter()
+        playerHPFontParam.size = 28
+        playerHPFontParam.incremental = true
+        playerHPFontParam.color = Color.BLACK
+        playerHPBitmapFont = fontGenerator?.generateFont(playerHPFontParam)
+        val tekiHPFontParam = FreeTypeFontGenerator.FreeTypeFontParameter()
+        tekiHPFontParam.size = 18
+        tekiHPFontParam.incremental = true
+        tekiHPFontParam.color = Color.BLACK
+        tekiHPBitmapFont = fontGenerator?.generateFont(tekiHPFontParam)
+    }
+
+    override fun resize(width: Int, height: Int) {
+    }
+
+    override fun render() {
+        Gdx.gl.glClearColor(1f, 1f,1f, 1f)
+        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT)
+        batch?.begin()
+        batch?.draw(tile, 0f, 0f)
+        if (Gdx.input.isKeyJustPressed(Input.Keys.LEFT)) {
+            if (playerX > 11f) {
+                playerX -= 105f
+            }
+        }
+        if (Gdx.input.isKeyJustPressed(Input.Keys.RIGHT)) {
+            if (playerX < 221f) {
+                playerX += 105f
+            }
+        }
+        if (Gdx.input.isKeyJustPressed(Input.Keys.UP)) {
+            if (playerY < 195f) {
+                playerY += 65f
+            }
+        }
+        if (Gdx.input.isKeyJustPressed(Input.Keys.DOWN)) {
+            if (playerY > 65f) {
+                playerY -= 65f
+            }
+        }
+        if (Gdx.input.isKeyJustPressed(Input.Keys.Z)) {
+            batch?.draw(playerImageShoot, playerX, playerY)
+            if (playerY == tekiY && tekiHP > 0) {
+                tekiHP -= 10
+            }
+        } else {
+            batch?.draw(playerImageStand, playerX, playerY)
+        }
+        //debugBitmapFont?.draw(batch, "X:" + playerX + "  Y:" + playerY, 0f, 10f)
+        playerHPBitmapFont?.draw(batch, playerHP.toString(), 0f, 480f)
+        if (tekiHP > 0) {
+            batch?.draw(tekiImageStand, tekiX, tekiY)
+            tekiHPBitmapFont?.draw(batch, tekiHP.toString(), tekiX + 30f, tekiY + 129f)
+        }
+        batch?.end()
+    }
+
+    override fun dispose() {
+        super.dispose()
+        debugBitmapFont?.dispose()
+        playerHPBitmapFont?.dispose()
+        tekiHPBitmapFont?.dispose()
+        batch?.dispose()
+        tile?.dispose()
+        playerImage?.dispose()
+    }
+}

+ 21 - 0
core/src/info/raa0121/exebattle/card/Card.kt

@@ -0,0 +1,21 @@
+package info.raa0121.exebattle.card
+
+open abstract class Card : ICard {
+    override var name: String = ""
+    override var text: String = ""
+    protected var cardType: CardType? = null
+
+    enum class CardType {
+        // Monster
+        DARK,
+        DIVINE,
+        EARTH,
+        FIRE,
+        LIGHT,
+        WATER,
+        WIND,
+        // Other
+        MAGIC,
+        TRAP
+    }
+}

+ 20 - 0
core/src/info/raa0121/exebattle/card/EffectMonsterCard.kt

@@ -0,0 +1,20 @@
+package info.raa0121.exebattle.card
+
+class EffectMonsterCard (
+        name: String,
+        cardType: CardType,
+        level: Int,
+        monsterType: MonsterType,
+        attackPoint: Float,
+        defensePoint: Float,
+        text: String
+) : MonsterCard(
+        name,
+        cardType,
+        level,
+        MonsterCardType.EFFECT,
+        monsterType,
+        attackPoint,
+        defensePoint,
+        text
+)

+ 6 - 0
core/src/info/raa0121/exebattle/card/ICard.kt

@@ -0,0 +1,6 @@
+package info.raa0121.exebattle.card
+
+interface ICard {
+    var name: String
+    var text: String
+}

+ 61 - 0
core/src/info/raa0121/exebattle/card/MonsterCard.kt

@@ -0,0 +1,61 @@
+package info.raa0121.exebattle.card
+
+open class MonsterCard(
+        name: String,
+        cardType: CardType,
+        val level: Int,
+        val monsterCardType: MonsterCardType,
+        val monsterType: MonsterType,
+        val attackPoint: Float,
+        val defensePoint: Float,
+        text: String
+) : Card() {
+
+    enum class MonsterCardType {
+        NORMAL,
+        EFFECT,
+        REVERS,
+        FUSION,
+        RITUAL,
+        TUNER,
+        SYNCHRO,
+        XYZ,
+        LINK
+
+    }
+
+    enum class MonsterType {
+        Aqua,
+        Beast,
+        BeastWarrior,
+        Charisma,
+        CreatorGod,
+        Cyberse,
+        Dinosaur,
+        DivineBeast,
+        Dragon,
+        Fairy,
+        Fiend,
+        Fish,
+        Insect,
+        Machine,
+        Plant,
+        Psychic,
+        Pyro,
+        Reptile,
+        Rock,
+        SeaSerpent,
+        SpellCaster,
+        Thunder,
+        Warrior,
+        WingedBeast,
+        Wyrm,
+        Zombie
+    }
+
+    init {
+        this.name = name
+        this.cardType = cardType
+        this.text = text
+    }
+}

+ 20 - 0
core/src/info/raa0121/exebattle/card/NormalMonsterCard.kt

@@ -0,0 +1,20 @@
+package info.raa0121.exebattle.card
+
+class NormalMonsterCard (
+        name: String,
+        cardType: CardType,
+        level: Int,
+        monsterType: MonsterType,
+        attackPoint: Float,
+        defensePoint: Float,
+        text: String
+) : MonsterCard(
+        name,
+        cardType,
+        level,
+        MonsterCardType.NORMAL,
+        monsterType,
+        attackPoint,
+        defensePoint,
+        text
+)

+ 81 - 0
desktop/build.gradle

@@ -0,0 +1,81 @@
+apply plugin: "java"
+apply plugin: 'kotlin'
+
+sourceCompatibility = 1.6
+sourceSets.main.java.srcDirs = [ "src/" ]
+
+project.ext.mainClassName = "info.raa0121.exebattle.desktop.DesktopLauncher"
+project.ext.assetsDir = new File("../core/assets");
+
+task run(dependsOn: classes, type: JavaExec) {
+    main = project.mainClassName
+    classpath = sourceSets.main.runtimeClasspath
+    standardInput = System.in
+    workingDir = project.assetsDir
+    ignoreExitValue = true
+}
+
+task debug(dependsOn: classes, type: JavaExec) {
+    main = project.mainClassName
+    classpath = sourceSets.main.runtimeClasspath
+    standardInput = System.in
+    workingDir = project.assetsDir
+    ignoreExitValue = true
+    debug = true
+}
+
+task dist(type: Jar) {
+    from files(sourceSets.main.output.classesDir)
+    from files(sourceSets.main.output.resourcesDir)
+    from {configurations.compile.collect {zipTree(it)}}
+    from files(project.assetsDir);
+ 
+    manifest {
+        attributes 'Main-Class': project.mainClassName
+    }
+}
+
+dist.dependsOn classes
+
+eclipse {
+    project {
+        name = appName + "-desktop"
+        linkedResource name: 'assets', type: '2', location: 'PARENT-1-PROJECT_LOC/core/assets'
+    }
+}
+
+task afterEclipseImport(description: "Post processing after project generation", group: "IDE") {
+  doLast {
+    def classpath = new XmlParser().parse(file(".classpath"))
+    new Node(classpath, "classpathentry", [ kind: 'src', path: 'assets' ]);
+    def writer = new FileWriter(file(".classpath"))
+    def printer = new XmlNodePrinter(new PrintWriter(writer))
+    printer.setPreserveWhitespace(true)
+    printer.print(classpath)
+  }
+}
+buildscript {
+    ext.kotlin_version = '1.2.21'
+    repositories {
+        mavenCentral()
+    }
+    dependencies {
+        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+    }
+}
+repositories {
+    mavenCentral()
+}
+dependencies {
+    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
+}
+compileKotlin {
+    kotlinOptions {
+        jvmTarget = "1.8"
+    }
+}
+compileTestKotlin {
+    kotlinOptions {
+        jvmTarget = "1.8"
+    }
+}

+ 13 - 0
desktop/src/info/raa0121/exebattle/desktop/DesktopLauncher.kt

@@ -0,0 +1,13 @@
+package info.raa0121.exebattle.desktop
+
+import com.badlogic.gdx.backends.lwjgl.LwjglApplication
+import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration
+import info.raa0121.exebattle.ExeBattle
+
+object DesktopLauncher {
+    @JvmStatic
+    fun main(arg: Array<String>) {
+        val config = LwjglApplicationConfiguration()
+        LwjglApplication(ExeBattle(), config)
+    }
+}

+ 3 - 0
gradle.properties

@@ -0,0 +1,3 @@
+org.gradle.daemon=true
+org.gradle.jvmargs=-Xms128m -Xmx1500m
+org.gradle.configureondemand=true

BIN
gradle/wrapper/gradle-wrapper.jar


+ 6 - 0
gradle/wrapper/gradle-wrapper.properties

@@ -0,0 +1,6 @@
+#Tue Oct 31 01:41:01 JST 2017
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

+ 172 - 0
gradlew

@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+    echo "$*"
+}
+
+die ( ) {
+    echo
+    echo "$*"
+    echo
+    exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+  CYGWIN* )
+    cygwin=true
+    ;;
+  Darwin* )
+    darwin=true
+    ;;
+  MINGW* )
+    msys=true
+    ;;
+  NONSTOP* )
+    nonstop=true
+    ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+        JAVACMD="$JAVA_HOME/bin/java"
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD="java"
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ $? -eq 0 ] ; then
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+            MAX_FD="$MAX_FD_LIMIT"
+        fi
+        ulimit -n $MAX_FD
+        if [ $? -ne 0 ] ; then
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+    JAVACMD=`cygpath --unix "$JAVACMD"`
+
+    # We build the pattern for arguments to be converted via cygpath
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+    SEP=""
+    for dir in $ROOTDIRSRAW ; do
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
+        SEP="|"
+    done
+    OURCYGPATTERN="(^($ROOTDIRS))"
+    # Add a user-defined pattern to the cygpath arguments
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+    fi
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    i=0
+    for arg in "$@" ; do
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
+
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+        else
+            eval `echo args$i`="\"$arg\""
+        fi
+        i=$((i+1))
+    done
+    case $i in
+        (0) set -- ;;
+        (1) set -- "$args0" ;;
+        (2) set -- "$args0" "$args1" ;;
+        (3) set -- "$args0" "$args1" "$args2" ;;
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+    esac
+fi
+
+# Escape application args
+save ( ) {
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+    echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+  cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"

+ 84 - 0
gradlew.bat

@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega

+ 95 - 0
html/build.gradle

@@ -0,0 +1,95 @@
+apply plugin: "java"
+apply plugin: 'kotlin'
+apply plugin: "jetty"
+
+gwt {
+    gwtVersion='2.8.0' // Should match the gwt version used for building the gwt backend
+    maxHeapSize="1G" // Default 256m is not enough for gwt compiler. GWT is HUNGRY
+    minHeapSize="1G"
+
+    src = files(file("src/")) // Needs to be in front of "modules" below.
+    modules 'info.raa0121.duelsimulation.GdxDefinition'
+    devModules 'info.raa0121.duelsimulation.GdxDefinitionSuperdev'
+    project.webAppDirName = 'webapp'
+
+    compiler {
+        strict = true;
+        disableCastChecking = true;
+    }
+}
+
+task draftRun(type: JettyRunWar) {
+    dependsOn draftWar
+    dependsOn.remove('war')
+    webApp=draftWar.archivePath
+    daemon=true
+}
+
+task superDev(type: de.richsource.gradle.plugins.gwt.GwtSuperDev) {
+    dependsOn draftRun
+    doFirst {
+    	gwt.modules = gwt.devModules
+    }
+}
+
+task dist(dependsOn: [clean, compileGwt]) {
+    doLast {
+        file("build/dist").mkdirs()
+        copy {
+            from "build/gwt/out"
+            into "build/dist"
+        }
+        copy {
+            from "webapp"
+            into "build/dist"
+            }
+        copy {
+            from "war"
+            into "build/dist"
+        }
+    }
+}
+
+draftWar {
+   from "war"
+}
+
+task addSource << {
+	sourceSets.main.compileClasspath += files(project(':core').sourceSets.main.allJava.srcDirs)
+}
+
+tasks.compileGwt.dependsOn(addSource)
+tasks.draftCompileGwt.dependsOn(addSource)
+
+sourceCompatibility = 1.6
+sourceSets.main.java.srcDirs = [ "src/" ]
+
+
+eclipse.project {
+    name = appName + "-html"
+}
+buildscript {
+    ext.kotlin_version = '1.2.21'
+    repositories {
+        mavenCentral()
+    }
+    dependencies {
+        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+    }
+}
+repositories {
+    mavenCentral()
+}
+dependencies {
+    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
+}
+compileKotlin {
+    kotlinOptions {
+        jvmTarget = "1.8"
+    }
+}
+compileTestKotlin {
+    kotlinOptions {
+        jvmTarget = "1.8"
+    }
+}

+ 11 - 0
html/src/info/raa0121/exebattle/GdxDefinition.gwt.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://google-web-toolkit.googlecode.com/svn/trunk/distro-source/core/src/gwt-module.dtd">
+<module rename-to="html">
+	<inherits name='com.badlogic.gdx.backends.gdx_backends_gwt' />
+	<inherits name='com.badlogic.gdx.physics.box2d.box2d-gwt' />
+
+	<inherits name='DuelSimulation' />
+	<entry-point class='info.raa0121.duelsimulation.client.HtmlLauncher' />
+	<set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>
+	<set-configuration-property name="gdx.assetpath" value="../core/assets" />
+</module>

+ 14 - 0
html/src/info/raa0121/exebattle/GdxDefinitionSuperdev.gwt.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://google-web-toolkit.googlecode.com/svn/trunk/distro-source/core/src/gwt-module.dtd">
+<module rename-to="html">
+	<inherits name='com.badlogic.gdx.backends.gdx_backends_gwt' />
+	<inherits name='com.badlogic.gdx.physics.box2d.box2d-gwt' />
+
+    <inherits name='info.raa0121.duelsimulation.GdxDefinition' />
+    
+    <collapse-all-properties />
+    
+	<add-linker name="xsiframe"/>	
+	<set-configuration-property name="devModeRedirectEnabled" value="true"/>
+	<set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>	
+</module>

+ 17 - 0
html/src/info/raa0121/exebattle/client/HtmlLauncher.kt

@@ -0,0 +1,17 @@
+package info.raa0121.duelsimulation.client
+
+import com.badlogic.gdx.ApplicationListener
+import com.badlogic.gdx.backends.gwt.GwtApplication
+import com.badlogic.gdx.backends.gwt.GwtApplicationConfiguration
+import info.raa0121.exebattle.ExeBattle
+
+class HtmlLauncher : GwtApplication() {
+
+    override fun getConfig(): GwtApplicationConfiguration {
+        return GwtApplicationConfiguration(480, 320)
+    }
+
+    override fun createApplicationListener(): ApplicationListener {
+        return DuelSimulation()
+    }
+}

+ 3 - 0
html/webapp/WEB-INF/web.xml

@@ -0,0 +1,3 @@
+<?xml version="1.0" ?>
+<web-app>
+</web-app>

+ 33 - 0
html/webapp/index.html

@@ -0,0 +1,33 @@
+<!doctype html>
+<html>
+       <head>
+              <title>DuelSimulation</title>
+              <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+              <link href="styles.css" rel="stylesheet" type="text/css">
+              <script src="soundmanager2-setup.js"></script>
+  			  <script src="soundmanager2-jsmin.js"></script>
+       </head>
+
+       <body>
+              <a class="superdev" href="javascript:%7B%20window.__gwt_bookmarklet_params%20%3D%20%7B'server_url'%3A'http%3A%2F%2Flocalhost%3A9876%2F'%7D%3B%20var%20s%20%3D%20document.createElement('script')%3B%20s.src%20%3D%20'http%3A%2F%2Flocalhost%3A9876%2Fdev_mode_on.js'%3B%20void(document.getElementsByTagName('head')%5B0%5D.appendChild(s))%3B%7D">&#8635;</a>
+              <div align="center" id="embed-html"></div>
+              <script type="text/javascript" src="html/html.nocache.js"></script>
+       </body>
+
+       <script>
+              function handleMouseDown(evt) {
+                evt.preventDefault();
+                evt.stopPropagation();
+                evt.target.style.cursor = 'default';
+                window.focus();
+              }
+
+              function handleMouseUp(evt) {
+                evt.preventDefault();
+                evt.stopPropagation();
+                evt.target.style.cursor = '';
+              }
+              document.getElementById('embed-html').addEventListener('mousedown', handleMouseDown, false);
+              document.getElementById('embed-html').addEventListener('mouseup', handleMouseUp, false);
+       </script>
+</html>

BIN
html/webapp/refresh.png


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 113 - 0
html/webapp/soundmanager2-jsmin.js


+ 1 - 0
html/webapp/soundmanager2-setup.js

@@ -0,0 +1 @@
+window.SM2_DEFER = true;

+ 43 - 0
html/webapp/styles.css

@@ -0,0 +1,43 @@
+canvas {
+    cursor: default;
+    outline: none;
+}
+
+body {
+    background-color: #222222;
+}
+
+.superdev {
+    color: rgb(37,37,37);
+    text-shadow: 0px 1px 1px rgba(250,250,250,0.1);
+    font-size: 50pt;
+    display: block;
+    position: relative;
+    text-decoration: none;
+    background-color: rgb(83,87,93);
+    box-shadow: 0px 3px 0px 0px rgb(34,34,34),
+                0px 7px 10px 0px rgb(17,17,17),
+                inset 0px 1px 1px 0px rgba(250, 250, 250, .2),
+                inset 0px -12px 35px 0px rgba(0, 0, 0, .5);
+    width: 70px;
+    height: 70px;
+    border: 0;
+    border-radius: 35px;
+    text-align: center;
+    line-height: 68px;
+}
+
+.superdev:active {
+    box-shadow: 0px 0px 0px 0px rgb(34,34,34),
+                0px 3px 7px 0px rgb(17,17,17),
+                inset 0px 1px 1px 0px rgba(250, 250, 250, .2),
+                inset 0px -10px 35px 5px rgba(0, 0, 0, .5);
+    background-color: rgb(83,87,93);
+    top: 3px;
+    color: #fff;
+    text-shadow: 0px 0px 3px rgb(250,250,250);
+}
+
+.superdev:hover {
+    background-color: rgb(100,100,100);
+}

+ 1 - 0
settings.gradle

@@ -0,0 +1 @@
+include 'desktop', 'html', 'core'