[Init] v1
@@ -0,0 +1,115 @@
|
||||
## 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/
|
||||
*.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/
|
||||
|
||||
/build/
|
||||
/android/build/
|
||||
/core/build/
|
||||
/desktop/build/
|
||||
/html/build/
|
||||
/ios/build/
|
||||
|
||||
/nbbuild/
|
||||
/android/nbbuild/
|
||||
/core/nbbuild/
|
||||
/desktop/nbbuild/
|
||||
/html/nbbuild/
|
||||
/ios/nbbuild/
|
||||
|
||||
/dist/
|
||||
/android/dist/
|
||||
/core/dist/
|
||||
/desktop/dist/
|
||||
/html/dist/
|
||||
/ios/dist/
|
||||
|
||||
/nbdist/
|
||||
/android/nbdist/
|
||||
/core/nbdist/
|
||||
/desktop/nbdist/
|
||||
/html/nbdist/
|
||||
/ios/nbdist/
|
||||
|
||||
nbactions.xml
|
||||
nb-configuration.xml
|
||||
|
||||
## Gradle
|
||||
|
||||
/local.properties
|
||||
.gradle/
|
||||
gradle-app.setting
|
||||
/build/
|
||||
/android/build/
|
||||
/core/build/
|
||||
/desktop/build/
|
||||
/html/build/
|
||||
/ios/build/
|
||||
|
||||
## OS Specific
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
## iOS
|
||||
/ios/xcode/*.xcodeproj/*
|
||||
!/ios/xcode/*.xcodeproj/xcshareddata
|
||||
!/ios/xcode/*.xcodeproj/project.pbxproj
|
||||
/ios/xcode/native/
|
||||
/ios/IOSLauncher.app
|
||||
/ios/IOSLauncher.app.dSYM
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.badlogic.drop"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="8"
|
||||
android:targetSdkVersion="20"/>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:appCategory="game"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:isGame="true"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/GdxTheme">
|
||||
<activity
|
||||
android:configChanges="keyboard|keyboardHidden|navigation|orientation|screenSize|screenLayout"
|
||||
android:label="@string/app_name"
|
||||
android:name="com.badlogic.drop.AndroidLauncher"
|
||||
android:screenOrientation="landscape">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
@@ -0,0 +1,92 @@
|
||||
android {
|
||||
buildToolsVersion "30.0.3"
|
||||
compileSdkVersion 30
|
||||
sourceSets {
|
||||
main {
|
||||
manifest.srcFile 'AndroidManifest.xml'
|
||||
java.srcDirs = ['src']
|
||||
aidl.srcDirs = ['src']
|
||||
renderscript.srcDirs = ['src']
|
||||
res.srcDirs = ['res']
|
||||
assets.srcDirs = ['assets']
|
||||
jniLibs.srcDirs = ['libs']
|
||||
}
|
||||
|
||||
}
|
||||
packagingOptions {
|
||||
exclude 'META-INF/robovm/ios/robovm.xml'
|
||||
}
|
||||
defaultConfig {
|
||||
applicationId "com.badlogic.drop"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 30
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled true
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// called every time gradle gets executed, takes the native dependencies of
|
||||
// the natives configuration, and extracts them to the proper libs/ folders
|
||||
// so they get packed with the APK.
|
||||
task copyAndroidNatives {
|
||||
doFirst {
|
||||
file("libs/armeabi/").mkdirs()
|
||||
file("libs/armeabi-v7a/").mkdirs()
|
||||
file("libs/arm64-v8a/").mkdirs()
|
||||
file("libs/x86_64/").mkdirs()
|
||||
file("libs/x86/").mkdirs()
|
||||
|
||||
configurations.natives.copy().files.each { jar ->
|
||||
def outputDir = null
|
||||
if (jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
|
||||
if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
|
||||
if (jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
|
||||
if (jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
|
||||
if (jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
|
||||
if (outputDir != null) {
|
||||
copy {
|
||||
from zipTree(jar)
|
||||
into outputDir
|
||||
include "*.so"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.whenTaskAdded { packageTask ->
|
||||
if (packageTask.name.contains("package")) {
|
||||
packageTask.dependsOn 'copyAndroidNatives'
|
||||
}
|
||||
}
|
||||
|
||||
task run(type: Exec) {
|
||||
def path
|
||||
def localProperties = project.file("../local.properties")
|
||||
if (localProperties.exists()) {
|
||||
Properties properties = new Properties()
|
||||
localProperties.withInputStream { instr ->
|
||||
properties.load(instr)
|
||||
}
|
||||
def sdkDir = properties.getProperty('sdk.dir')
|
||||
if (sdkDir) {
|
||||
path = sdkDir
|
||||
} else {
|
||||
path = "$System.env.ANDROID_HOME"
|
||||
}
|
||||
} else {
|
||||
path = "$System.env.ANDROID_HOME"
|
||||
}
|
||||
|
||||
def adb = path + "/platform-tools/adb"
|
||||
commandLine "$adb", 'shell', 'am', 'start', '-n', 'com.badlogic.drop/com.badlogic.drop.AndroidLauncher'
|
||||
}
|
||||
|
||||
eclipse.project.name = appName + "-android"
|
||||
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,42 @@
|
||||
# To enable ProGuard in your project, edit project.properties
|
||||
# to define the proguard.config property as described in that file.
|
||||
#
|
||||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in ${sdk.dir}/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the ProGuard
|
||||
# include property in project.properties.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
-verbose
|
||||
|
||||
-dontwarn com.badlogic.gdx.backends.android.AndroidFragmentApplication
|
||||
-dontwarn com.badlogic.gdx.utils.GdxBuild
|
||||
-dontwarn com.badlogic.gdx.physics.box2d.utils.Box2DBuild
|
||||
-dontwarn com.badlogic.gdx.jnigen.BuildTarget*
|
||||
-dontwarn com.badlogic.gdx.graphics.g2d.freetype.FreetypeBuild
|
||||
|
||||
# Required if using Gdx-Controllers extension
|
||||
-keep class com.badlogic.gdx.controllers.android.AndroidControllers
|
||||
|
||||
# Required if using Box2D extension
|
||||
-keepclassmembers class com.badlogic.gdx.physics.box2d.World {
|
||||
boolean contactFilter(long, long);
|
||||
void beginContact(long);
|
||||
void endContact(long);
|
||||
void preSolve(long, long);
|
||||
void postSolve(long, long);
|
||||
boolean reportFixture(long);
|
||||
float reportRayFixture(long, float, float, float, float, float);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
# This file is used by the Eclipse ADT plugin. It is unnecessary for IDEA and Android Studio projects, which
|
||||
# configure Proguard and the Android target via the build.gradle file.
|
||||
# To enable ProGuard to work with Eclipse ADT, uncomment this (available properties: sdk.dir, user.home)
|
||||
# and ensure proguard.jar in the Android SDK is up to date (or alternately reduce the android target to 23 or lower):
|
||||
# proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-rules.pro
|
||||
# Project target.
|
||||
target=android-19
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_background_color"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,40 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108"
|
||||
android:width="108dp">
|
||||
<path
|
||||
android:fillAlpha="1"
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M22,48.667l2.987,0l0,10.667l-2.987,0z"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:fillAlpha="1"
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M26.907,52.72l2.987,0l0,6.613l-2.987,0z"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:fillAlpha="1"
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M26.907,48.667l2.987,0l0,2.56l-2.987,0z"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:fillAlpha="1"
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M31.813,48.667L31.813,52.72 31.813,55.067 31.813,56.767 31.813,59.333l2.992,0 2.117,0c1.654,0 2.998,-1.481 2.998,-3.307 0,-1.826 -1.344,-3.307 -2.998,-3.307l-2.117,0L34.805,48.667ZM34.805,55.067l1.269,0c0.469,0 0.848,0.384 0.848,0.853 0,0.469 -0.379,0.847 -0.848,0.847l-1.269,0z"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:fillAlpha="1"
|
||||
android:fillColor="#e74a45"
|
||||
android:pathData="m44.192,48.667c-1.65,0 -2.992,1.481 -2.992,3.307 0,0.023 -0,0.044 0,0.067 0,0.004 -0,0.009 0,0.013l0,3.893c-0.001,0.027 0,0.053 0,0.08 0,1.826 1.341,3.307 2.992,3.307l2.112,0 0.247,0 2.739,0 0.247,0 2.112,0c1.651,0 2.992,-1.481 2.992,-3.307 0,-1.826 -1.341,-3.307 -2.992,-3.307l-1.199,0 -0.48,0 -2.372,0l0,2.347l2.372,0 0.48,0 0.353,0c0.468,0 0.846,0.384 0.846,0.853 0,0.469 -0.378,0.847 -0.846,0.847l-0.833,0 -0.433,0 -0.247,0 -2.739,0 -0.247,0 -0.433,0 -0.833,0c-0.459,0 -0.832,-0.363 -0.846,-0.82l0,-3.893 0,-0.013c0.021,-0.45 0.391,-0.807 0.846,-0.807l0.833,0 0.433,0 1.293,0l0,0.007L54.207,51.24L54.207,48.667l-4.917,0 -1.692,0 -1.293,0 -2.112,0z"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:fillAlpha="1"
|
||||
android:fillColor="#e74a45"
|
||||
android:pathData="M56.133,48.667L56.133,51.238l5.406,0 1.859,0 1.105,0 0.43,0 0.827,0c0.452,0 0.82,0.356 0.84,0.806l0,0.013 0,3.891c-0.014,0.456 -0.384,0.819 -0.84,0.819l-0.827,0 -0.43,0 -1.899,0 -1.065,0 -2.442,0L59.098,52.724L56.133,52.724l0,4.044 0,1.752 0,0.813l5.406,0 1.065,0 1.899,0 2.098,0c1.639,0 2.971,-1.48 2.971,-3.305 0,-0.027 0.001,-0.053 0,-0.08L69.573,52.058c0,-0.004 -0,-0.009 0,-0.013 0,-0.022 0,-0.044 0,-0.067 0,-1.825 -1.332,-3.305 -2.971,-3.305l-2.098,0 -1.105,0l0,-0.007L56.133,48.667Z"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:fillColor="#e74a45"
|
||||
android:pathData="M69.572,48.667L73.72,48.667L77.787,52.733 81.853,48.667l4.147,0l-5.333,5.333 5.333,5.333L81.853,59.333L77.787,55.267 73.72,59.333l-4.147,0l5.333,-5.333z"
|
||||
android:strokeColor="#00000000"/>
|
||||
</vector>
|
||||
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 19 KiB |
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_background_color">#FFFFFFFF</color>
|
||||
</resources>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">drop</string>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,12 @@
|
||||
<resources>
|
||||
|
||||
<style name="GdxTheme" parent="android:Theme">
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||
<item name="android:windowAnimationStyle">@android:style/Animation</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.badlogic.drop;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.badlogic.gdx.backends.android.AndroidApplication;
|
||||
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
|
||||
|
||||
public class AndroidLauncher extends AndroidApplication {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
|
||||
config.useAccelerometer = false;
|
||||
config.useCompass = false;
|
||||
initialize(new Drop(), config);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
buildscript {
|
||||
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'org.wisepersist:gwt-gradle-plugin:1.0.13'
|
||||
classpath 'org.gretty:gretty:3.0.2'
|
||||
classpath 'com.android.tools.build:gradle:4.2.0'
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
apply plugin: "eclipse"
|
||||
|
||||
version = '1.0'
|
||||
ext {
|
||||
appName = "drop"
|
||||
gdxVersion = '1.10.0'
|
||||
roboVMVersion = '2.3.12'
|
||||
box2DLightsVersion = '1.5'
|
||||
ashleyVersion = '1.7.3'
|
||||
aiVersion = '1.8.2'
|
||||
gdxControllersVersion = '2.1.0'
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
google()
|
||||
gradlePluginPortal()
|
||||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
|
||||
}
|
||||
}
|
||||
|
||||
project(":desktop") {
|
||||
apply plugin: "java-library"
|
||||
|
||||
|
||||
dependencies {
|
||||
implementation project(":core")
|
||||
api "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
|
||||
api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
||||
api "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
project(":core") {
|
||||
apply plugin: "java-library"
|
||||
|
||||
|
||||
dependencies {
|
||||
api "com.badlogicgames.gdx:gdx:$gdxVersion"
|
||||
api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
project(":html") {
|
||||
apply plugin: "java-library"
|
||||
apply plugin: "gwt"
|
||||
apply plugin: "war"
|
||||
apply plugin: "org.gretty"
|
||||
|
||||
|
||||
dependencies {
|
||||
implementation project(":core")
|
||||
api "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
|
||||
api "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
|
||||
api "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
|
||||
api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion:sources"
|
||||
api "com.badlogicgames.gdx:gdx-box2d-gwt:$gdxVersion:sources"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
project(":android") {
|
||||
apply plugin: "com.android.application"
|
||||
|
||||
configurations { natives }
|
||||
|
||||
dependencies {
|
||||
implementation project(":core")
|
||||
api "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
|
||||
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
|
||||
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
|
||||
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
|
||||
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
|
||||
api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
|
||||
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
|
||||
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-arm64-v8a"
|
||||
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
|
||||
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86_64"
|
||||
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 67 KiB |
@@ -0,0 +1,6 @@
|
||||
sourceCompatibility = 1.7
|
||||
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
||||
|
||||
sourceSets.main.java.srcDirs = ["src/"]
|
||||
|
||||
eclipse.project.name = appName + "-core"
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN"
|
||||
"http://www.gwtproject.org/doctype/2.8.0/gwt-module.dtd">
|
||||
<module>
|
||||
<source path="com/badlogic/drop"/>
|
||||
</module>
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.badlogic.drop;
|
||||
|
||||
import com.badlogic.gdx.ApplicationAdapter;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.Input.Keys;
|
||||
import com.badlogic.gdx.audio.Music;
|
||||
import com.badlogic.gdx.audio.Sound;
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||
import com.badlogic.gdx.math.MathUtils;
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import com.badlogic.gdx.math.Vector3;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import com.badlogic.gdx.utils.ScreenUtils;
|
||||
import com.badlogic.gdx.utils.TimeUtils;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class Drop extends ApplicationAdapter {
|
||||
private Texture dropImage;
|
||||
private Texture bucketImage;
|
||||
private Sound dropSound;
|
||||
private Music rainMusic;
|
||||
|
||||
private OrthographicCamera camera;
|
||||
private SpriteBatch batch;
|
||||
|
||||
private Rectangle bucket;
|
||||
|
||||
private Array<Rectangle> raindrops;
|
||||
|
||||
private long lastDropTime;
|
||||
|
||||
@Override
|
||||
public void create() {
|
||||
dropImage = new Texture(Gdx.files.internal("droplet.png"));
|
||||
bucketImage = new Texture(Gdx.files.internal("bucket.png"));
|
||||
|
||||
dropSound = Gdx.audio.newSound(Gdx.files.internal("drop.wav"));
|
||||
rainMusic = Gdx.audio.newMusic(Gdx.files.internal("rain.mp3"));
|
||||
|
||||
rainMusic.setLooping(true);
|
||||
rainMusic.play();
|
||||
|
||||
camera = new OrthographicCamera();
|
||||
camera.setToOrtho(false, 800, 480);
|
||||
|
||||
batch = new SpriteBatch();
|
||||
|
||||
bucket = new Rectangle();
|
||||
bucket.x = 800 / 2 - 64 / 2;
|
||||
bucket.y = 20;
|
||||
bucket.width = 64;
|
||||
bucket.height = 64;
|
||||
|
||||
raindrops = new Array<Rectangle>();
|
||||
spawnRainDrop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
ScreenUtils.clear(0, 0, 0.2f, 1);
|
||||
|
||||
camera.update();
|
||||
|
||||
batch.setProjectionMatrix(camera.combined);
|
||||
batch.begin();
|
||||
batch.draw(bucketImage, bucket.x, bucket.y);
|
||||
for (Rectangle raindrop:raindrops) {
|
||||
batch.draw(dropImage, raindrop.x, raindrop.y);
|
||||
}
|
||||
batch.end();
|
||||
|
||||
if (Gdx.input.isTouched()) {
|
||||
Vector3 touchPos = new Vector3();
|
||||
touchPos.set(Gdx.input.getX(), Gdx.input.getY(), 0);
|
||||
camera.unproject(touchPos);
|
||||
bucket.x = touchPos.x - 64 / 2;
|
||||
}
|
||||
|
||||
if (Gdx.input.isKeyPressed(Keys.LEFT)) bucket.x -= 200 * Gdx.graphics.getDeltaTime();
|
||||
if (Gdx.input.isKeyPressed(Keys.RIGHT)) bucket.x += 200 * Gdx.graphics.getDeltaTime();
|
||||
|
||||
if (bucket.x < 0) bucket.x = 0;
|
||||
if (bucket.x > 800 - 64) bucket.x = 800 - 64;
|
||||
|
||||
if (TimeUtils.nanoTime() - lastDropTime > 1000000000) spawnRainDrop();
|
||||
|
||||
for (Iterator<Rectangle> iter = raindrops.iterator(); iter.hasNext(); ) {
|
||||
Rectangle raindrop = iter.next();
|
||||
raindrop.y -= 200 * Gdx.graphics.getDeltaTime();
|
||||
if (raindrop.y + 64 < 0) iter.remove();
|
||||
if (raindrop.overlaps(bucket)) {
|
||||
dropSound.play();
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void spawnRainDrop() {
|
||||
Rectangle raindrop = new Rectangle();
|
||||
raindrop.x = MathUtils.random(0, 800 - 64);
|
||||
raindrop.y = 480;
|
||||
raindrop.width = 64;
|
||||
raindrop.height = 64;
|
||||
raindrops.add(raindrop);
|
||||
lastDropTime = TimeUtils.nanoTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
dropImage.dispose();
|
||||
bucketImage.dispose();
|
||||
dropSound.dispose();
|
||||
rainMusic.dispose();
|
||||
batch.dispose();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
sourceCompatibility = 1.7
|
||||
sourceSets.main.java.srcDirs = ["src/"]
|
||||
sourceSets.main.resources.srcDirs = ["../android/assets"]
|
||||
|
||||
project.ext.mainClassName = "com.badlogic.drop.desktop.DesktopLauncher"
|
||||
project.ext.assetsDir = new File("../android/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) {
|
||||
manifest {
|
||||
attributes 'Main-Class': project.mainClassName
|
||||
}
|
||||
dependsOn configurations.runtimeClasspath
|
||||
from {
|
||||
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
|
||||
}
|
||||
with jar
|
||||
}
|
||||
|
||||
|
||||
dist.dependsOn classes
|
||||
|
||||
eclipse.project.name = appName + "-desktop"
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.badlogic.drop.desktop;
|
||||
|
||||
import com.badlogic.drop.Drop;
|
||||
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
|
||||
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
|
||||
|
||||
public class DesktopLauncher {
|
||||
public static void main(String[] arg) {
|
||||
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
|
||||
config.title = "Drop";
|
||||
config.width = 800;
|
||||
config.height = 480;
|
||||
new LwjglApplication(new Drop(), config);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xms128m -Xmx1500m
|
||||
org.gradle.configureondemand=false
|
||||
@@ -0,0 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -0,0 +1,185 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or 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.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## 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='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# 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 or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; 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=`expr $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"
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
@@ -0,0 +1,89 @@
|
||||
@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
|
||||
|
||||
@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 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%" == "0" goto execute
|
||||
|
||||
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 execute
|
||||
|
||||
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
|
||||
|
||||
: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%"=="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
|
||||
@@ -0,0 +1,91 @@
|
||||
gwt {
|
||||
gwtVersion = '2.8.2' // 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 'com.badlogic.drop.GdxDefinition'
|
||||
devModules 'com.badlogic.drop.GdxDefinitionSuperdev'
|
||||
project.webAppDirName = 'webapp'
|
||||
|
||||
compiler {
|
||||
strict = true;
|
||||
disableCastChecking = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
import org.akhikhl.gretty.AppBeforeIntegrationTestTask
|
||||
import org.wisepersist.gradle.plugins.gwt.GwtSuperDev
|
||||
|
||||
gretty.httpPort = 8080
|
||||
gretty.resourceBase = project.buildDir.path + "/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) {
|
||||
dependsOn startHttpServer
|
||||
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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task addSource {
|
||||
doLast {
|
||||
sourceSets.main.compileClasspath += files(project(':core').sourceSets.main.allJava.srcDirs)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.compileGwt.dependsOn(addSource)
|
||||
tasks.draftCompileGwt.dependsOn(addSource)
|
||||
|
||||
sourceCompatibility = 1.7
|
||||
sourceSets.main.java.srcDirs = ["src/"]
|
||||
|
||||
eclipse.project.name = appName + "-html"
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN"
|
||||
"http://www.gwtproject.org/doctype/2.8.0/gwt-module.dtd">
|
||||
<module rename-to="html">
|
||||
<collapse-property name="user.agent" values="*"/>
|
||||
<entry-point class='com.badlogic.drop.client.HtmlLauncher'/>
|
||||
|
||||
<inherits name='Drop'/>
|
||||
<inherits name='com.badlogic.gdx.backends.gdx_backends_gwt'/>
|
||||
<inherits name='com.badlogic.gdx.physics.box2d.box2d-gwt'/>
|
||||
<set-configuration-property name="gdx.assetpath" value="../android/assets"/>
|
||||
<set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>
|
||||
<set-property name="user.agent" value="gecko1_8, safari"/>
|
||||
</module>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN"
|
||||
"http://www.gwtproject.org/doctype/2.8.0/gwt-module.dtd">
|
||||
<module rename-to="html">
|
||||
<add-linker name="xsiframe"/>
|
||||
<collapse-all-properties/>
|
||||
|
||||
<inherits name='com.badlogic.drop.GdxDefinition'/>
|
||||
|
||||
<inherits name='com.badlogic.gdx.backends.gdx_backends_gwt'/>
|
||||
|
||||
<inherits name='com.badlogic.gdx.physics.box2d.box2d-gwt'/>
|
||||
<set-configuration-property name="devModeRedirectEnabled" value="true"/>
|
||||
<set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>
|
||||
</module>
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.badlogic.drop.client;
|
||||
|
||||
import com.badlogic.drop.Drop;
|
||||
import com.badlogic.gdx.ApplicationListener;
|
||||
import com.badlogic.gdx.backends.gwt.GwtApplication;
|
||||
import com.badlogic.gdx.backends.gwt.GwtApplicationConfiguration;
|
||||
|
||||
public class HtmlLauncher extends GwtApplication {
|
||||
|
||||
@Override
|
||||
public GwtApplicationConfiguration getConfig() {
|
||||
// Resizable application, uses available space in browser
|
||||
// return new GwtApplicationConfiguration(true);
|
||||
// Fixed size application:
|
||||
return new GwtApplicationConfiguration(800, 480);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplicationListener createApplicationListener() {
|
||||
return new Drop();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" ?>
|
||||
<web-app>
|
||||
</web-app>
|
||||
@@ -0,0 +1,32 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>drop</title>
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<meta content="width=device-width initial-scale=1" id="gameViewport" name="viewport">
|
||||
<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">↻</a>
|
||||
<div align="center" id="embed-html"></div>
|
||||
<script src="html/html.nocache.js" type="text/javascript"></script>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
function handleMouseDown(evt) {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
window.focus();
|
||||
}
|
||||
|
||||
function handleMouseUp(evt) {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
}
|
||||
|
||||
document.getElementById('embed-html').addEventListener('mousedown', handleMouseDown, false);
|
||||
document.getElementById('embed-html').addEventListener('mouseup', handleMouseUp, false);
|
||||
</script>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
@@ -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);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
include 'desktop', 'core', 'html', 'android'
|
||||