summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-01-20 19:29:50 +0500
committerilotterytea <iltsu@alright.party>2025-01-20 19:29:50 +0500
commit043834fa0adf502f61ba09fe312fa3e90b8a6bcc (patch)
tree6b140cc4fdb73c954d564b2baf6ff1086a4ada76
initial commit
-rw-r--r--.editorconfig18
-rw-r--r--.gitattributes2
-rw-r--r--.gitignore165
-rw-r--r--LICENSE373
-rw-r--r--README.md36
-rw-r--r--assets/.gitkeep3
-rw-r--r--build.gradle73
-rw-r--r--core/build.gradle12
-rw-r--r--core/src/main/java/kz/ilotterytea/frogartha/FrogarthaGame.gwt.xml9
-rw-r--r--core/src/main/java/kz/ilotterytea/frogartha/FrogarthaGame.java21
-rw-r--r--core/src/main/java/kz/ilotterytea/frogartha/screens/GameScreen.java121
-rw-r--r--gradle.properties10
-rw-r--r--gradle/wrapper/gradle-wrapper.jarbin0 -> 43583 bytes
-rw-r--r--gradle/wrapper/gradle-wrapper.properties7
-rw-r--r--gradlew251
-rw-r--r--gradlew.bat94
-rw-r--r--html/build.gradle157
-rw-r--r--html/src/main/java/kz/ilotterytea/frogartha/GdxDefinition.gwt.xml35
-rw-r--r--html/src/main/java/kz/ilotterytea/frogartha/GdxDefinitionSuperdev.gwt.xml9
-rw-r--r--html/src/main/java/kz/ilotterytea/frogartha/gwt/GwtLauncher.java28
-rw-r--r--html/webapp/WEB-INF/web.xml3
-rw-r--r--html/webapp/index.html31
-rw-r--r--html/webapp/refresh.pngbin0 -> 232 bytes
-rw-r--r--html/webapp/styles.css53
-rw-r--r--lwjgl3/build.gradle136
-rw-r--r--lwjgl3/icons/logo.icnsbin0 -> 201876 bytes
-rw-r--r--lwjgl3/icons/logo.icobin0 -> 4286 bytes
-rw-r--r--lwjgl3/icons/logo.pngbin0 -> 9754 bytes
-rw-r--r--lwjgl3/nativeimage.gradle54
-rw-r--r--lwjgl3/src/main/java/kz/ilotterytea/frogartha/lwjgl3/Lwjgl3Launcher.java33
-rw-r--r--lwjgl3/src/main/java/kz/ilotterytea/frogartha/lwjgl3/StartupHelper.java179
-rw-r--r--lwjgl3/src/main/resources/libgdx128.pngbin0 -> 9754 bytes
-rw-r--r--lwjgl3/src/main/resources/libgdx16.pngbin0 -> 879 bytes
-rw-r--r--lwjgl3/src/main/resources/libgdx32.pngbin0 -> 2092 bytes
-rw-r--r--lwjgl3/src/main/resources/libgdx64.pngbin0 -> 4996 bytes
-rw-r--r--server/build.gradle41
-rw-r--r--server/src/main/java/kz/ilotterytea/frogartha/server/ServerLauncher.java8
-rw-r--r--settings.gradle4
-rw-r--r--shared/build.gradle5
-rw-r--r--shared/src/main/java/kz/ilotterytea/frogartha/Shared.gwt.xml15
40 files changed, 1986 insertions, 0 deletions
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..67df35c
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,18 @@
+# https://editorconfig.org
+root = true
+
+[*]
+indent_style = space
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.{java,scala,groovy,kt,kts}]
+indent_size = 4
+
+[*.gradle]
+indent_size = 2
+
+[*.md]
+trim_trailing_whitespace = false
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..6c84be0
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+* text=auto eol=lf
+*.bat text=auto eol=crlf
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..fc300f7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,165 @@
+## Gradle:
+.gradle/
+gradle-app.setting
+/gradle/gradle-daemon-jvm.properties
+/build/
+/android/build/
+/core/build/
+/lwjgl2/build/
+/lwjgl3/build/
+/html/build/
+/teavm/build/
+/ios/build/
+/ios-moe/build/
+/headless/build/
+/server/build/
+/shared/build/
+
+## Java:
+*.class
+*.war
+*.ear
+hs_err_pid*
+.attach_pid*
+
+## Android:
+/android/libs/armeabi-v7a/
+/android/libs/arm64-v8a/
+/android/libs/x86/
+/android/libs/x86_64/
+/android/gen/
+/android/out/
+local.properties
+com_crashlytics_export_strings.xml
+
+## Robovm:
+/ios/robovm-build/
+
+## iOS:
+/ios/xcode/*.xcodeproj/*
+!/ios/xcode/*.xcodeproj/xcshareddata
+!/ios/xcode/*.xcodeproj/project.pbxproj
+/ios/xcode/native/
+/ios/IOSLauncher.app
+/ios/IOSLauncher.app.dSYM
+
+## GWT:
+/html/war/
+/html/gwt-unitCache/
+.apt_generated/
+/html/war/WEB-INF/deploy/
+/html/war/WEB-INF/classes/
+.gwt/
+gwt-unitCache/
+www-test/
+.gwt-tmp/
+
+## TeaVM:
+# Not sure yet...
+
+## IntelliJ, Android Studio:
+.idea/
+*.ipr
+*.iws
+*.iml
+
+## Eclipse:
+.classpath
+.project
+.metadata/
+/android/bin/
+/core/bin/
+/lwjgl2/bin/
+/lwjgl3/bin/
+/html/bin/
+/teavm/bin/
+/ios/bin/
+/ios-moe/bin/
+/headless/bin/
+/server/bin/
+/shared/bin/
+*.tmp
+*.bak
+*.swp
+*~.nib
+.settings/
+.loadpath
+.externalToolBuilders/
+*.launch
+
+
+## NetBeans:
+
+/nbproject/private/
+/android/nbproject/private/
+/core/nbproject/private/
+/lwjgl2/nbproject/private/
+/lwjgl3/nbproject/private/
+/html/nbproject/private/
+/teavm/nbproject/private/
+/ios/nbproject/private/
+/ios-moe/nbproject/private/
+/headless/nbproject/private/
+/server/nbproject/private/
+/shared/nbproject/private/
+
+/nbbuild/
+/android/nbbuild/
+/core/nbbuild/
+/lwjgl2/nbbuild/
+/lwjgl3/nbbuild/
+/html/nbbuild/
+/teavm/nbbuild/
+/ios/nbbuild/
+/ios-moe/nbbuild/
+/headless/nbbuild/
+/server/nbbuild/
+/shared/nbbuild/
+
+/dist/
+/android/dist/
+/core/dist/
+/lwjgl2/dist/
+/lwjgl3/dist/
+/html/dist/
+/teavm/dist/
+/ios/dist/
+/ios-moe/dist/
+/headless/dist/
+/server/dist/
+/shared/dist/
+
+/nbdist/
+/android/nbdist/
+/core/nbdist/
+/lwjgl2/nbdist/
+/lwjgl3/nbdist/
+/html/nbdist/
+/teavm/nbdist/
+/ios/nbdist/
+/ios-moe/nbdist/
+/headless/nbdist/
+/server/nbdist/
+/shared/nbdist/
+
+nbactions.xml
+nb-configuration.xml
+
+## OS-Specific:
+.DS_Store
+Thumbs.db
+
+## Miscellaneous:
+*~
+*.*#
+*#*#
+/.kotlin/
+/assets/assets.txt
+
+## Special cases:
+
+## There is a resource-config.json file generated by nativeimage.gradle if you use Graal Native Image.
+## Some usage may need extra resource configuration in a different file with the same name.
+## You could also add that configuration to the text in nativeimage.gradle .
+## You should delete or comment out the next line if you have configuration in a different resource-config.json .
+**/resource-config.json
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..a612ad9
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,373 @@
+Mozilla Public License Version 2.0
+==================================
+
+1. Definitions
+--------------
+
+1.1. "Contributor"
+ means each individual or legal entity that creates, contributes to
+ the creation of, or owns Covered Software.
+
+1.2. "Contributor Version"
+ means the combination of the Contributions of others (if any) used
+ by a Contributor and that particular Contributor's Contribution.
+
+1.3. "Contribution"
+ means Covered Software of a particular Contributor.
+
+1.4. "Covered Software"
+ means Source Code Form to which the initial Contributor has attached
+ the notice in Exhibit A, the Executable Form of such Source Code
+ Form, and Modifications of such Source Code Form, in each case
+ including portions thereof.
+
+1.5. "Incompatible With Secondary Licenses"
+ means
+
+ (a) that the initial Contributor has attached the notice described
+ in Exhibit B to the Covered Software; or
+
+ (b) that the Covered Software was made available under the terms of
+ version 1.1 or earlier of the License, but not also under the
+ terms of a Secondary License.
+
+1.6. "Executable Form"
+ means any form of the work other than Source Code Form.
+
+1.7. "Larger Work"
+ means a work that combines Covered Software with other material, in
+ a separate file or files, that is not Covered Software.
+
+1.8. "License"
+ means this document.
+
+1.9. "Licensable"
+ means having the right to grant, to the maximum extent possible,
+ whether at the time of the initial grant or subsequently, any and
+ all of the rights conveyed by this License.
+
+1.10. "Modifications"
+ means any of the following:
+
+ (a) any file in Source Code Form that results from an addition to,
+ deletion from, or modification of the contents of Covered
+ Software; or
+
+ (b) any new file in Source Code Form that contains any Covered
+ Software.
+
+1.11. "Patent Claims" of a Contributor
+ means any patent claim(s), including without limitation, method,
+ process, and apparatus claims, in any patent Licensable by such
+ Contributor that would be infringed, but for the grant of the
+ License, by the making, using, selling, offering for sale, having
+ made, import, or transfer of either its Contributions or its
+ Contributor Version.
+
+1.12. "Secondary License"
+ means either the GNU General Public License, Version 2.0, the GNU
+ Lesser General Public License, Version 2.1, the GNU Affero General
+ Public License, Version 3.0, or any later versions of those
+ licenses.
+
+1.13. "Source Code Form"
+ means the form of the work preferred for making modifications.
+
+1.14. "You" (or "Your")
+ means an individual or a legal entity exercising rights under this
+ License. For legal entities, "You" includes any entity that
+ controls, is controlled by, or is under common control with You. For
+ purposes of this definition, "control" means (a) the power, direct
+ or indirect, to cause the direction or management of such entity,
+ whether by contract or otherwise, or (b) ownership of more than
+ fifty percent (50%) of the outstanding shares or beneficial
+ ownership of such entity.
+
+2. License Grants and Conditions
+--------------------------------
+
+2.1. Grants
+
+Each Contributor hereby grants You a world-wide, royalty-free,
+non-exclusive license:
+
+(a) under intellectual property rights (other than patent or trademark)
+ Licensable by such Contributor to use, reproduce, make available,
+ modify, display, perform, distribute, and otherwise exploit its
+ Contributions, either on an unmodified basis, with Modifications, or
+ as part of a Larger Work; and
+
+(b) under Patent Claims of such Contributor to make, use, sell, offer
+ for sale, have made, import, and otherwise transfer either its
+ Contributions or its Contributor Version.
+
+2.2. Effective Date
+
+The licenses granted in Section 2.1 with respect to any Contribution
+become effective for each Contribution on the date the Contributor first
+distributes such Contribution.
+
+2.3. Limitations on Grant Scope
+
+The licenses granted in this Section 2 are the only rights granted under
+this License. No additional rights or licenses will be implied from the
+distribution or licensing of Covered Software under this License.
+Notwithstanding Section 2.1(b) above, no patent license is granted by a
+Contributor:
+
+(a) for any code that a Contributor has removed from Covered Software;
+ or
+
+(b) for infringements caused by: (i) Your and any other third party's
+ modifications of Covered Software, or (ii) the combination of its
+ Contributions with other software (except as part of its Contributor
+ Version); or
+
+(c) under Patent Claims infringed by Covered Software in the absence of
+ its Contributions.
+
+This License does not grant any rights in the trademarks, service marks,
+or logos of any Contributor (except as may be necessary to comply with
+the notice requirements in Section 3.4).
+
+2.4. Subsequent Licenses
+
+No Contributor makes additional grants as a result of Your choice to
+distribute the Covered Software under a subsequent version of this
+License (see Section 10.2) or under the terms of a Secondary License (if
+permitted under the terms of Section 3.3).
+
+2.5. Representation
+
+Each Contributor represents that the Contributor believes its
+Contributions are its original creation(s) or it has sufficient rights
+to grant the rights to its Contributions conveyed by this License.
+
+2.6. Fair Use
+
+This License is not intended to limit any rights You have under
+applicable copyright doctrines of fair use, fair dealing, or other
+equivalents.
+
+2.7. Conditions
+
+Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
+in Section 2.1.
+
+3. Responsibilities
+-------------------
+
+3.1. Distribution of Source Form
+
+All distribution of Covered Software in Source Code Form, including any
+Modifications that You create or to which You contribute, must be under
+the terms of this License. You must inform recipients that the Source
+Code Form of the Covered Software is governed by the terms of this
+License, and how they can obtain a copy of this License. You may not
+attempt to alter or restrict the recipients' rights in the Source Code
+Form.
+
+3.2. Distribution of Executable Form
+
+If You distribute Covered Software in Executable Form then:
+
+(a) such Covered Software must also be made available in Source Code
+ Form, as described in Section 3.1, and You must inform recipients of
+ the Executable Form how they can obtain a copy of such Source Code
+ Form by reasonable means in a timely manner, at a charge no more
+ than the cost of distribution to the recipient; and
+
+(b) You may distribute such Executable Form under the terms of this
+ License, or sublicense it under different terms, provided that the
+ license for the Executable Form does not attempt to limit or alter
+ the recipients' rights in the Source Code Form under this License.
+
+3.3. Distribution of a Larger Work
+
+You may create and distribute a Larger Work under terms of Your choice,
+provided that You also comply with the requirements of this License for
+the Covered Software. If the Larger Work is a combination of Covered
+Software with a work governed by one or more Secondary Licenses, and the
+Covered Software is not Incompatible With Secondary Licenses, this
+License permits You to additionally distribute such Covered Software
+under the terms of such Secondary License(s), so that the recipient of
+the Larger Work may, at their option, further distribute the Covered
+Software under the terms of either this License or such Secondary
+License(s).
+
+3.4. Notices
+
+You may not remove or alter the substance of any license notices
+(including copyright notices, patent notices, disclaimers of warranty,
+or limitations of liability) contained within the Source Code Form of
+the Covered Software, except that You may alter any license notices to
+the extent required to remedy known factual inaccuracies.
+
+3.5. Application of Additional Terms
+
+You may choose to offer, and to charge a fee for, warranty, support,
+indemnity or liability obligations to one or more recipients of Covered
+Software. However, You may do so only on Your own behalf, and not on
+behalf of any Contributor. You must make it absolutely clear that any
+such warranty, support, indemnity, or liability obligation is offered by
+You alone, and You hereby agree to indemnify every Contributor for any
+liability incurred by such Contributor as a result of warranty, support,
+indemnity or liability terms You offer. You may include additional
+disclaimers of warranty and limitations of liability specific to any
+jurisdiction.
+
+4. Inability to Comply Due to Statute or Regulation
+---------------------------------------------------
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Software due to
+statute, judicial order, or regulation then You must: (a) comply with
+the terms of this License to the maximum extent possible; and (b)
+describe the limitations and the code they affect. Such description must
+be placed in a text file included with all distributions of the Covered
+Software under this License. Except to the extent prohibited by statute
+or regulation, such description must be sufficiently detailed for a
+recipient of ordinary skill to be able to understand it.
+
+5. Termination
+--------------
+
+5.1. The rights granted under this License will terminate automatically
+if You fail to comply with any of its terms. However, if You become
+compliant, then the rights granted under this License from a particular
+Contributor are reinstated (a) provisionally, unless and until such
+Contributor explicitly and finally terminates Your grants, and (b) on an
+ongoing basis, if such Contributor fails to notify You of the
+non-compliance by some reasonable means prior to 60 days after You have
+come back into compliance. Moreover, Your grants from a particular
+Contributor are reinstated on an ongoing basis if such Contributor
+notifies You of the non-compliance by some reasonable means, this is the
+first time You have received notice of non-compliance with this License
+from such Contributor, and You become compliant prior to 30 days after
+Your receipt of the notice.
+
+5.2. If You initiate litigation against any entity by asserting a patent
+infringement claim (excluding declaratory judgment actions,
+counter-claims, and cross-claims) alleging that a Contributor Version
+directly or indirectly infringes any patent, then the rights granted to
+You by any and all Contributors for the Covered Software under Section
+2.1 of this License shall terminate.
+
+5.3. In the event of termination under Sections 5.1 or 5.2 above, all
+end user license agreements (excluding distributors and resellers) which
+have been validly granted by You or Your distributors under this License
+prior to termination shall survive termination.
+
+************************************************************************
+* *
+* 6. Disclaimer of Warranty *
+* ------------------------- *
+* *
+* Covered Software is provided under this License on an "as is" *
+* basis, without warranty of any kind, either expressed, implied, or *
+* statutory, including, without limitation, warranties that the *
+* Covered Software is free of defects, merchantable, fit for a *
+* particular purpose or non-infringing. The entire risk as to the *
+* quality and performance of the Covered Software is with You. *
+* Should any Covered Software prove defective in any respect, You *
+* (not any Contributor) assume the cost of any necessary servicing, *
+* repair, or correction. This disclaimer of warranty constitutes an *
+* essential part of this License. No use of any Covered Software is *
+* authorized under this License except under this disclaimer. *
+* *
+************************************************************************
+
+************************************************************************
+* *
+* 7. Limitation of Liability *
+* -------------------------- *
+* *
+* Under no circumstances and under no legal theory, whether tort *
+* (including negligence), contract, or otherwise, shall any *
+* Contributor, or anyone who distributes Covered Software as *
+* permitted above, be liable to You for any direct, indirect, *
+* special, incidental, or consequential damages of any character *
+* including, without limitation, damages for lost profits, loss of *
+* goodwill, work stoppage, computer failure or malfunction, or any *
+* and all other commercial damages or losses, even if such party *
+* shall have been informed of the possibility of such damages. This *
+* limitation of liability shall not apply to liability for death or *
+* personal injury resulting from such party's negligence to the *
+* extent applicable law prohibits such limitation. Some *
+* jurisdictions do not allow the exclusion or limitation of *
+* incidental or consequential damages, so this exclusion and *
+* limitation may not apply to You. *
+* *
+************************************************************************
+
+8. Litigation
+-------------
+
+Any litigation relating to this License may be brought only in the
+courts of a jurisdiction where the defendant maintains its principal
+place of business and such litigation shall be governed by laws of that
+jurisdiction, without reference to its conflict-of-law provisions.
+Nothing in this Section shall prevent a party's ability to bring
+cross-claims or counter-claims.
+
+9. Miscellaneous
+----------------
+
+This License represents the complete agreement concerning the subject
+matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent
+necessary to make it enforceable. Any law or regulation which provides
+that the language of a contract shall be construed against the drafter
+shall not be used to construe this License against a Contributor.
+
+10. Versions of the License
+---------------------------
+
+10.1. New Versions
+
+Mozilla Foundation is the license steward. Except as provided in Section
+10.3, no one other than the license steward has the right to modify or
+publish new versions of this License. Each version will be given a
+distinguishing version number.
+
+10.2. Effect of New Versions
+
+You may distribute the Covered Software under the terms of the version
+of the License under which You originally received the Covered Software,
+or under the terms of any subsequent version published by the license
+steward.
+
+10.3. Modified Versions
+
+If you create software not governed by this License, and you want to
+create a new license for such software, you may create and use a
+modified version of this License if you rename the license and remove
+any references to the name of the license steward (except to note that
+such modified license differs from this License).
+
+10.4. Distributing Source Code Form that is Incompatible With Secondary
+Licenses
+
+If You choose to distribute Source Code Form that is Incompatible With
+Secondary Licenses under the terms of this version of the License, the
+notice described in Exhibit B of this License must be attached.
+
+Exhibit A - Source Code Form License Notice
+-------------------------------------------
+
+ This Source Code Form is subject to the terms of the Mozilla Public
+ License, v. 2.0. If a copy of the MPL was not distributed with this
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+If it is not possible or desirable to put the notice in a particular
+file, then You may include the notice in a location (such as a LICENSE
+file in a relevant directory) where a recipient would be likely to look
+for such a notice.
+
+You may add additional accurate notices of copyright ownership.
+
+Exhibit B - "Incompatible With Secondary Licenses" Notice
+---------------------------------------------------------
+
+ This Source Code Form is "Incompatible With Secondary Licenses", as
+ defined by the Mozilla Public License, v. 2.0.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..92d962c
--- /dev/null
+++ b/README.md
@@ -0,0 +1,36 @@
+# Frogartha Open Source
+
+A chat room game, written in Java and LibGDX. This project uses Gradle to manage dependencies.
+
+## Building from sources
+
+To compile this project you will need [JDK 11](https://adoptium.net). Copy the repository and open it via the terminal
+and do what you need:
+
+### Desktop (Windows/macOS/Linux)
+
+- `./gradlew lwjgl3:run`: starts the application.
+- `./gradlew lwjgl3:dist`: builds application's runnable jar, which can be found at `lwjgl3/build/libs`.
+
+### HTML
+
+- `./gradlew html:dist`: compiles GWT sources. The compiled application can be found at `html/build/dist`: you can use
+ any HTTP server to deploy it.
+- `./gradlew html:superDev`: compiles GWT sources and runs the application in SuperDev mode. It will be available
+ at [localhost:8080/html](http://localhost:8080/html). Use only during development.
+
+### Server
+
+- `./gradlew server:run`: runs the server application.
+
+## Downloads
+
+| [![itch.io](https://static.itch.io/images/badge.svg)](https://ilotterytea.itch.io/frogartha) |
+|----------------------------------------------------------------------------------------------|
+
+## License
+
+This project is under the Mozilla Public License
+2.0! [Read on LICENSE](https://github.com/ilotterytea/frogartha/blob/master/LICENSE).<br>
+Project Assets under
+the [Creative Commons Attribution v4.0 International](https://creativecommons.org/licenses/by/4.0/)!
diff --git a/assets/.gitkeep b/assets/.gitkeep
new file mode 100644
index 0000000..944e008
--- /dev/null
+++ b/assets/.gitkeep
@@ -0,0 +1,3 @@
+This file can be deleted if there are any other files present in this folder.
+It is only here to ensure this folder is added to Git, instead of being
+ignored because it is empty. \ No newline at end of file
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..f8b656f
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,73 @@
+buildscript {
+ repositories {
+ mavenCentral()
+ maven { url 'https://s01.oss.sonatype.org' }
+ gradlePluginPortal()
+ mavenLocal()
+ google()
+ maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
+ maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
+ }
+ dependencies {
+
+
+ }
+}
+
+allprojects {
+ apply plugin: 'eclipse'
+ apply plugin: 'idea'
+
+ // This allows you to "Build and run using IntelliJ IDEA", an option in IDEA's Settings.
+ idea {
+ module {
+ outputDir file('build/classes/java/main')
+ testOutputDir file('build/classes/java/test')
+ }
+ }
+}
+
+configure(subprojects) {
+ apply plugin: 'java-library'
+ sourceCompatibility = 11
+
+ // From https://lyze.dev/2021/04/29/libGDX-Internal-Assets-List/
+ // The article can be helpful when using assets.txt in your project.
+ tasks.register('generateAssetList') {
+ inputs.dir("${project.rootDir}/assets/")
+ // projectFolder/assets
+ File assetsFolder = new File("${project.rootDir}/assets/")
+ // projectFolder/assets/assets.txt
+ File assetsFile = new File(assetsFolder, "assets.txt")
+ // delete that file in case we've already created it
+ assetsFile.delete()
+
+ // iterate through all files inside that folder
+ // convert it to a relative path
+ // and append it to the file assets.txt
+ fileTree(assetsFolder).collect { assetsFolder.relativePath(it) }.sort().each {
+ assetsFile.append(it + "\n")
+ }
+ }
+ processResources.dependsOn 'generateAssetList'
+
+ compileJava {
+ options.incremental = true
+ }
+}
+
+subprojects {
+ version = "$projectVersion"
+ ext.appName = 'Frogartha'
+ repositories {
+ mavenCentral()
+ maven { url 'https://s01.oss.sonatype.org' }
+ // You may want to remove the following line if you have errors downloading dependencies.
+ mavenLocal()
+ maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
+ maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
+ maven { url 'https://jitpack.io' }
+ }
+}
+
+eclipse.project.name = 'Frogartha' + '-parent'
diff --git a/core/build.gradle b/core/build.gradle
new file mode 100644
index 0000000..bb73187
--- /dev/null
+++ b/core/build.gradle
@@ -0,0 +1,12 @@
+[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
+eclipse.project.name = appName + '-core'
+
+dependencies {
+ api "com.badlogicgames.gdx:gdx:$gdxVersion"
+ api "com.github.mgsx-dev.gdx-gltf:gltf:$gdxGltfVersion"
+ api project(':shared')
+
+ if(enableGraalNative == 'true') {
+ implementation "io.github.berstanio:gdx-svmhelper-annotations:$graalHelperVersion"
+ }
+}
diff --git a/core/src/main/java/kz/ilotterytea/frogartha/FrogarthaGame.gwt.xml b/core/src/main/java/kz/ilotterytea/frogartha/FrogarthaGame.gwt.xml
new file mode 100644
index 0000000..8dd5046
--- /dev/null
+++ b/core/src/main/java/kz/ilotterytea/frogartha/FrogarthaGame.gwt.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.11.0//EN" "https://www.gwtproject.org/doctype/2.11.0/gwt-module.dtd">
+<module>
+ <!-- Paths to source are relative to this file and separated by slashes ('/'). -->
+ <source path="" />
+ <!-- Reflection includes may be needed for your code or library code. Each value is separated by periods ('.'). -->
+ <!-- You can include a full package by not including the name of a type at the end. -->
+
+</module> \ No newline at end of file
diff --git a/core/src/main/java/kz/ilotterytea/frogartha/FrogarthaGame.java b/core/src/main/java/kz/ilotterytea/frogartha/FrogarthaGame.java
new file mode 100644
index 0000000..149dcc7
--- /dev/null
+++ b/core/src/main/java/kz/ilotterytea/frogartha/FrogarthaGame.java
@@ -0,0 +1,21 @@
+package kz.ilotterytea.frogartha;
+
+import com.badlogic.gdx.Game;
+import kz.ilotterytea.frogartha.screens.GameScreen;
+
+/**
+ * {@link com.badlogic.gdx.ApplicationListener} implementation shared by all platforms.
+ */
+public class FrogarthaGame extends Game {
+ private static FrogarthaGame instance;
+
+ @Override
+ public void create() {
+ setScreen(new GameScreen());
+ }
+
+ public static FrogarthaGame getInstance() {
+ if (instance == null) instance = new FrogarthaGame();
+ return instance;
+ }
+}
diff --git a/core/src/main/java/kz/ilotterytea/frogartha/screens/GameScreen.java b/core/src/main/java/kz/ilotterytea/frogartha/screens/GameScreen.java
new file mode 100644
index 0000000..509566e
--- /dev/null
+++ b/core/src/main/java/kz/ilotterytea/frogartha/screens/GameScreen.java
@@ -0,0 +1,121 @@
+package kz.ilotterytea.frogartha.screens;
+
+import com.badlogic.gdx.Gdx;
+import com.badlogic.gdx.Screen;
+import com.badlogic.gdx.graphics.*;
+import com.badlogic.gdx.graphics.g3d.Material;
+import com.badlogic.gdx.graphics.g3d.Model;
+import com.badlogic.gdx.graphics.g3d.ModelInstance;
+import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;
+import com.badlogic.gdx.graphics.g3d.decals.CameraGroupStrategy;
+import com.badlogic.gdx.graphics.g3d.decals.DecalBatch;
+import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
+import com.badlogic.gdx.math.Vector3;
+import net.mgsx.gltf.scene3d.attributes.PBRCubemapAttribute;
+import net.mgsx.gltf.scene3d.attributes.PBRTextureAttribute;
+import net.mgsx.gltf.scene3d.lights.DirectionalShadowLight;
+import net.mgsx.gltf.scene3d.lights.PointLightEx;
+import net.mgsx.gltf.scene3d.scene.Scene;
+import net.mgsx.gltf.scene3d.scene.SceneManager;
+import net.mgsx.gltf.scene3d.scene.SceneSkybox;
+import net.mgsx.gltf.scene3d.utils.IBLBuilder;
+
+public class GameScreen implements Screen {
+ private PerspectiveCamera camera;
+ private SceneManager sceneManager;
+ private DecalBatch decalBatch;
+
+ @Override
+ public void show() {
+ create3D();
+ }
+
+ @Override
+ public void render(float delta) {
+ Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
+ sceneManager.update(delta);
+ sceneManager.render();
+
+ decalBatch.flush();
+ }
+
+ @Override
+ public void resize(int width, int height) {
+ sceneManager.updateViewport(width, height);
+ }
+
+ @Override
+ public void pause() {
+ hide();
+ }
+
+ @Override
+ public void resume() {
+ show();
+ }
+
+ @Override
+ public void hide() {
+ dispose();
+ }
+
+ @Override
+ public void dispose() {
+ sceneManager.dispose();
+ decalBatch.dispose();
+ }
+
+ private void create3D() {
+ sceneManager = new SceneManager();
+
+ // Building a dummy scene
+ ModelBuilder modelBuilder = new ModelBuilder();
+ Model plane = modelBuilder.createBox(20f, 0.1f, 20f, new Material(ColorAttribute.createDiffuse(Color.LIME)),
+ VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal);
+ Scene planeScene = new Scene(new ModelInstance(plane));
+ sceneManager.addScene(planeScene);
+
+ camera = new PerspectiveCamera(60f, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
+ camera.near = 1f;
+ camera.far = 300f;
+ camera.position.set(0f, 8f, 15f);
+ camera.lookAt(planeScene.modelInstance.transform.getTranslation(new Vector3()));
+ camera.update();
+
+ sceneManager.setCamera(camera);
+
+ DirectionalShadowLight light = new DirectionalShadowLight(1024, 1024, 60f, 60f, 1f, 300f);
+ light.set(new Color(0xdcccffff), -1f, -0.8f, -0.2f);
+ light.intensity = 5f;
+ sceneManager.environment.add(light);
+ sceneManager.environment.shadowMap = light;
+
+ PointLightEx signLight = new PointLightEx();
+ signLight.set(Color.PINK, new Vector3(2f, 6f, 2f), 80f, 100f);
+
+ PointLightEx windowLight = new PointLightEx();
+ windowLight.set(Color.BLUE, new Vector3(-1.1f, 7.3f, 0.5f), 80f, 100f);
+
+ sceneManager.environment.add(windowLight, signLight);
+
+ // setup quick IBL (image based lighting)
+ IBLBuilder iblBuilder = IBLBuilder.createOutdoor(light);
+
+ Cubemap environmentCubemap = iblBuilder.buildEnvMap(1000);
+
+ Cubemap diffuseCubemap = iblBuilder.buildIrradianceMap(256);
+ Cubemap specularCubemap = iblBuilder.buildRadianceMap(10);
+ iblBuilder.dispose();
+
+ Texture brdfLUT = new Texture(Gdx.files.classpath("net/mgsx/gltf/shaders/brdfLUT.png"));
+
+ sceneManager.setAmbientLight(1f);
+ sceneManager.environment.set(new PBRTextureAttribute(PBRTextureAttribute.BRDFLUTTexture, brdfLUT));
+ sceneManager.environment.set(PBRCubemapAttribute.createSpecularEnv(specularCubemap));
+ sceneManager.environment.set(PBRCubemapAttribute.createDiffuseEnv(diffuseCubemap));
+
+ sceneManager.setSkyBox(new SceneSkybox(environmentCubemap));
+
+ decalBatch = new DecalBatch(new CameraGroupStrategy(camera));
+ }
+}
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..8d571e2
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,10 @@
+org.gradle.daemon=false
+org.gradle.jvmargs=-Xms512M -Xmx1G -Dfile.encoding=UTF-8 -Dconsole.encoding=UTF-8
+org.gradle.configureondemand=false
+gdxGltfVersion=2.2.1
+graalHelperVersion=2.0.1
+gwtFrameworkVersion=2.11.0
+gwtPluginVersion=1.1.29
+enableGraalNative=false
+gdxVersion=1.13.1
+projectVersion=1.0.0
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..a4b76b9
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..cea7a79
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,7 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
+networkTimeout=10000
+validateDistributionUrl=true
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
new file mode 100644
index 0000000..f3b75f3
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,251 @@
+#!/bin/sh
+
+#
+# Copyright © 2015-2021 the original authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+##############################################################################
+#
+# Gradle start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh Gradle
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+ [ -h "$app_path" ]
+do
+ ls=$( ls -ld "$app_path" )
+ link=${ls#*' -> '}
+ case $link in #(
+ /*) app_path=$link ;; #(
+ *) app_path=$APP_HOME$link ;;
+ esac
+done
+
+# This is normally unused
+# shellcheck disable=SC2034
+APP_BASE_NAME=${0##*/}
+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+ echo "$*"
+} >&2
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+} >&2
+
+# 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 ;; #(
+ MSYS* | 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
+ if ! command -v java >/dev/null 2>&1
+ then
+ 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
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+ case $MAX_FD in #(
+ max*)
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ MAX_FD=$( ulimit -H -n ) ||
+ warn "Could not query maximum file descriptor limit"
+ esac
+ case $MAX_FD in #(
+ '' | soft) :;; #(
+ *)
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ ulimit -n "$MAX_FD" ||
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
+ esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ for arg do
+ if
+ case $arg in #(
+ -*) false ;; # don't mess with options #(
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+ [ -e "$t" ] ;; #(
+ *) false ;;
+ esac
+ then
+ arg=$( cygpath --path --ignore --mixed "$arg" )
+ fi
+ # Roll the args list around exactly as many times as the number of
+ # args, so each arg winds up back in the position where it started, but
+ # possibly modified.
+ #
+ # NB: a `for` loop captures its iteration list before it begins, so
+ # changing the positional parameters here affects neither the number of
+ # iterations, nor the values presented in `arg`.
+ shift # remove old arg
+ set -- "$@" "$arg" # push replacement arg
+ done
+fi
+
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Collect all arguments for the java command:
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# and any embedded shellness will be escaped.
+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+# treated as '${Hostname}' itself on the command line.
+
+set -- \
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
+ -classpath "$CLASSPATH" \
+ org.gradle.wrapper.GradleWrapperMain \
+ "$@"
+
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+ die "xargs is not available"
+fi
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+ xargs -n1 |
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+ tr '\n' ' '
+ )" '"$@"'
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..9d21a21
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,94 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+@rem SPDX-License-Identifier: Apache-2.0
+@rem
+
+@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=.
+@rem This is normally unused
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@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="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if %ERRORLEVEL% equ 0 goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+: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 %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if %ERRORLEVEL% equ 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!
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/html/build.gradle b/html/build.gradle
new file mode 100644
index 0000000..2036b11
--- /dev/null
+++ b/html/build.gradle
@@ -0,0 +1,157 @@
+
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+ dependencies {
+ classpath 'org.gretty:gretty:3.1.0'
+ classpath "org.docstr:gwt-gradle-plugin:$gwtPluginVersion"
+
+ }
+}
+apply plugin: "gwt"
+apply plugin: "war"
+apply plugin: "org.gretty"
+
+gwt {
+ gwtVersion = "$gwtFrameworkVersion" // Should match the version used for building the GWT backend. See gradle.properties.
+ maxHeapSize = '1G' // Default 256m is not enough for the GWT compiler. GWT is HUNGRY.
+ minHeapSize = '1G'
+
+ src = files(file('src/main/java')) // Needs to be in front of "modules" below.
+ modules 'kz.ilotterytea.frogartha.GdxDefinition'
+ devModules 'kz.ilotterytea.frogartha.GdxDefinitionSuperdev'
+ project.webAppDirName = 'webapp'
+
+ compiler.strict = true
+ compiler.disableCastChecking = true
+ //// The next line can be useful to uncomment if you want output that hasn't been obfuscated.
+// compiler.style = org.docstr.gradle.plugins.gwt.Style.DETAILED
+
+ sourceLevel = 1.11
+}
+
+dependencies {
+ implementation "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
+ implementation "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
+ implementation "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
+ implementation "com.github.mgsx-dev.gdx-gltf:gltf:$gdxGltfVersion:sources"
+ implementation project(':core')
+
+}
+
+import org.akhikhl.gretty.AppBeforeIntegrationTestTask
+import org.docstr.gradle.plugins.gwt.GwtSuperDev
+
+gretty.httpPort = 8080
+// The line below will need to be changed only if you change the build directory to something other than "build".
+gretty.resourceBase = "${project.layout.buildDirectory.asFile.get().absolutePath}/gwt/draftOut"
+gretty.contextPath = "/"
+gretty.portPropertiesFileName = "TEMP_PORTS.properties"
+
+task startHttpServer (dependsOn: [draftCompileGwt]) {
+ doFirst {
+ copy {
+ from "webapp"
+ into gretty.resourceBase
+ }
+ copy {
+ from "war"
+ into gretty.resourceBase
+ }
+ }
+}
+task beforeRun(type: AppBeforeIntegrationTestTask, dependsOn: startHttpServer) {
+ // The next line allows ports to be reused instead of
+ // needing a process to be manually terminated.
+ file("build/TEMP_PORTS.properties").delete()
+ // Somewhat of a hack; uses Gretty's support for wrapping a task in
+ // a start and then stop of a Jetty server that serves files while
+ // also running the SuperDev code server.
+ integrationTestTask 'superDev'
+
+ interactive false
+}
+
+task superDev(type: GwtSuperDev) {
+ doFirst {
+ gwt.modules = gwt.devModules
+ }
+}
+
+//// We delete the (temporary) war/ folder because if any extra files get into it, problems occur.
+//// The war/ folder shouldn't be committed to version control.
+clean.delete += [file("war")]
+
+// This next line can be changed if you want to, for instance, always build into the
+// docs/ folder of a Git repo, which can be set to automatically publish on GitHub Pages.
+// This is relative to the html/ folder.
+var outputPath = "build/dist/"
+
+task dist(dependsOn: [clean, compileGwt]) {
+ doLast {
+ // Uncomment the next line if you have changed outputPath and know that its contents
+ // should be replaced by a new dist build. Some large JS files are not cleaned up by
+ // default unless the outputPath is inside build/ (then the clean task removes them).
+ // Do not uncomment the next line if you changed outputPath to a folder that has
+ // non-generated files that you want to keep!
+ //delete(file(outputPath))
+
+ file(outputPath).mkdirs()
+ copy {
+ from("build/gwt/out"){
+ exclude '**/*.symbolMap' // Not used by a dist, and these can be large.
+ }
+ into outputPath
+ }
+ copy {
+ from("webapp") {
+ exclude 'index.html' // We edit this HTML file later.
+ exclude 'refresh.png' // We don't need this button; this saves some bytes.
+ }
+ into outputPath
+ }
+ copy {
+ from("webapp") {
+ // These next two lines take the index.html page and remove the superdev refresh button.
+ include 'index.html'
+ filter { String line -> line.replaceAll('<a class="superdev" .+', '') }
+ // This does not modify the original index.html, only the copy in the dist.
+ // If you decide to manually remove or comment out the superdev button from index.html, you should also
+ // either remove or comment out only the "filter" line above this.
+ }
+ into outputPath
+ }
+ copy {
+ from "war"
+ into outputPath
+ }
+ }
+}
+
+task addSource {
+ doLast {
+ sourceSets.main.compileClasspath += files(project(':core').sourceSets.main.allJava.srcDirs)
+ sourceSets.main.compileClasspath += files("../core/build/generated/sources/annotationProcessor/java/main")
+ sourceSets.main.compileClasspath += files(project(':shared').sourceSets.main.allJava.srcDirs)
+ }
+}
+
+task distZip(type: Zip, dependsOn: dist){
+ //// This uses the output of the dist task, which removes the superdev button from index.html .
+ from(outputPath)
+ archiveVersion = projectVersion
+ archiveBaseName.set("${appName}-dist")
+ //// The result will be in html/build/ with a name containing "-dist".
+ destinationDirectory.set(file("build"))
+}
+
+tasks.compileGwt.dependsOn(addSource)
+tasks.draftCompileGwt.dependsOn(addSource)
+tasks.checkGwt.dependsOn(addSource)
+
+java.sourceCompatibility = JavaVersion.VERSION_11
+java.targetCompatibility = JavaVersion.VERSION_11
+sourceSets.main.java.srcDirs = [ "src/main/java/" ]
+
+eclipse.project.name = appName + "-html"
diff --git a/html/src/main/java/kz/ilotterytea/frogartha/GdxDefinition.gwt.xml b/html/src/main/java/kz/ilotterytea/frogartha/GdxDefinition.gwt.xml
new file mode 100644
index 0000000..3f287d1
--- /dev/null
+++ b/html/src/main/java/kz/ilotterytea/frogartha/GdxDefinition.gwt.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.11.0//EN" "https://www.gwtproject.org/doctype/2.11.0/gwt-module.dtd">
+<module rename-to="html">
+ <!-- Paths to source are relative to this file and separated by slashes ('/'). -->
+ <source path="" />
+
+ <!-- "Inherits" lines are how GWT knows where to look for code and configuration in other projects or libraries. -->
+ <inherits name="com.badlogic.gdx.backends.gdx_backends_gwt" />
+ <inherits name="GLTF" />
+ <inherits name="kz.ilotterytea.frogartha.FrogarthaGame" />
+ <inherits name="kz.ilotterytea.frogartha.Shared" />
+
+ <!-- You must change this if you rename packages later, or rename GwtLauncher. -->
+ <entry-point class="kz.ilotterytea.frogartha.gwt.GwtLauncher" />
+
+ <!-- Reflection includes may be needed for your code or library code. Each value is separated by periods ('.'). -->
+ <!-- You can include a full package by not including the name of a type at the end. -->
+ <!-- This is a feature of libGDX, so these lines go after the above "inherits" that brings in libGDX. -->
+ <!-- <extend-configuration-property name="gdx.reflect.include" value="fully.qualified.TypeName" /> -->
+
+ <!-- Rarely, projects may need to include files but do not have access to the complete assets. -->
+ <!-- This happens for libraries and shared projects, typically, and the configuration goes in that project. -->
+ <!-- The value is a path, separated by forward slashes, where the root is your html project's resources root. -->
+ <!-- You can include individual files like this, and access them with Gdx.files.classpath("path/to/file.png") : -->
+ <!-- This is also a feature of libGDX, so these lines go after the above "inherits" that brings in libGDX. -->
+ <!-- <extend-configuration-property name="gdx.files.classpath" value="path/to/file.png" /> -->
+
+ <!-- You usually won't need to make changes to the rest of this. -->
+ <set-configuration-property name="gdx.assetpath" value="../assets" />
+ <set-configuration-property name="xsiframe.failIfScriptTag" value="FALSE"/>
+ <!-- These two lines reduce the work GWT has to do during compilation and also shrink output size. -->
+ <set-property name="user.agent" value="gecko1_8, safari"/>
+ <collapse-property name="user.agent" values="*" />
+ <!-- Remove the "user.agent" lines above if you encounter issues with Safari or other Gecko browsers. -->
+</module> \ No newline at end of file
diff --git a/html/src/main/java/kz/ilotterytea/frogartha/GdxDefinitionSuperdev.gwt.xml b/html/src/main/java/kz/ilotterytea/frogartha/GdxDefinitionSuperdev.gwt.xml
new file mode 100644
index 0000000..86d6eac
--- /dev/null
+++ b/html/src/main/java/kz/ilotterytea/frogartha/GdxDefinitionSuperdev.gwt.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.11.0//EN" "https://www.gwtproject.org/doctype/2.11.0/gwt-module.dtd">
+<module rename-to="html">
+ <inherits name="kz.ilotterytea.frogartha.GdxDefinition" />
+ <collapse-all-properties />
+ <add-linker name="xsiframe"/>
+ <set-configuration-property name="devModeRedirectEnabled" value="true"/>
+ <set-configuration-property name="xsiframe.failIfScriptTag" value="FALSE"/>
+</module> \ No newline at end of file
diff --git a/html/src/main/java/kz/ilotterytea/frogartha/gwt/GwtLauncher.java b/html/src/main/java/kz/ilotterytea/frogartha/gwt/GwtLauncher.java
new file mode 100644
index 0000000..a4e7ea3
--- /dev/null
+++ b/html/src/main/java/kz/ilotterytea/frogartha/gwt/GwtLauncher.java
@@ -0,0 +1,28 @@
+package kz.ilotterytea.frogartha.gwt;
+
+import com.badlogic.gdx.ApplicationListener;
+import com.badlogic.gdx.backends.gwt.GwtApplication;
+import com.badlogic.gdx.backends.gwt.GwtApplicationConfiguration;
+import kz.ilotterytea.frogartha.FrogarthaGame;
+
+/**
+ * Launches the GWT application.
+ */
+public class GwtLauncher extends GwtApplication {
+ @Override
+ public GwtApplicationConfiguration getConfig() {
+ // Resizable application, uses available space in browser with no padding:
+ GwtApplicationConfiguration cfg = new GwtApplicationConfiguration(true);
+ cfg.padVertical = 0;
+ cfg.padHorizontal = 0;
+ return cfg;
+ // If you want a fixed size application, comment out the above resizable section,
+ // and uncomment below:
+ //return new GwtApplicationConfiguration(640, 480);
+ }
+
+ @Override
+ public ApplicationListener createApplicationListener() {
+ return FrogarthaGame.getInstance();
+ }
+}
diff --git a/html/webapp/WEB-INF/web.xml b/html/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..4301df2
--- /dev/null
+++ b/html/webapp/WEB-INF/web.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" ?>
+<web-app>
+</web-app> \ No newline at end of file
diff --git a/html/webapp/index.html b/html/webapp/index.html
new file mode 100644
index 0000000..01f2f40
--- /dev/null
+++ b/html/webapp/index.html
@@ -0,0 +1,31 @@
+<!doctype html>
+<html>
+<head>
+ <title>Frogartha</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <meta id="gameViewport" name="viewport" content="width=device-width initial-scale=1">
+ <link href="styles.css" rel="stylesheet" type="text/css">
+</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();
+ window.focus();
+}
+
+function handleMouseUp(evt) {
+ evt.preventDefault();
+ evt.stopPropagation();
+}
+document.addEventListener('contextmenu', event => event.preventDefault());
+document.getElementById('embed-html').addEventListener('mousedown', handleMouseDown, false);
+document.getElementById('embed-html').addEventListener('mouseup', handleMouseUp, false);
+</script>
+</html>
diff --git a/html/webapp/refresh.png b/html/webapp/refresh.png
new file mode 100644
index 0000000..aab1e38
--- /dev/null
+++ b/html/webapp/refresh.png
Binary files differ
diff --git a/html/webapp/styles.css b/html/webapp/styles.css
new file mode 100644
index 0000000..e768a39
--- /dev/null
+++ b/html/webapp/styles.css
@@ -0,0 +1,53 @@
+canvas {
+ cursor: default;
+ outline: none;
+}
+
+body {
+ background-color: #222222;
+}
+
+p {
+ text-align: center;
+ color: #eeeeee;
+}
+
+a {
+ text-align: center;
+ color: #bbbbff;
+}
+
+.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);
+}
diff --git a/lwjgl3/build.gradle b/lwjgl3/build.gradle
new file mode 100644
index 0000000..e2986c6
--- /dev/null
+++ b/lwjgl3/build.gradle
@@ -0,0 +1,136 @@
+
+buildscript {
+ repositories {
+ gradlePluginPortal()
+ }
+ dependencies {
+ classpath "io.github.fourlastor:construo:1.5.1"
+ if(enableGraalNative == 'true') {
+ classpath "org.graalvm.buildtools.native:org.graalvm.buildtools.native.gradle.plugin:0.9.28"
+ }
+ }
+}
+plugins {
+ id "application"
+}
+apply plugin: 'io.github.fourlastor.construo'
+
+
+import io.github.fourlastor.construo.Target
+
+sourceSets.main.resources.srcDirs += [ rootProject.file('assets').path ]
+mainClassName = 'kz.ilotterytea.frogartha.lwjgl3.Lwjgl3Launcher'
+application.setMainClass(mainClassName)
+eclipse.project.name = appName + '-lwjgl3'
+java.sourceCompatibility = 11
+java.targetCompatibility = 11
+if (JavaVersion.current().isJava9Compatible()) {
+ compileJava.options.release.set(11)
+}
+
+dependencies {
+ implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
+ implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
+ implementation project(':core')
+
+ if(enableGraalNative == 'true') {
+ implementation "io.github.berstanio:gdx-svmhelper-backend-lwjgl3:$graalHelperVersion"
+ }
+
+}
+
+def os = System.properties['os.name'].toLowerCase()
+
+run {
+ workingDir = rootProject.file('assets').path
+// You can uncomment the next line if your IDE claims a build failure even when the app closed properly.
+ //setIgnoreExitValue(true)
+
+ if (os.contains('mac')) jvmArgs += "-XstartOnFirstThread"
+}
+
+jar {
+// sets the name of the .jar file this produces to the name of the game or app, with the version after.
+ archiveFileName.set("${appName}-${projectVersion}.jar")
+// the duplicatesStrategy matters starting in Gradle 7.0; this setting works.
+ duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
+ dependsOn configurations.runtimeClasspath
+ from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
+// these "exclude" lines remove some unnecessary duplicate files in the output JAR.
+ exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA')
+ dependencies {
+ exclude('META-INF/INDEX.LIST', 'META-INF/maven/**')
+ }
+// setting the manifest makes the JAR runnable.
+ manifest {
+ attributes 'Main-Class': project.mainClassName
+ }
+// this last step may help on some OSes that need extra instruction to make runnable JARs.
+ doLast {
+ file(archiveFile).setExecutable(true, false)
+ }
+}
+
+construo {
+ // name of the executable
+ name.set(appName)
+ // human-readable name, used for example in the `.app` name for macOS
+ humanName.set(appName)
+ // Optional, defaults to project version property
+ version.set("$projectVersion")
+
+ targets.configure {
+ create("linuxX64", Target.Linux) {
+ architecture.set(Target.Architecture.X86_64)
+ jdkUrl.set("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jdk_x64_linux_hotspot_17.0.12_7.tar.gz")
+ }
+ create("macM1", Target.MacOs) {
+ architecture.set(Target.Architecture.AARCH64)
+ jdkUrl.set("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.12_7.tar.gz")
+ // macOS needs an identifier
+ identifier.set("kz.ilotterytea.frogartha." + appName)
+ // Optional: icon for macOS
+ macIcon.set(project.file("icons/logo.icns"))
+ }
+ create("macX64", Target.MacOs) {
+ architecture.set(Target.Architecture.X86_64)
+ jdkUrl.set("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jdk_x64_mac_hotspot_17.0.12_7.tar.gz")
+ // macOS needs an identifier
+ identifier.set("kz.ilotterytea.frogartha." + appName)
+ // Optional: icon for macOS
+ macIcon.set(project.file("icons/logo.icns"))
+ }
+ create("winX64", Target.Windows) {
+ architecture.set(Target.Architecture.X86_64)
+ jdkUrl.set("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jdk_x64_windows_hotspot_17.0.12_7.zip")
+ // Uncomment the next line to show a console when the game runs, to print messages.
+ //useConsole.set(true)
+ }
+ }
+}
+
+// Equivalent to the jar task; here for compatibility with gdx-setup.
+tasks.register('dist') {
+ dependsOn 'jar'
+}
+
+distributions {
+ main {
+ contents {
+ into('libs') {
+ project.configurations.runtimeClasspath.files.findAll { file ->
+ file.getName() != project.tasks.jar.outputs.files.singleFile.name
+ }.each { file ->
+ exclude file.name
+ }
+ }
+ }
+ }
+}
+
+startScripts.dependsOn(':lwjgl3:jar')
+startScripts.classpath = project.tasks.jar.outputs.files
+
+if(enableGraalNative == 'true') {
+ apply from: file("nativeimage.gradle")
+}
diff --git a/lwjgl3/icons/logo.icns b/lwjgl3/icons/logo.icns
new file mode 100644
index 0000000..5e41ad7
--- /dev/null
+++ b/lwjgl3/icons/logo.icns
Binary files differ
diff --git a/lwjgl3/icons/logo.ico b/lwjgl3/icons/logo.ico
new file mode 100644
index 0000000..c4f2d5e
--- /dev/null
+++ b/lwjgl3/icons/logo.ico
Binary files differ
diff --git a/lwjgl3/icons/logo.png b/lwjgl3/icons/logo.png
new file mode 100644
index 0000000..788f542
--- /dev/null
+++ b/lwjgl3/icons/logo.png
Binary files differ
diff --git a/lwjgl3/nativeimage.gradle b/lwjgl3/nativeimage.gradle
new file mode 100644
index 0000000..ff349fd
--- /dev/null
+++ b/lwjgl3/nativeimage.gradle
@@ -0,0 +1,54 @@
+
+project(":lwjgl3") {
+ apply plugin: "org.graalvm.buildtools.native"
+
+ graalvmNative {
+ binaries {
+ main {
+ imageName = appName
+ mainClass = project.mainClassName
+ requiredVersion = '23.0'
+ buildArgs.add("-march=compatibility")
+ jvmArgs.addAll("-Dfile.encoding=UTF8")
+ sharedLibrary = false
+ resources.autodetect()
+ }
+ }
+ }
+
+ run {
+ doNotTrackState("Running the app should not be affected by Graal.")
+ }
+
+ // Modified from https://lyze.dev/2021/04/29/libGDX-Internal-Assets-List/ ; thanks again, Lyze!
+ // This creates a resource-config.json file based on the contents of the assets folder (and the libGDX icons).
+ // This file is used by Graal Native to embed those specific files.
+ // This has to run before nativeCompile, so it runs at the start of an unrelated resource-handling command.
+ generateResourcesConfigFile.doFirst {
+ def assetsFolder = new File("${project.rootDir}/assets/")
+ def lwjgl3 = project(':lwjgl3')
+ def resFolder = new File("${lwjgl3.projectDir}/src/main/resources/META-INF/native-image/${lwjgl3.ext.appName}")
+ resFolder.mkdirs()
+ def resFile = new File(resFolder, "resource-config.json")
+ resFile.delete()
+ resFile.append(
+ """{
+ "resources":{
+ "includes":[
+ {
+ "pattern": ".*(""")
+ // This adds every filename in the assets/ folder to a pattern that adds those files as resources.
+ fileTree(assetsFolder).each {
+ // The backslash-Q and backslash-E escape the start and end of a literal string, respectively.
+ resFile.append("\\\\Q${it.name}\\\\E|")
+ }
+ // We also match all of the window icon images this way and the font files that are part of libGDX.
+ resFile.append(
+ """libgdx.+\\\\.png|lsans.+)"
+ }
+ ]},
+ "bundles":[]
+}"""
+ )
+ }
+}
diff --git a/lwjgl3/src/main/java/kz/ilotterytea/frogartha/lwjgl3/Lwjgl3Launcher.java b/lwjgl3/src/main/java/kz/ilotterytea/frogartha/lwjgl3/Lwjgl3Launcher.java
new file mode 100644
index 0000000..e63402b
--- /dev/null
+++ b/lwjgl3/src/main/java/kz/ilotterytea/frogartha/lwjgl3/Lwjgl3Launcher.java
@@ -0,0 +1,33 @@
+package kz.ilotterytea.frogartha.lwjgl3;
+
+import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
+import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
+import kz.ilotterytea.frogartha.FrogarthaGame;
+
+/**
+ * Launches the desktop (LWJGL3) application.
+ */
+public class Lwjgl3Launcher {
+ public static void main(String[] args) {
+ if (StartupHelper.startNewJvmIfRequired()) return; // This handles macOS support and helps on Windows.
+ new Lwjgl3Application(FrogarthaGame.getInstance(), getDefaultConfiguration());
+ }
+
+ private static Lwjgl3ApplicationConfiguration getDefaultConfiguration() {
+ Lwjgl3ApplicationConfiguration configuration = new Lwjgl3ApplicationConfiguration();
+ configuration.setTitle("Frogartha");
+ //// Vsync limits the frames per second to what your hardware can display, and helps eliminate
+ //// screen tearing. This setting doesn't always work on Linux, so the line after is a safeguard.
+ configuration.useVsync(true);
+ //// Limits FPS to the refresh rate of the currently active monitor, plus 1 to try to match fractional
+ //// refresh rates. The Vsync setting above should limit the actual FPS to match the monitor.
+ configuration.setForegroundFPS(Lwjgl3ApplicationConfiguration.getDisplayMode().refreshRate + 1);
+ //// If you remove the above line and set Vsync to false, you can get unlimited FPS, which can be
+ //// useful for testing performance, but can also be very stressful to some hardware.
+ //// You may also need to configure GPU drivers to fully disable Vsync; this can cause screen tearing.
+ configuration.setWindowedMode(800, 600);
+ //// You can change these files; they are in lwjgl3/src/main/resources/ .
+ configuration.setWindowIcon("libgdx128.png", "libgdx64.png", "libgdx32.png", "libgdx16.png");
+ return configuration;
+ }
+}
diff --git a/lwjgl3/src/main/java/kz/ilotterytea/frogartha/lwjgl3/StartupHelper.java b/lwjgl3/src/main/java/kz/ilotterytea/frogartha/lwjgl3/StartupHelper.java
new file mode 100644
index 0000000..b51d415
--- /dev/null
+++ b/lwjgl3/src/main/java/kz/ilotterytea/frogartha/lwjgl3/StartupHelper.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright 2020 damios
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//Note, the above license and copyright applies to this file only.
+
+package kz.ilotterytea.frogartha.lwjgl3;
+
+import org.lwjgl.system.macosx.LibC;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.InputStreamReader;
+import java.lang.management.ManagementFactory;
+import java.util.ArrayList;
+
+/**
+ * Adds some utilities to ensure that the JVM was started with the
+ * {@code -XstartOnFirstThread} argument, which is required on macOS for LWJGL 3
+ * to function. Also helps on Windows when users have names with characters from
+ * outside the Latin alphabet, a common cause of startup crashes.
+ * <br>
+ * <a href="https://jvm-gaming.org/t/starting-jvm-on-mac-with-xstartonfirstthread-programmatically/57547">Based on this java-gaming.org post by kappa</a>
+ * @author damios
+ */
+public class StartupHelper {
+
+ private static final String JVM_RESTARTED_ARG = "jvmIsRestarted";
+
+ private StartupHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Starts a new JVM if the application was started on macOS without the
+ * {@code -XstartOnFirstThread} argument. This also includes some code for
+ * Windows, for the case where the user's home directory includes certain
+ * non-Latin-alphabet characters (without this code, most LWJGL3 apps fail
+ * immediately for those users). Returns whether a new JVM was started and
+ * thus no code should be executed.
+ * <p>
+ * <u>Usage:</u>
+ *
+ * <pre><code>
+ * public static void main(String... args) {
+ * if (StartupHelper.startNewJvmIfRequired(true)) return; // This handles macOS support and helps on Windows.
+ * // after this is the actual main method code
+ * }
+ * </code></pre>
+ *
+ * @param redirectOutput
+ * whether the output of the new JVM should be rerouted to the
+ * old JVM, so it can be accessed in the same place; keeps the
+ * old JVM running if enabled
+ * @return whether a new JVM was started and thus no code should be executed
+ * in this one
+ */
+ public static boolean startNewJvmIfRequired(boolean redirectOutput) {
+ String osName = System.getProperty("os.name").toLowerCase();
+ if (!osName.contains("mac")) {
+ if (osName.contains("windows")) {
+// Here, we are trying to work around an issue with how LWJGL3 loads its extracted .dll files.
+// By default, LWJGL3 extracts to the directory specified by "java.io.tmpdir", which is usually the user's home.
+// If the user's name has non-ASCII (or some non-alphanumeric) characters in it, that would fail.
+// By extracting to the relevant "ProgramData" folder, which is usually "C:\ProgramData", we avoid this.
+ System.setProperty("java.io.tmpdir", System.getenv("ProgramData") + "/libGDX-temp");
+ }
+ return false;
+ }
+
+ // There is no need for -XstartOnFirstThread on Graal native image
+ if (!System.getProperty("org.graalvm.nativeimage.imagecode", "").isEmpty()) {
+ return false;
+ }
+
+ long pid = LibC.getpid();
+
+ // check whether -XstartOnFirstThread is enabled
+ if ("1".equals(System.getenv("JAVA_STARTED_ON_FIRST_THREAD_" + pid))) {
+ return false;
+ }
+
+ // check whether the JVM was previously restarted
+ // avoids looping, but most certainly leads to a crash
+ if ("true".equals(System.getProperty(JVM_RESTARTED_ARG))) {
+ System.err.println(
+ "There was a problem evaluating whether the JVM was started with the -XstartOnFirstThread argument.");
+ return false;
+ }
+
+ // Restart the JVM with -XstartOnFirstThread
+ ArrayList<String> jvmArgs = new ArrayList<>();
+ String separator = System.getProperty("file.separator");
+ // The following line is used assuming you target Java 8, the minimum for LWJGL3.
+ String javaExecPath = System.getProperty("java.home") + separator + "bin" + separator + "java";
+ // If targeting Java 9 or higher, you could use the following instead of the above line:
+ //String javaExecPath = ProcessHandle.current().info().command().orElseThrow();
+
+ if (!(new File(javaExecPath)).exists()) {
+ System.err.println(
+ "A Java installation could not be found. If you are distributing this app with a bundled JRE, be sure to set the -XstartOnFirstThread argument manually!");
+ return false;
+ }
+
+ jvmArgs.add(javaExecPath);
+ jvmArgs.add("-XstartOnFirstThread");
+ jvmArgs.add("-D" + JVM_RESTARTED_ARG + "=true");
+ jvmArgs.addAll(ManagementFactory.getRuntimeMXBean().getInputArguments());
+ jvmArgs.add("-cp");
+ jvmArgs.add(System.getProperty("java.class.path"));
+ String mainClass = System.getenv("JAVA_MAIN_CLASS_" + pid);
+ if (mainClass == null) {
+ StackTraceElement[] trace = Thread.currentThread().getStackTrace();
+ if (trace.length > 0) {
+ mainClass = trace[trace.length - 1].getClassName();
+ } else {
+ System.err.println("The main class could not be determined.");
+ return false;
+ }
+ }
+ jvmArgs.add(mainClass);
+
+ try {
+ if (!redirectOutput) {
+ ProcessBuilder processBuilder = new ProcessBuilder(jvmArgs);
+ processBuilder.start();
+ } else {
+ Process process = (new ProcessBuilder(jvmArgs))
+ .redirectErrorStream(true).start();
+ BufferedReader processOutput = new BufferedReader(
+ new InputStreamReader(process.getInputStream()));
+ String line;
+
+ while ((line = processOutput.readLine()) != null) {
+ System.out.println(line);
+ }
+
+ process.waitFor();
+ }
+ } catch (Exception e) {
+ System.err.println("There was a problem restarting the JVM");
+ e.printStackTrace();
+ }
+
+ return true;
+ }
+
+ /**
+ * Starts a new JVM if the application was started on macOS without the
+ * {@code -XstartOnFirstThread} argument. Returns whether a new JVM was
+ * started and thus no code should be executed. Redirects the output of the
+ * new JVM to the old one.
+ * <p>
+ * <u>Usage:</u>
+ *
+ * <pre>
+ * public static void main(String... args) {
+ * if (StartupHelper.startNewJvmIfRequired()) return; // This handles macOS support and helps on Windows.
+ * // the actual main method code
+ * }
+ * </pre>
+ *
+ * @return whether a new JVM was started and thus no code should be executed
+ * in this one
+ */
+ public static boolean startNewJvmIfRequired() {
+ return startNewJvmIfRequired(true);
+ }
+} \ No newline at end of file
diff --git a/lwjgl3/src/main/resources/libgdx128.png b/lwjgl3/src/main/resources/libgdx128.png
new file mode 100644
index 0000000..788f542
--- /dev/null
+++ b/lwjgl3/src/main/resources/libgdx128.png
Binary files differ
diff --git a/lwjgl3/src/main/resources/libgdx16.png b/lwjgl3/src/main/resources/libgdx16.png
new file mode 100644
index 0000000..47af189
--- /dev/null
+++ b/lwjgl3/src/main/resources/libgdx16.png
Binary files differ
diff --git a/lwjgl3/src/main/resources/libgdx32.png b/lwjgl3/src/main/resources/libgdx32.png
new file mode 100644
index 0000000..4cf903a
--- /dev/null
+++ b/lwjgl3/src/main/resources/libgdx32.png
Binary files differ
diff --git a/lwjgl3/src/main/resources/libgdx64.png b/lwjgl3/src/main/resources/libgdx64.png
new file mode 100644
index 0000000..ebcd8f1
--- /dev/null
+++ b/lwjgl3/src/main/resources/libgdx64.png
Binary files differ
diff --git a/server/build.gradle b/server/build.gradle
new file mode 100644
index 0000000..1aaf851
--- /dev/null
+++ b/server/build.gradle
@@ -0,0 +1,41 @@
+apply plugin: 'application'
+
+
+java.sourceCompatibility = 11
+java.targetCompatibility = 11
+if (JavaVersion.current().isJava9Compatible()) {
+ compileJava.options.release.set(11)
+}
+
+mainClassName = 'kz.ilotterytea.frogartha.server.ServerLauncher'
+application.setMainClass(mainClassName)
+eclipse.project.name = appName + '-server'
+
+dependencies {
+ implementation project(':shared')
+}
+
+jar {
+ archiveBaseName.set(appName)
+// the duplicatesStrategy matters starting in Gradle 7.0; this setting works.
+ duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
+ dependsOn configurations.runtimeClasspath
+ from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
+// these "exclude" lines remove some unnecessary duplicate files in the output JAR.
+ exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA')
+ dependencies {
+ exclude('META-INF/INDEX.LIST', 'META-INF/maven/**')
+ }
+// setting the manifest makes the JAR runnable.
+ manifest {
+ attributes 'Main-Class': project.mainClassName
+ }
+// this last step may help on some OSes that need extra instruction to make runnable JARs.
+ doLast {
+ file(archiveFile).setExecutable(true, false)
+ }
+}
+
+// Equivalent to the jar task; here for compatibility with gdx-setup.
+task dist(dependsOn: [jar]) {
+}
diff --git a/server/src/main/java/kz/ilotterytea/frogartha/server/ServerLauncher.java b/server/src/main/java/kz/ilotterytea/frogartha/server/ServerLauncher.java
new file mode 100644
index 0000000..fc7c1e5
--- /dev/null
+++ b/server/src/main/java/kz/ilotterytea/frogartha/server/ServerLauncher.java
@@ -0,0 +1,8 @@
+package kz.ilotterytea.frogartha.server;
+
+/** Launches the server application. */
+public class ServerLauncher {
+ public static void main(String[] args) {
+ // TODO Implement server application.
+ }
+} \ No newline at end of file
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..9b03675
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1,4 @@
+// A list of which subprojects to load as part of the same larger project.
+// You can remove Strings from the list and reload the Gradle project
+// if you want to temporarily disable a subproject.
+include 'lwjgl3', 'server', 'shared', 'html', 'core'
diff --git a/shared/build.gradle b/shared/build.gradle
new file mode 100644
index 0000000..1eafc3b
--- /dev/null
+++ b/shared/build.gradle
@@ -0,0 +1,5 @@
+eclipse.project.name = appName + '-shared'
+
+dependencies {
+
+}
diff --git a/shared/src/main/java/kz/ilotterytea/frogartha/Shared.gwt.xml b/shared/src/main/java/kz/ilotterytea/frogartha/Shared.gwt.xml
new file mode 100644
index 0000000..7a8bcec
--- /dev/null
+++ b/shared/src/main/java/kz/ilotterytea/frogartha/Shared.gwt.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.11.0//EN" "https://www.gwtproject.org/doctype/2.11.0/gwt-module.dtd">
+<module>
+ <!-- Paths to source are relative to this file and separated by slashes ('/'). -->
+ <source path="" />
+
+ <!-- Reflection includes may be needed for your code or library code. Each value is separated by periods ('.'). -->
+ <!-- You can include a full package by not including the name of a type at the end. -->
+ <!-- <extend-configuration-property name="gdx.reflect.include" value="fully.qualified.TypeName" /> -->
+
+ <!-- Rarely, projects may need to include files but do not have access to the complete assets. -->
+ <!-- This happens for libraries and shared projects, typically, and the configuration goes in that project. -->
+ <!-- You can include individual files like this, and access them with Gdx.files.classpath("path/to/file.png") : -->
+ <!-- <extend-configuration-property name="gdx.files.classpath" value="path/to/file.png" /> -->
+</module> \ No newline at end of file