Skip to content

Commit 43e0042

Browse files
committed
LibGDX project creation
0 parents  commit 43e0042

29 files changed

+858
-0
lines changed

.gitignore

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
## Java
2+
3+
*.class
4+
*.war
5+
*.ear
6+
hs_err_pid*
7+
8+
## Robovm
9+
/ios/robovm-build/
10+
11+
## GWT
12+
/html/war/
13+
/html/gwt-unitCache/
14+
.apt_generated/
15+
.gwt/
16+
gwt-unitCache/
17+
www-test/
18+
.gwt-tmp/
19+
20+
## Android Studio and Intellij and Android in general
21+
/android/libs/armeabi/
22+
/android/libs/armeabi-v7a/
23+
/android/libs/arm64-v8a/
24+
/android/libs/x86/
25+
/android/libs/x86_64/
26+
/android/gen/
27+
.idea/
28+
*.ipr
29+
*.iws
30+
*.iml
31+
/android/out/
32+
com_crashlytics_export_strings.xml
33+
34+
## Eclipse
35+
36+
.classpath
37+
.project
38+
.metadata/
39+
/android/bin/
40+
/core/bin/
41+
/desktop/bin/
42+
/html/bin/
43+
/ios/bin/
44+
/ios-moe/bin/
45+
*.tmp
46+
*.bak
47+
*.swp
48+
*~.nib
49+
.settings/
50+
.loadpath
51+
.externalToolBuilders/
52+
*.launch
53+
54+
## NetBeans
55+
56+
/nbproject/private/
57+
/android/nbproject/private/
58+
/core/nbproject/private/
59+
/desktop/nbproject/private/
60+
/html/nbproject/private/
61+
/ios/nbproject/private/
62+
/ios-moe/nbproject/private/
63+
64+
/build/
65+
/android/build/
66+
/core/build/
67+
/desktop/build/
68+
/html/build/
69+
/ios/build/
70+
/ios-moe/build/
71+
72+
/nbbuild/
73+
/android/nbbuild/
74+
/core/nbbuild/
75+
/desktop/nbbuild/
76+
/html/nbbuild/
77+
/ios/nbbuild/
78+
/ios-moe/nbbuild/
79+
80+
/dist/
81+
/android/dist/
82+
/core/dist/
83+
/desktop/dist/
84+
/html/dist/
85+
/ios/dist/
86+
/ios-moe/dist/
87+
88+
/nbdist/
89+
/android/nbdist/
90+
/core/nbdist/
91+
/desktop/nbdist/
92+
/html/nbdist/
93+
/ios/nbdist/
94+
/ios-moe/nbdist/
95+
96+
nbactions.xml
97+
nb-configuration.xml
98+
99+
## Gradle
100+
101+
/local.properties
102+
.gradle/
103+
gradle-app.setting
104+
/build/
105+
/android/build/
106+
/core/build/
107+
/desktop/build/
108+
/html/build/
109+
/ios/build/
110+
/ios-moe/build/
111+
112+
## OS Specific
113+
.DS_Store
114+
Thumbs.db
115+
116+
## iOS
117+
/ios/xcode/*.xcodeproj/*
118+
!/ios/xcode/*.xcodeproj/xcshareddata
119+
!/ios/xcode/*.xcodeproj/project.pbxproj
120+
/ios/xcode/native/
121+
/ios/IOSLauncher.app
122+
/ios/IOSLauncher.app.dSYM
123+
124+
/ios-moe/xcode/*.xcodeproj/*
125+
!/ios-moe/xcode/*.xcodeproj/xcshareddata
126+
!/ios-moe/xcode/*.xcodeproj/project.pbxproj
127+
/ios-moe/xcode/native/

android/AndroidManifest.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.mygdx.game" >
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@drawable/ic_launcher"
8+
android:isGame="true"
9+
android:appCategory="game"
10+
android:label="@string/app_name"
11+
android:theme="@style/GdxTheme" >
12+
<activity
13+
android:name="com.mygdx.game.AndroidLauncher"
14+
android:label="@string/app_name"
15+
android:screenOrientation="landscape"
16+
android:configChanges="keyboard|keyboardHidden|navigation|orientation|screenSize|screenLayout">
17+
<intent-filter>
18+
<action android:name="android.intent.action.MAIN" />
19+
<category android:name="android.intent.category.LAUNCHER" />
20+
</intent-filter>
21+
</activity>
22+
</application>
23+
24+
</manifest>

android/assets/badlogic.jpg

66.9 KB
Loading

android/build.gradle

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
android {
2+
buildToolsVersion "29.0.2"
3+
compileSdkVersion 29
4+
sourceSets {
5+
main {
6+
manifest.srcFile 'AndroidManifest.xml'
7+
java.srcDirs = ['src']
8+
aidl.srcDirs = ['src']
9+
renderscript.srcDirs = ['src']
10+
res.srcDirs = ['res']
11+
assets.srcDirs = ['assets']
12+
jniLibs.srcDirs = ['libs']
13+
}
14+
15+
}
16+
packagingOptions {
17+
exclude 'META-INF/robovm/ios/robovm.xml'
18+
}
19+
defaultConfig {
20+
applicationId "com.mygdx.game"
21+
minSdkVersion 14
22+
targetSdkVersion 29
23+
versionCode 1
24+
versionName "1.0"
25+
}
26+
buildTypes {
27+
release {
28+
minifyEnabled false
29+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
30+
}
31+
}
32+
}
33+
34+
35+
// called every time gradle gets executed, takes the native dependencies of
36+
// the natives configuration, and extracts them to the proper libs/ folders
37+
// so they get packed with the APK.
38+
task copyAndroidNatives {
39+
doFirst {
40+
file("libs/armeabi/").mkdirs()
41+
file("libs/armeabi-v7a/").mkdirs()
42+
file("libs/arm64-v8a/").mkdirs()
43+
file("libs/x86_64/").mkdirs()
44+
file("libs/x86/").mkdirs()
45+
46+
configurations.natives.files.each { jar ->
47+
def outputDir = null
48+
if (jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
49+
if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
50+
if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
51+
if(jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
52+
if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
53+
if(outputDir != null) {
54+
copy {
55+
from zipTree(jar)
56+
into outputDir
57+
include "*.so"
58+
}
59+
}
60+
}
61+
}
62+
}
63+
64+
tasks.whenTaskAdded { packageTask ->
65+
if (packageTask.name.contains("package")) {
66+
packageTask.dependsOn 'copyAndroidNatives'
67+
}
68+
}
69+
70+
task run(type: Exec) {
71+
def path
72+
def localProperties = project.file("../local.properties")
73+
if (localProperties.exists()) {
74+
Properties properties = new Properties()
75+
localProperties.withInputStream { instr ->
76+
properties.load(instr)
77+
}
78+
def sdkDir = properties.getProperty('sdk.dir')
79+
if (sdkDir) {
80+
path = sdkDir
81+
} else {
82+
path = "$System.env.ANDROID_HOME"
83+
}
84+
} else {
85+
path = "$System.env.ANDROID_HOME"
86+
}
87+
88+
def adb = path + "/platform-tools/adb"
89+
commandLine "$adb", 'shell', 'am', 'start', '-n', 'com.mygdx.game/com.mygdx.game.AndroidLauncher'
90+
}

android/ic_launcher-web.png

21.7 KB
Loading

android/proguard-rules.pro

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# To enable ProGuard in your project, edit project.properties
2+
# to define the proguard.config property as described in that file.
3+
#
4+
# Add project specific ProGuard rules here.
5+
# By default, the flags in this file are appended to flags specified
6+
# in ${sdk.dir}/tools/proguard/proguard-android.txt
7+
# You can edit the include path and order by changing the ProGuard
8+
# include property in project.properties.
9+
#
10+
# For more details, see
11+
# http://developer.android.com/guide/developing/tools/proguard.html
12+
13+
# Add any project specific keep options here:
14+
15+
# If your project uses WebView with JS, uncomment the following
16+
# and specify the fully qualified class name to the JavaScript interface
17+
# class:
18+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19+
# public *;
20+
#}
21+
22+
-verbose
23+
24+
-dontwarn android.support.**
25+
-dontwarn com.badlogic.gdx.backends.android.AndroidFragmentApplication
26+
-dontwarn com.badlogic.gdx.utils.GdxBuild
27+
-dontwarn com.badlogic.gdx.physics.box2d.utils.Box2DBuild
28+
-dontwarn com.badlogic.gdx.jnigen.BuildTarget*
29+
-dontwarn com.badlogic.gdx.graphics.g2d.freetype.FreetypeBuild
30+
31+
-keep class com.badlogic.gdx.controllers.android.AndroidControllers
32+
33+
-keepclassmembers class com.badlogic.gdx.backends.android.AndroidInput* {
34+
<init>(com.badlogic.gdx.Application, android.content.Context, java.lang.Object, com.badlogic.gdx.backends.android.AndroidApplicationConfiguration);
35+
}
36+
37+
-keepclassmembers class com.badlogic.gdx.physics.box2d.World {
38+
boolean contactFilter(long, long);
39+
void beginContact(long);
40+
void endContact(long);
41+
void preSolve(long, long);
42+
void postSolve(long, long);
43+
boolean reportFixture(long);
44+
float reportRayFixture(long, float, float, float, float, float);
45+
}

android/project.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This file is used by the Eclipse ADT plugin. It is unnecessary for IDEA and Android Studio projects, which
2+
# configure Proguard and the Android target via the build.gradle file.
3+
4+
# To enable ProGuard to work with Eclipse ADT, uncomment this (available properties: sdk.dir, user.home)
5+
# and ensure proguard.jar in the Android SDK is up to date (or alternately reduce the android target to 23 or lower):
6+
# proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-rules.pro
7+
8+
# Project target.
9+
target=android-19
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon
3+
xmlns:android="http://schemas.android.com/apk/res/android">
4+
<background android:drawable="@color/ic_background_color"/>
5+
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
6+
</adaptive-icon>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="108dp"
3+
android:height="108dp"
4+
android:viewportWidth="108"
5+
android:viewportHeight="108">
6+
<path
7+
android:pathData="M22,48.667l2.987,0l0,10.667l-2.987,0z"
8+
android:fillColor="#000000"
9+
android:strokeColor="#00000000"
10+
android:fillAlpha="1"/>
11+
<path
12+
android:pathData="M26.907,52.72l2.987,0l0,6.613l-2.987,0z"
13+
android:fillColor="#000000"
14+
android:strokeColor="#00000000"
15+
android:fillAlpha="1"/>
16+
<path
17+
android:pathData="M26.907,48.667l2.987,0l0,2.56l-2.987,0z"
18+
android:fillColor="#000000"
19+
android:strokeColor="#00000000"
20+
android:fillAlpha="1"/>
21+
<path
22+
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"
23+
android:fillColor="#000000"
24+
android:strokeColor="#00000000"
25+
android:fillAlpha="1"/>
26+
<path
27+
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"
28+
android:fillColor="#e74a45"
29+
android:strokeColor="#00000000"
30+
android:fillAlpha="1"/>
31+
<path
32+
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"
33+
android:fillColor="#e74a45"
34+
android:strokeColor="#00000000"
35+
android:fillAlpha="1"/>
36+
<path
37+
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"
38+
android:fillColor="#e74a45"
39+
android:strokeColor="#00000000"/>
40+
</vector>
16.4 KB
Loading
15.7 KB
Loading
17.5 KB
Loading
18.3 KB
Loading
19 KB
Loading

android/res/values/color.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="ic_background_color">#FFFFFFFF</color>
4+
</resources>

android/res/values/strings.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
4+
<string name="app_name">Programmers</string>
5+
6+
</resources>

android/res/values/styles.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<resources>
2+
3+
<style name="GdxTheme" parent="android:Theme">
4+
<item name="android:windowBackground">@android:color/transparent</item>
5+
<item name="android:colorBackgroundCacheHint">@null</item>
6+
<item name="android:windowAnimationStyle">@android:style/Animation</item>
7+
<item name="android:windowNoTitle">true</item>
8+
<item name="android:windowContentOverlay">@null</item>
9+
<item name="android:windowFullscreen">true</item>
10+
</style>
11+
12+
</resources>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.mygdx.game;
2+
3+
import android.os.Bundle;
4+
5+
import com.badlogic.gdx.backends.android.AndroidApplication;
6+
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
7+
import com.mygdx.game.ProgrammersGame;
8+
9+
public class AndroidLauncher extends AndroidApplication {
10+
@Override
11+
protected void onCreate (Bundle savedInstanceState) {
12+
super.onCreate(savedInstanceState);
13+
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
14+
initialize(new ProgrammersGame(), config);
15+
}
16+
}

0 commit comments

Comments
 (0)