├── .gitignore
├── README.md
├── android
├── AndroidManifest.xml
├── assets
│ └── data
│ │ ├── gamewae.png
│ │ ├── gatot.pack
│ │ ├── gatot.png
│ │ ├── gatot2.png
│ │ ├── gatot3.png
│ │ ├── gatot4.png
│ │ ├── gatot5.png
│ │ ├── logoyondev.png
│ │ ├── sound
│ │ ├── dead.mp3
│ │ ├── jump.mp3
│ │ ├── jump.wav
│ │ └── point.mp3
│ │ ├── vt232.fnt
│ │ ├── vt232_0.png
│ │ ├── vt232_1.png
│ │ ├── vt232_2.png
│ │ ├── vt232_3.png
│ │ ├── vt232_4.png
│ │ ├── vt232_5.png
│ │ └── vt232_6.png
├── build.gradle
├── ic_launcher-web.png
├── libs
│ ├── tween-engine-api-sources.jar
│ └── tween-engine-api.jar
├── lint.xml
├── proguard-project.txt
├── project.properties
├── res
│ ├── drawable-hdpi
│ │ └── ic_launcher.png
│ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ ├── drawable-xhdpi
│ │ └── ic_launcher.png
│ ├── drawable-xxhdpi
│ │ └── ic_launcher.png
│ └── values
│ │ ├── strings.xml
│ │ └── styles.xml
└── src
│ └── com
│ └── yondev
│ └── gatot
│ └── run
│ └── android
│ └── AndroidLauncher.java
├── build.gradle
├── core
├── build.gradle
├── libs
│ ├── tween-engine-api-sources.jar
│ └── tween-engine-api.jar
└── src
│ ├── GatotRun.gwt.xml
│ └── com
│ └── yondev
│ └── gatot
│ └── run
│ ├── AdsController.java
│ ├── GatotRun.java
│ ├── entity
│ ├── DynamicGameObject.java
│ ├── GameObject.java
│ ├── Obstacle.java
│ ├── Player.java
│ ├── Scrollable.java
│ └── scrollObject.java
│ ├── handler
│ ├── InputHandler.java
│ ├── MyGestureListener.java
│ └── ScrollHandler.java
│ ├── helper
│ ├── FontAccessor.java
│ ├── SpriteAccessor.java
│ ├── Value.java
│ └── ValueAccessor.java
│ ├── screen
│ ├── GameScreen.java
│ ├── GatotScreen.java
│ └── SplashScreen.java
│ └── world
│ ├── GameWorld.java
│ └── GameWorldRenderer.java
├── desktop
├── build.gradle
└── src
│ └── com
│ └── yondev
│ └── gatot
│ └── run
│ └── desktop
│ └── DesktopLauncher.java
├── featured.png
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── html
├── build.gradle
├── src
│ └── com
│ │ └── yondev
│ │ └── gatot
│ │ └── run
│ │ ├── GdxDefinition.gwt.xml
│ │ ├── GdxDefinitionSuperdev.gwt.xml
│ │ └── client
│ │ └── HtmlLauncher.java
└── webapp
│ ├── WEB-INF
│ └── web.xml
│ ├── index.html
│ ├── refresh.png
│ ├── soundmanager2-jsmin.js
│ ├── soundmanager2-setup.js
│ └── styles.css
├── ios
├── Info.plist.xml
├── build.gradle
├── data
│ ├── Default-375w-667h@2x.png
│ ├── Default-414w-736h@3x.png
│ ├── Default-568h@2x.png
│ ├── Default.png
│ ├── Default@2x.png
│ ├── Default@2x~ipad.png
│ ├── Default~ipad.png
│ ├── Icon-72.png
│ ├── Icon-72@2x.png
│ ├── Icon.png
│ └── Icon@2x.png
├── robovm.properties
├── robovm.xml
└── src
│ └── com
│ └── yondev
│ └── gatot
│ └── run
│ └── IOSLauncher.java
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Java
2 |
3 | *.class
4 | *.war
5 | *.ear
6 | hs_err_pid*
7 |
8 | ## GWT
9 | war/
10 | html/war/gwt_bree/
11 | html/gwt-unitCache/
12 | .apt_generated/
13 | html/war/WEB-INF/deploy/
14 | html/war/WEB-INF/classes/
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/x86/
24 | android/gen/
25 | .idea/
26 | *.ipr
27 | *.iws
28 | *.iml
29 | out/
30 | com_crashlytics_export_strings.xml
31 |
32 | ## Eclipse
33 | .classpath
34 | .project
35 | .metadata
36 | **/bin/
37 | tmp/
38 | *.tmp
39 | *.bak
40 | *.swp
41 | *~.nib
42 | local.properties
43 | .settings/
44 | .loadpath
45 | .externalToolBuilders/
46 | *.launch
47 |
48 | ## NetBeans
49 | **/nbproject/private/
50 | build/
51 | nbbuild/
52 | dist/
53 | nbdist/
54 | nbactions.xml
55 | nb-configuration.xml
56 |
57 | ## Gradle
58 |
59 | .gradle
60 | gradle-app.setting
61 | build/
62 |
63 | ## OS Specific
64 | .DS_Store
65 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # WayKu Run - Android Game
2 |
3 | WayKu Run aka Wayang Kulit Run is simple endless running game for android inspired by dino chrome develop with LibGDX Framework
4 | > Game wayang terinspirasi dari dino chrome dibuat menggunakan LibGDX Framework
5 |
6 |
7 |
8 | ### Framework & Lib
9 | - [LibGDX](https://libgdx.badlogicgames.com)
10 | - [Universal Tween Engine](https://github.com/libgdx/libgdx/wiki/Universal-Tween-Engine)
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
17 |
18 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/android/assets/data/gamewae.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/assets/data/gamewae.png
--------------------------------------------------------------------------------
/android/assets/data/gatot.pack:
--------------------------------------------------------------------------------
1 |
2 | gatot.png
3 | format: RGBA8888
4 | filter: Nearest,Nearest
5 | repeat: none
6 | tanah
7 | rotate: false
8 | xy: 1, 869
9 | size: 2399, 42
10 | orig: 2399, 42
11 | offset: 0, 0
12 | index: -1
13 | bg
14 | rotate: false
15 | xy: 1, 67
16 | size: 1280, 800
17 | orig: 1280, 800
18 | offset: 0, 0
19 | index: -1
20 | play
21 | rotate: false
22 | xy: 1, 1
23 | size: 72, 64
24 | orig: 72, 64
25 | offset: 0, 0
26 | index: -1
27 | awan
28 | rotate: false
29 | xy: 2402, 884
30 | size: 92, 27
31 | orig: 92, 27
32 | offset: 0, 0
33 | index: -1
34 |
35 | gatot2.png
36 | format: RGBA8888
37 | filter: Nearest,Nearest
38 | repeat: none
39 | bintang/1
40 | rotate: false
41 | xy: 1, 1
42 | size: 18, 18
43 | orig: 18, 18
44 | offset: 0, 0
45 | index: -1
46 | bintang/2
47 | rotate: false
48 | xy: 21, 1
49 | size: 18, 18
50 | orig: 18, 18
51 | offset: 0, 0
52 | index: -1
53 | bintang/3
54 | rotate: false
55 | xy: 41, 1
56 | size: 18, 18
57 | orig: 18, 18
58 | offset: 0, 0
59 | index: -1
60 |
61 | gatot3.png
62 | format: RGBA8888
63 | filter: Nearest,Nearest
64 | repeat: none
65 | burung/2
66 | rotate: false
67 | xy: 1, 1
68 | size: 86, 62
69 | orig: 86, 62
70 | offset: 0, 0
71 | index: -1
72 | burung/1
73 | rotate: false
74 | xy: 89, 9
75 | size: 86, 54
76 | orig: 86, 54
77 | offset: 0, 0
78 | index: -1
79 |
80 | gatot4.png
81 | format: RGBA8888
82 | filter: Nearest,Nearest
83 | repeat: none
84 | gunungan/4
85 | rotate: false
86 | xy: 1, 1
87 | size: 55, 50
88 | orig: 55, 50
89 | offset: 0, 0
90 | index: -1
91 | gunungan/3
92 | rotate: false
93 | xy: 58, 15
94 | size: 51, 36
95 | orig: 51, 36
96 | offset: 0, 0
97 | index: -1
98 | gunungan/2
99 | rotate: false
100 | xy: 111, 15
101 | size: 34, 36
102 | orig: 34, 36
103 | offset: 0, 0
104 | index: -1
105 | gunungan/5
106 | rotate: false
107 | xy: 147, 1
108 | size: 21, 50
109 | orig: 21, 50
110 | offset: 0, 0
111 | index: -1
112 | gunungan/1
113 | rotate: false
114 | xy: 170, 15
115 | size: 17, 36
116 | orig: 17, 36
117 | offset: 0, 0
118 | index: -1
119 |
120 | gatot5.png
121 | format: RGBA8888
122 | filter: Nearest,Nearest
123 | repeat: none
124 | player/1
125 | rotate: false
126 | xy: 1, 1
127 | size: 76, 86
128 | orig: 76, 86
129 | offset: 0, 0
130 | index: -1
131 | player/3
132 | rotate: false
133 | xy: 79, 1
134 | size: 76, 86
135 | orig: 76, 86
136 | offset: 0, 0
137 | index: -1
138 | player/4
139 | rotate: false
140 | xy: 157, 1
141 | size: 76, 86
142 | orig: 76, 86
143 | offset: 0, 0
144 | index: -1
145 | player/2
146 | rotate: false
147 | xy: 235, 1
148 | size: 74, 86
149 | orig: 74, 86
150 | offset: 0, 0
151 | index: -1
152 | player/5
153 | rotate: false
154 | xy: 311, 37
155 | size: 96, 50
156 | orig: 96, 50
157 | offset: 0, 0
158 | index: -1
159 | player/6
160 | rotate: false
161 | xy: 409, 37
162 | size: 96, 50
163 | orig: 96, 50
164 | offset: 0, 0
165 | index: -1
166 |
--------------------------------------------------------------------------------
/android/assets/data/gatot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/assets/data/gatot.png
--------------------------------------------------------------------------------
/android/assets/data/gatot2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/assets/data/gatot2.png
--------------------------------------------------------------------------------
/android/assets/data/gatot3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/assets/data/gatot3.png
--------------------------------------------------------------------------------
/android/assets/data/gatot4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/assets/data/gatot4.png
--------------------------------------------------------------------------------
/android/assets/data/gatot5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/assets/data/gatot5.png
--------------------------------------------------------------------------------
/android/assets/data/logoyondev.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/assets/data/logoyondev.png
--------------------------------------------------------------------------------
/android/assets/data/sound/dead.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/assets/data/sound/dead.mp3
--------------------------------------------------------------------------------
/android/assets/data/sound/jump.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/assets/data/sound/jump.mp3
--------------------------------------------------------------------------------
/android/assets/data/sound/jump.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/assets/data/sound/jump.wav
--------------------------------------------------------------------------------
/android/assets/data/sound/point.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/assets/data/sound/point.mp3
--------------------------------------------------------------------------------
/android/assets/data/vt232.fnt:
--------------------------------------------------------------------------------
1 | info face="VT323" size=200 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 outline=0
2 | common lineHeight=201 base=163 scaleW=256 scaleH=256 pages=7 packed=0 alphaChnl=1 redChnl=0 greenChnl=0 blueChnl=0
3 | page id=0 file="vt232_0.png"
4 | page id=1 file="vt232_1.png"
5 | page id=2 file="vt232_2.png"
6 | page id=3 file="vt232_3.png"
7 | page id=4 file="vt232_4.png"
8 | page id=5 file="vt232_5.png"
9 | page id=6 file="vt232_6.png"
10 | chars count=95
11 | char id=32 x=246 y=0 width=6 height=1 xoffset=-2 yoffset=200 xadvance=63 page=0 chnl=15
12 | char id=33 x=230 y=115 width=15 height=88 xoffset=24 yoffset=75 xadvance=63 page=0 chnl=15
13 | char id=34 x=0 y=230 width=40 height=25 xoffset=11 yoffset=62 xadvance=63 page=0 chnl=15
14 | char id=35 x=54 y=178 width=53 height=75 xoffset=5 yoffset=75 xadvance=63 page=1 chnl=15
15 | char id=36 x=68 y=115 width=53 height=113 xoffset=5 yoffset=62 xadvance=63 page=0 chnl=15
16 | char id=37 x=108 y=89 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=1 chnl=15
17 | char id=38 x=162 y=89 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=1 chnl=15
18 | char id=39 x=83 y=229 width=15 height=25 xoffset=24 yoffset=62 xadvance=63 page=0 chnl=15
19 | char id=40 x=218 y=0 width=27 height=114 xoffset=19 yoffset=62 xadvance=63 page=0 chnl=15
20 | char id=41 x=190 y=0 width=27 height=114 xoffset=17 yoffset=62 xadvance=63 page=0 chnl=15
21 | char id=42 x=0 y=178 width=46 height=63 xoffset=8 yoffset=88 xadvance=63 page=4 chnl=15
22 | char id=43 x=47 y=178 width=46 height=63 xoffset=8 yoffset=87 xadvance=63 page=4 chnl=15
23 | char id=44 x=230 y=204 width=18 height=50 xoffset=22 yoffset=138 xadvance=63 page=0 chnl=15
24 | char id=45 x=153 y=229 width=34 height=13 xoffset=14 yoffset=112 xadvance=63 page=0 chnl=15
25 | char id=46 x=64 y=230 width=18 height=25 xoffset=22 yoffset=138 xadvance=63 page=0 chnl=15
26 | char id=47 x=0 y=0 width=53 height=114 xoffset=5 yoffset=62 xadvance=63 page=0 chnl=15
27 | char id=48 x=0 y=0 width=43 height=88 xoffset=10 yoffset=75 xadvance=63 page=6 chnl=15
28 | char id=49 x=88 y=0 width=40 height=88 xoffset=11 yoffset=75 xadvance=63 page=6 chnl=15
29 | char id=50 x=188 y=89 width=46 height=88 xoffset=8 yoffset=75 xadvance=63 page=5 chnl=15
30 | char id=51 x=141 y=89 width=46 height=88 xoffset=8 yoffset=75 xadvance=63 page=5 chnl=15
31 | char id=52 x=162 y=0 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=3 chnl=15
32 | char id=53 x=162 y=89 width=50 height=88 xoffset=8 yoffset=75 xadvance=63 page=4 chnl=15
33 | char id=54 x=149 y=0 width=48 height=88 xoffset=7 yoffset=75 xadvance=63 page=5 chnl=15
34 | char id=55 x=47 y=89 width=46 height=88 xoffset=8 yoffset=75 xadvance=63 page=5 chnl=15
35 | char id=56 x=44 y=0 width=43 height=88 xoffset=10 yoffset=75 xadvance=63 page=6 chnl=15
36 | char id=57 x=100 y=0 width=48 height=88 xoffset=7 yoffset=75 xadvance=63 page=5 chnl=15
37 | char id=58 x=108 y=178 width=18 height=75 xoffset=22 yoffset=88 xadvance=63 page=1 chnl=15
38 | char id=59 x=211 y=115 width=18 height=101 xoffset=22 yoffset=87 xadvance=63 page=0 chnl=15
39 | char id=60 x=216 y=89 width=39 height=88 xoffset=12 yoffset=75 xadvance=63 page=1 chnl=15
40 | char id=61 x=0 y=178 width=40 height=38 xoffset=11 yoffset=100 xadvance=63 page=5 chnl=15
41 | char id=62 x=216 y=0 width=39 height=88 xoffset=12 yoffset=75 xadvance=63 page=2 chnl=15
42 | char id=63 x=0 y=0 width=49 height=88 xoffset=5 yoffset=75 xadvance=63 page=5 chnl=15
43 | char id=64 x=0 y=0 width=53 height=101 xoffset=5 yoffset=62 xadvance=63 page=1 chnl=15
44 | char id=65 x=0 y=102 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=1 chnl=15
45 | char id=66 x=54 y=89 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=1 chnl=15
46 | char id=67 x=108 y=0 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=4 chnl=15
47 | char id=68 x=54 y=0 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=4 chnl=15
48 | char id=69 x=211 y=0 width=40 height=88 xoffset=11 yoffset=75 xadvance=63 page=6 chnl=15
49 | char id=70 x=0 y=89 width=40 height=88 xoffset=11 yoffset=75 xadvance=63 page=6 chnl=15
50 | char id=71 x=0 y=89 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=3 chnl=15
51 | char id=72 x=0 y=0 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=4 chnl=15
52 | char id=73 x=218 y=0 width=34 height=88 xoffset=14 yoffset=75 xadvance=63 page=1 chnl=15
53 | char id=74 x=50 y=0 width=49 height=88 xoffset=5 yoffset=75 xadvance=63 page=5 chnl=15
54 | char id=75 x=162 y=89 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=3 chnl=15
55 | char id=76 x=198 y=0 width=47 height=88 xoffset=11 yoffset=75 xadvance=63 page=5 chnl=15
56 | char id=77 x=0 y=89 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=4 chnl=15
57 | char id=78 x=54 y=89 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=4 chnl=15
58 | char id=79 x=54 y=0 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=3 chnl=15
59 | char id=80 x=108 y=89 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=4 chnl=15
60 | char id=81 x=122 y=115 width=53 height=113 xoffset=5 yoffset=75 xadvance=63 page=0 chnl=15
61 | char id=82 x=162 y=89 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=2 chnl=15
62 | char id=83 x=108 y=0 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=3 chnl=15
63 | char id=84 x=108 y=89 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=3 chnl=15
64 | char id=85 x=54 y=89 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=3 chnl=15
65 | char id=86 x=0 y=0 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=3 chnl=15
66 | char id=87 x=0 y=89 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=2 chnl=15
67 | char id=88 x=162 y=0 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=2 chnl=15
68 | char id=89 x=108 y=0 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=2 chnl=15
69 | char id=90 x=0 y=89 width=46 height=88 xoffset=8 yoffset=75 xadvance=63 page=5 chnl=15
70 | char id=91 x=0 y=115 width=25 height=114 xoffset=20 yoffset=62 xadvance=63 page=0 chnl=15
71 | char id=92 x=54 y=0 width=53 height=114 xoffset=5 yoffset=62 xadvance=63 page=0 chnl=15
72 | char id=93 x=26 y=115 width=25 height=114 xoffset=17 yoffset=62 xadvance=63 page=0 chnl=15
73 | char id=94 x=195 y=178 width=53 height=50 xoffset=5 yoffset=75 xadvance=63 page=4 chnl=15
74 | char id=95 x=99 y=229 width=53 height=13 xoffset=5 yoffset=150 xadvance=63 page=0 chnl=15
75 | char id=96 x=41 y=230 width=22 height=25 xoffset=17 yoffset=62 xadvance=63 page=0 chnl=15
76 | char id=97 x=0 y=178 width=53 height=63 xoffset=5 yoffset=100 xadvance=63 page=2 chnl=15
77 | char id=98 x=108 y=89 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=2 chnl=15
78 | char id=99 x=127 y=178 width=53 height=63 xoffset=5 yoffset=100 xadvance=63 page=1 chnl=15
79 | char id=100 x=54 y=89 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=2 chnl=15
80 | char id=101 x=0 y=178 width=53 height=63 xoffset=5 yoffset=100 xadvance=63 page=3 chnl=15
81 | char id=102 x=213 y=89 width=40 height=88 xoffset=11 yoffset=75 xadvance=63 page=4 chnl=15
82 | char id=103 x=110 y=0 width=53 height=88 xoffset=5 yoffset=100 xadvance=63 page=1 chnl=15
83 | char id=104 x=164 y=0 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=1 chnl=15
84 | char id=105 x=170 y=0 width=40 height=88 xoffset=11 yoffset=75 xadvance=63 page=6 chnl=15
85 | char id=106 x=176 y=115 width=34 height=113 xoffset=11 yoffset=75 xadvance=63 page=0 chnl=15
86 | char id=107 x=0 y=0 width=53 height=88 xoffset=5 yoffset=75 xadvance=63 page=2 chnl=15
87 | char id=108 x=129 y=0 width=40 height=88 xoffset=11 yoffset=75 xadvance=63 page=6 chnl=15
88 | char id=109 x=54 y=178 width=53 height=63 xoffset=5 yoffset=100 xadvance=63 page=2 chnl=15
89 | char id=110 x=108 y=178 width=53 height=63 xoffset=5 yoffset=100 xadvance=63 page=2 chnl=15
90 | char id=111 x=162 y=178 width=53 height=63 xoffset=5 yoffset=100 xadvance=63 page=2 chnl=15
91 | char id=112 x=54 y=0 width=53 height=88 xoffset=5 yoffset=100 xadvance=63 page=2 chnl=15
92 | char id=113 x=162 y=0 width=53 height=88 xoffset=5 yoffset=100 xadvance=63 page=4 chnl=15
93 | char id=114 x=54 y=178 width=53 height=63 xoffset=5 yoffset=100 xadvance=63 page=3 chnl=15
94 | char id=115 x=94 y=178 width=46 height=63 xoffset=8 yoffset=100 xadvance=63 page=4 chnl=15
95 | char id=116 x=94 y=89 width=46 height=88 xoffset=5 yoffset=75 xadvance=63 page=5 chnl=15
96 | char id=117 x=181 y=178 width=53 height=63 xoffset=5 yoffset=100 xadvance=63 page=1 chnl=15
97 | char id=118 x=108 y=178 width=53 height=63 xoffset=5 yoffset=100 xadvance=63 page=3 chnl=15
98 | char id=119 x=0 y=191 width=53 height=63 xoffset=5 yoffset=100 xadvance=63 page=1 chnl=15
99 | char id=120 x=209 y=178 width=46 height=63 xoffset=8 yoffset=100 xadvance=63 page=3 chnl=15
100 | char id=121 x=54 y=0 width=55 height=88 xoffset=3 yoffset=100 xadvance=63 page=1 chnl=15
101 | char id=122 x=162 y=178 width=46 height=63 xoffset=8 yoffset=100 xadvance=63 page=3 chnl=15
102 | char id=123 x=149 y=0 width=40 height=114 xoffset=11 yoffset=62 xadvance=63 page=0 chnl=15
103 | char id=124 x=52 y=115 width=15 height=114 xoffset=24 yoffset=62 xadvance=63 page=0 chnl=15
104 | char id=125 x=108 y=0 width=40 height=114 xoffset=11 yoffset=62 xadvance=63 page=0 chnl=15
105 | char id=126 x=141 y=178 width=53 height=50 xoffset=5 yoffset=88 xadvance=63 page=4 chnl=15
106 |
--------------------------------------------------------------------------------
/android/assets/data/vt232_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/assets/data/vt232_0.png
--------------------------------------------------------------------------------
/android/assets/data/vt232_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/assets/data/vt232_1.png
--------------------------------------------------------------------------------
/android/assets/data/vt232_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/assets/data/vt232_2.png
--------------------------------------------------------------------------------
/android/assets/data/vt232_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/assets/data/vt232_3.png
--------------------------------------------------------------------------------
/android/assets/data/vt232_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/assets/data/vt232_4.png
--------------------------------------------------------------------------------
/android/assets/data/vt232_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/assets/data/vt232_5.png
--------------------------------------------------------------------------------
/android/assets/data/vt232_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/assets/data/vt232_6.png
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | android {
2 | buildToolsVersion "23.0.1"
3 | compileSdkVersion 20
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 | instrumentTest.setRoot('tests')
16 | }
17 | }
18 |
19 |
20 | // called every time gradle gets executed, takes the native dependencies of
21 | // the natives configuration, and extracts them to the proper libs/ folders
22 | // so they get packed with the APK.
23 | task copyAndroidNatives() {
24 | file("libs/armeabi/").mkdirs();
25 | file("libs/armeabi-v7a/").mkdirs();
26 | file("libs/x86/").mkdirs();
27 |
28 | configurations.natives.files.each { jar ->
29 | def outputDir = null
30 | if(jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
31 | if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
32 | if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
33 | if(outputDir != null) {
34 | copy {
35 | from zipTree(jar)
36 | into outputDir
37 | include "*.so"
38 | }
39 | }
40 | }
41 | }
42 |
43 | task run(type: Exec) {
44 | def path
45 | def localProperties = project.file("../local.properties")
46 | if (localProperties.exists()) {
47 | Properties properties = new Properties()
48 | localProperties.withInputStream { instr ->
49 | properties.load(instr)
50 | }
51 | def sdkDir = properties.getProperty('sdk.dir')
52 | if (sdkDir) {
53 | path = sdkDir
54 | } else {
55 | path = "$System.env.ANDROID_HOME"
56 | }
57 | } else {
58 | path = "$System.env.ANDROID_HOME"
59 | }
60 |
61 | def adb = path + "/platform-tools/adb"
62 | commandLine "$adb", 'shell', 'am', 'start', '-n', 'com.yondev.gatot.run.android/com.yondev.gatot.run.android.AndroidLauncher'
63 | }
64 |
65 | // sets up the Android Eclipse project, using the old Ant based build.
66 | eclipse {
67 | // need to specify Java source sets explicitely, SpringSource Gradle Eclipse plugin
68 | // ignores any nodes added in classpath.file.withXml
69 | sourceSets {
70 | main {
71 | java.srcDirs "src", 'gen'
72 | }
73 | }
74 |
75 | jdt {
76 | sourceCompatibility = 1.6
77 | targetCompatibility = 1.6
78 | }
79 |
80 | classpath {
81 | plusConfigurations += [ project.configurations.compile ]
82 | containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES'
83 | }
84 |
85 | project {
86 | name = appName + "-android"
87 | natures 'com.android.ide.eclipse.adt.AndroidNature'
88 | buildCommands.clear();
89 | buildCommand "com.android.ide.eclipse.adt.ResourceManagerBuilder"
90 | buildCommand "com.android.ide.eclipse.adt.PreCompilerBuilder"
91 | buildCommand "org.eclipse.jdt.core.javabuilder"
92 | buildCommand "com.android.ide.eclipse.adt.ApkBuilder"
93 | }
94 | }
95 |
96 | // sets up the Android Idea project, using the old Ant based build.
97 | idea {
98 | module {
99 | sourceDirs += file("src");
100 | scopes = [ COMPILE: [plus:[project.configurations.compile]]]
101 |
102 | iml {
103 | withXml {
104 | def node = it.asNode()
105 | def builder = NodeBuilder.newInstance();
106 | builder.current = node;
107 | builder.component(name: "FacetManager") {
108 | facet(type: "android", name: "Android") {
109 | configuration {
110 | option(name: "UPDATE_PROPERTY_FILES", value:"true")
111 | }
112 | }
113 | }
114 | }
115 | }
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/android/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/ic_launcher-web.png
--------------------------------------------------------------------------------
/android/libs/tween-engine-api-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/libs/tween-engine-api-sources.jar
--------------------------------------------------------------------------------
/android/libs/tween-engine-api.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/libs/tween-engine-api.jar
--------------------------------------------------------------------------------
/android/lint.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/android/proguard-project.txt:
--------------------------------------------------------------------------------
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 |
30 | -keepclassmembers class com.badlogic.gdx.backends.android.AndroidInput* {
31 | (com.badlogic.gdx.Application, android.content.Context, java.lang.Object, com.badlogic.gdx.backends.android.AndroidApplicationConfiguration);
32 | }
33 |
34 | -keepclassmembers class com.badlogic.gdx.physics.box2d.World {
35 | boolean contactFilter(long, long);
36 | void beginContact(long);
37 | void endContact(long);
38 | void preSolve(long, long);
39 | void postSolve(long, long);
40 | boolean reportFixture(long);
41 | float reportRayFixture(long, float, float, float, float, float);
42 | }
43 |
--------------------------------------------------------------------------------
/android/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-19
15 | android.library.reference.1=../../google-play-services_lib
16 |
--------------------------------------------------------------------------------
/android/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WayKu Run
5 |
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/src/com/yondev/gatot/run/android/AndroidLauncher.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/android/src/com/yondev/gatot/run/android/AndroidLauncher.java
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
9 | classpath 'com.android.tools.build:gradle:1.2.3'
10 | classpath 'org.robovm:robovm-gradle-plugin:1.2.0'
11 | }
12 | }
13 |
14 | allprojects {
15 | apply plugin: "eclipse"
16 | apply plugin: "idea"
17 |
18 | version = '1.0'
19 | ext {
20 | appName = 'GatotRun'
21 | gdxVersion = '1.6.1'
22 | roboVMVersion = '1.2.0'
23 | box2DLightsVersion = '1.3'
24 | ashleyVersion = '1.4.0'
25 | aiVersion = '1.5.0'
26 | }
27 |
28 | repositories {
29 | mavenCentral()
30 | maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
31 | maven { url "https://oss.sonatype.org/content/repositories/releases/" }
32 | }
33 | }
34 |
35 | project(":desktop") {
36 | apply plugin: "java"
37 |
38 |
39 | dependencies {
40 | compile project(":core")
41 | compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
42 | compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
43 | }
44 | }
45 |
46 | project(":android") {
47 | apply plugin: "android"
48 |
49 | configurations { natives }
50 |
51 | dependencies {
52 | compile project(":core")
53 | compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
54 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
55 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
56 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
57 | }
58 | }
59 |
60 | project(":ios") {
61 | apply plugin: "java"
62 | apply plugin: "robovm"
63 |
64 |
65 | dependencies {
66 | compile project(":core")
67 | compile "org.robovm:robovm-rt:$roboVMVersion"
68 | compile "org.robovm:robovm-cocoatouch:$roboVMVersion"
69 | compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
70 | compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
71 | }
72 | }
73 |
74 | project(":html") {
75 | apply plugin: "gwt"
76 | apply plugin: "war"
77 |
78 |
79 | dependencies {
80 | compile project(":core")
81 | compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
82 | compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
83 | compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
84 | }
85 | }
86 |
87 | project(":core") {
88 | apply plugin: "java"
89 |
90 |
91 | dependencies {
92 | compile "com.badlogicgames.gdx:gdx:$gdxVersion"
93 | }
94 | }
95 |
96 | tasks.eclipse.doLast {
97 | delete ".project"
98 | }
--------------------------------------------------------------------------------
/core/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "java"
2 |
3 | sourceCompatibility = 1.6
4 | [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
5 |
6 | sourceSets.main.java.srcDirs = [ "src/" ]
7 |
8 |
9 | eclipse.project {
10 | name = appName + "-core"
11 | }
12 |
--------------------------------------------------------------------------------
/core/libs/tween-engine-api-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/core/libs/tween-engine-api-sources.jar
--------------------------------------------------------------------------------
/core/libs/tween-engine-api.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/core/libs/tween-engine-api.jar
--------------------------------------------------------------------------------
/core/src/GatotRun.gwt.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/AdsController.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run;
2 |
3 |
4 | public interface AdsController {
5 |
6 | public void showBannerAd();
7 | public void hideBannerAd();
8 | public void showInterstitialAd ();
9 |
10 |
11 | }
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/GatotRun.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run;
2 |
3 | import com.badlogic.gdx.Game;
4 | import com.badlogic.gdx.Gdx;
5 | import com.badlogic.gdx.assets.AssetManager;
6 | import com.badlogic.gdx.graphics.FPSLogger;
7 | import com.yondev.gatot.run.screen.SplashScreen;
8 |
9 | public class GatotRun extends Game {
10 | boolean firstTimeCreate = true;
11 | FPSLogger fps;
12 | public AssetManager assets;
13 |
14 | private AdsController adsController;
15 | public GatotRun(AdsController adsController){
16 | this.adsController = adsController;
17 | }
18 |
19 | @Override
20 | public void create() {
21 | // TODO Auto-generated method stub
22 | setScreen(new SplashScreen(this));
23 | fps = new FPSLogger();
24 | }
25 |
26 | @Override
27 | public void render() {
28 | super.render();
29 | fps.log();
30 |
31 | }
32 |
33 | @Override
34 | public void dispose () {
35 | super.dispose();
36 | }
37 |
38 | public AdsController getAdsController() {
39 | return adsController;
40 | }
41 |
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/entity/DynamicGameObject.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.entity;
2 |
3 | import com.badlogic.gdx.math.Vector2;
4 | import com.yondev.gatot.run.world.GameWorld;
5 |
6 | public class DynamicGameObject extends GameObject {
7 | public final Vector2 velocity;
8 | public final Vector2 acceleration;
9 | public DynamicGameObject (GameWorld world,float x, float y, float width, float height) {
10 | super(x, y, width, height);
11 | velocity = new Vector2();
12 | acceleration = new Vector2();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/entity/GameObject.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.entity;
2 |
3 | import com.badlogic.gdx.math.Rectangle;
4 | import com.badlogic.gdx.math.Vector2;
5 |
6 | public class GameObject {
7 | public final Vector2 position;
8 | public final Rectangle bounds;
9 | public float width;
10 | public float height;
11 |
12 | public GameObject (float x, float y, float width, float height) {
13 | this.position = new Vector2(x, y);
14 | this.bounds = new Rectangle(x,y, width, height);
15 | this.width = width;
16 | this.height = height;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/entity/Obstacle.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.entity;
2 |
3 | import com.badlogic.gdx.math.Rectangle;
4 |
5 | public class Obstacle extends scrollObject{
6 | public float animTime = 0;
7 | public float runTime = 0;
8 | public boolean isCollition = false;
9 | public boolean hasGone = false;
10 | private Rectangle bounds;
11 | private int type = 1;
12 | private int postype = 1;
13 | public Obstacle(float x, float y, int width, int height, float scrollSpeed) {
14 | super(x, y, width, height, scrollSpeed);
15 | // TODO Auto-generated constructor stub
16 | bounds = new Rectangle(x, y, width, height);
17 | }
18 |
19 | @Override
20 | public void update(float delta) {
21 | // TODO Auto-generated method stub
22 | super.update(delta);
23 | bounds.x = position.x;
24 | bounds.y = position.y;
25 | runTime += delta;
26 | }
27 |
28 | public Rectangle getBounds()
29 | {
30 | return bounds;
31 | }
32 |
33 |
34 | public void setBoundY(float y) {
35 | bounds.y = y;
36 | }
37 |
38 | public void setBoundX(float x) {
39 | bounds.x = x;
40 | }
41 |
42 | public void setWidth(float w) {
43 | this.width = w;
44 | bounds.width = w;
45 | }
46 |
47 | public void setHeight(float h) {
48 | this.height = h;
49 | bounds.height = h;
50 | bounds.y = this.getY();
51 | }
52 |
53 | public int getType() {
54 | return type;
55 | }
56 |
57 | public void setType(int type) {
58 | this.type = type;
59 | }
60 |
61 | public int getPostype() {
62 | return postype;
63 | }
64 |
65 | public void setPostype(int postype) {
66 | this.postype = postype;
67 | }
68 |
69 |
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/entity/Player.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.entity;
2 |
3 | import com.badlogic.gdx.Gdx;
4 | import com.badlogic.gdx.audio.Sound;
5 | import com.badlogic.gdx.math.Rectangle;
6 | import com.yondev.gatot.run.world.GameWorld;
7 |
8 | public class Player extends DynamicGameObject{
9 |
10 | public static final int IDLE = 0;
11 | public static final int RUN = 1;
12 | public static final int JUMP = 2;
13 | public static final int DEAD = 3;
14 | public static final int SPRINT = 4;
15 |
16 | static float JUMP_VELOCITY_INIT = 1200;
17 | static float GRAVITY_INIT = 4200.0f;
18 |
19 | static float JUMP_VELOCITY = 1200;
20 | static float GRAVITY = 4200.0f;
21 |
22 | static float JUMP_VELOCITY_MAX = 1400;
23 | static float GRAVITY_MAX = 5500.0f;
24 |
25 | public float stateTime = 0;
26 | public int state = IDLE;
27 |
28 | private int rotation = 0;
29 | private GameWorld world;
30 |
31 | private boolean isSlideDown = false;
32 |
33 | private Sound jump;
34 | public Player(GameWorld world, float x, float y, float width, float height) {
35 | super(world, x, y, width, height);
36 | this.world = world;
37 |
38 | bounds.width = width/3;
39 | bounds.x = x + bounds.width/2 + 10;
40 |
41 |
42 | JUMP_VELOCITY_INIT = 800*this.world.getScaleFactor();
43 | JUMP_VELOCITY = JUMP_VELOCITY_INIT;
44 |
45 | GRAVITY_INIT = 2800*this.world.getScaleFactor();
46 | GRAVITY = GRAVITY_INIT;
47 |
48 | JUMP_VELOCITY_MAX = 933.3f*this.world.getScaleFactor();
49 | GRAVITY_MAX = 3666.6f*this.world.getScaleFactor();
50 |
51 | setMaxJump();
52 |
53 | jump = Gdx.audio.newSound(Gdx.files.internal("data/sound/jump.mp3"));
54 | }
55 |
56 | public void update(float delta) {
57 |
58 | acceleration.y = GRAVITY;
59 | acceleration.scl(delta);
60 |
61 | velocity.add(acceleration.x, acceleration.y);
62 | velocity.scl(delta);
63 |
64 | if (bounds.overlaps(this.world.getGround()))
65 | {
66 | if ((bounds.y + height) - this.world.getGround().y >= 15f * world.getScaleFactor())
67 | {
68 | bounds.y = this.world.getGround().y - (height + 0.1f) + (15 * world.getScaleFactor() );
69 | position.y = bounds.y;
70 | if(state == JUMP)
71 | {
72 | state = RUN;
73 | stateTime = 0;
74 | }
75 | }
76 | }
77 |
78 | if (state == JUMP)
79 | {
80 | bounds.y += velocity.y;
81 | position.y = bounds.y;
82 | }
83 |
84 | velocity.scl(1.0f / delta);
85 | stateTime += delta;
86 | }
87 |
88 | public float getX() {
89 | return position.x;
90 | }
91 |
92 | public float getY() {
93 | return position.y;
94 | }
95 |
96 | public float getWidth() {
97 | return width;
98 | }
99 |
100 | public void setWidth(float w) {
101 | this.width = w;
102 | }
103 |
104 | public void setHeight(float h) {
105 | this.height = h;
106 | bounds.height = h;
107 | bounds.y = this.getY();
108 | }
109 |
110 | public void setBoundY(float y) {
111 | bounds.y = y;
112 | }
113 |
114 | public void setBoundX(float x) {
115 | bounds.x = x;
116 | }
117 |
118 | public float getHeight() {
119 | return height;
120 | }
121 |
122 | public Rectangle getBounds() {
123 | return bounds;
124 | }
125 |
126 | public void jump()
127 | {
128 | if (state != JUMP)
129 | {
130 | jump.play();
131 | velocity.y = -JUMP_VELOCITY;
132 | state = JUMP;
133 | stateTime = 0;
134 | }
135 | }
136 |
137 | public void setRotation(int rotate)
138 | {
139 | this.rotation = rotate;
140 | }
141 |
142 | public void setMaxJump()
143 | {
144 | JUMP_VELOCITY = JUMP_VELOCITY_MAX;
145 | GRAVITY = GRAVITY_MAX;
146 | }
147 |
148 | public void setResetJump()
149 | {
150 | JUMP_VELOCITY = JUMP_VELOCITY_INIT;
151 | GRAVITY = GRAVITY_INIT;
152 | }
153 |
154 | public int getRotation()
155 | {
156 | return this.rotation;
157 | }
158 |
159 | public boolean isSlideDown() {
160 | return isSlideDown;
161 | }
162 |
163 | public void setSlideDown(boolean isSlideDown) {
164 | this.isSlideDown = isSlideDown;
165 | }
166 |
167 |
168 | }
169 |
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/entity/Scrollable.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.entity;
2 |
3 | import com.badlogic.gdx.math.Vector2;
4 |
5 | public class Scrollable {
6 |
7 | protected Vector2 position;
8 | protected Vector2 velocity;
9 | protected Vector2 acceleration;
10 | protected float width;
11 | protected float height;
12 | protected boolean isScrolledLeft;
13 | protected float speed;
14 | protected boolean isStop;
15 | public float incrementSpeed;
16 | protected float timerSpeed;
17 | public float currentSpeed;
18 |
19 |
20 | public Scrollable(float x, float y, float width, float height, float scrollSpeed) {
21 | this.speed = scrollSpeed;
22 | position = new Vector2(x, y);
23 | velocity = new Vector2();
24 | acceleration = new Vector2();
25 | this.width = width;
26 | this.height = height;
27 | isScrolledLeft = false;
28 | isStop = true;
29 | incrementSpeed = 0;
30 | currentSpeed = Math.abs(scrollSpeed);
31 | }
32 |
33 | public void update(float delta) {
34 | if (isStop)
35 | return;
36 |
37 | if (position.x + width < 0) {
38 | isScrolledLeft = true;
39 | }
40 |
41 | timerSpeed += delta;
42 | if (incrementSpeed >= 0)
43 | {
44 | incrementSpeed = 0;
45 | timerSpeed = 0;
46 | }
47 |
48 | if (incrementSpeed <= -40 )
49 | incrementSpeed = -40;
50 |
51 | currentSpeed = Math.abs(speed + incrementSpeed);
52 | velocity.x = -currentSpeed;
53 | position.x += velocity.x;
54 | incrementSpeed += 1;
55 |
56 | }
57 | public void reset(float newX) {
58 | position.x = newX;
59 | isScrolledLeft = false;
60 | }
61 |
62 | public void stop() {
63 | isStop = true;
64 | }
65 |
66 | public void start() {
67 | isStop = false;
68 | }
69 |
70 |
71 | public void setSpeed(float s) {
72 | this.setSpeed(s,false);
73 | }
74 |
75 | public void setSpeed(float s,boolean reset) {
76 | if(!reset)
77 | incrementSpeed += s;
78 | else
79 | {
80 | incrementSpeed = 0;
81 | speed = s;
82 | }
83 | }
84 |
85 | public boolean isScrolledLeft() {
86 | return isScrolledLeft;
87 | }
88 |
89 | public float getTailX() {
90 | return position.x + width;
91 | }
92 |
93 | public float getX() {
94 | return position.x;
95 | }
96 |
97 | public void setX(float x) {
98 | this.position.x = x;
99 | }
100 |
101 | public void setY(float y) {
102 | this.position.y = y;
103 | }
104 |
105 | public float getY() {
106 | return position.y;
107 | }
108 |
109 | public float getWidth() {
110 | return width;
111 | }
112 |
113 | public float getHeight() {
114 | return height;
115 | }
116 |
117 |
118 | }
119 |
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/entity/scrollObject.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.entity;
2 |
3 |
4 | public class scrollObject extends Scrollable {
5 |
6 |
7 | public scrollObject(float x, float y, float width, float height,float scrollSpeed) {
8 | super(x, y, width, height, scrollSpeed);
9 | // TODO Auto-generated constructor stub
10 | }
11 |
12 | public void onRestart(float x, float scrollSpeed) {
13 | position.x = x;
14 | velocity.x = scrollSpeed;
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/handler/InputHandler.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.handler;
2 |
3 | import com.badlogic.gdx.InputProcessor;
4 | import com.yondev.gatot.run.entity.Player;
5 | import com.yondev.gatot.run.world.GameWorld;
6 |
7 | public class InputHandler implements InputProcessor{
8 |
9 | private GameWorld world;
10 | private Player player;
11 | private ScrollHandler scroll;
12 | private boolean firstTouch = false;
13 |
14 | public InputHandler(GameWorld world)
15 | {
16 | this.world = world;
17 | this.player = this.world.getPlayer();
18 | this.scroll = this.world.getScroller();
19 |
20 | }
21 |
22 | @Override
23 | public boolean keyDown(int keycode) {
24 | // TODO Auto-generated method stub
25 | return false;
26 | }
27 |
28 | @Override
29 | public boolean keyUp(int keycode) {
30 | // TODO Auto-generated method stub
31 | return false;
32 | }
33 |
34 | @Override
35 | public boolean keyTyped(char character) {
36 | // TODO Auto-generated method stub
37 | return false;
38 | }
39 |
40 | @Override
41 | public boolean touchDown(int screenX, int screenY, int pointer, int button) {
42 | // TODO Auto-generated method stub
43 | if (!firstTouch)
44 | {
45 |
46 | firstTouch = true;
47 | world.start();
48 | this.scroll.start();
49 |
50 | player.jump();
51 | }
52 | else
53 | {
54 | if(player.state == Player.DEAD)
55 | {
56 | if (world.getRenderer().freezTime >= 1)
57 | {
58 | scroll.initObstables();
59 | world.getRenderer().initObstacle();
60 | world.start(true);
61 | scroll.start();
62 | player.jump();
63 | world.getRenderer().resetScore();
64 |
65 | }
66 | }
67 | else
68 | {
69 | if ((world.width/2 > screenX ) )
70 | player.setSlideDown(true);
71 | else
72 | player.jump();
73 | }
74 | }
75 |
76 | return true;
77 | }
78 |
79 | @Override
80 | public boolean touchUp(int screenX, int screenY, int pointer, int button) {
81 | // TODO Auto-generated method stub
82 | player.setSlideDown(false);
83 |
84 | return false;
85 | }
86 |
87 | @Override
88 | public boolean touchDragged(int screenX, int screenY, int pointer) {
89 | // TODO Auto-generated method stub
90 |
91 | return true;
92 | }
93 |
94 | @Override
95 | public boolean mouseMoved(int screenX, int screenY) {
96 | // TODO Auto-generated method stub
97 | return false;
98 | }
99 |
100 | @Override
101 | public boolean scrolled(int amount) {
102 | // TODO Auto-generated method stub
103 | return false;
104 | }
105 |
106 | }
107 |
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/handler/MyGestureListener.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.handler;
2 |
3 | import com.badlogic.gdx.input.GestureDetector.GestureListener;
4 | import com.badlogic.gdx.math.Vector2;
5 | import com.yondev.gatot.run.entity.Player;
6 | import com.yondev.gatot.run.world.GameWorld;
7 |
8 | public class MyGestureListener implements GestureListener{
9 |
10 | private GameWorld world;
11 | private Player player;
12 | private ScrollHandler scroll;
13 | private boolean firstTouch = false;
14 | public MyGestureListener(GameWorld world)
15 | {
16 | this.world = world;
17 | this.player = this.world.getPlayer();
18 | this.scroll = this.world.getScroller();
19 | }
20 |
21 | @Override
22 | public boolean touchDown(float x, float y, int pointer, int button) {
23 |
24 | return false;
25 | }
26 |
27 | @Override
28 | public boolean tap(float x, float y, int count, int button) {
29 |
30 | if (!firstTouch)
31 | {
32 |
33 | firstTouch = true;
34 | world.start();
35 | this.scroll.start();
36 |
37 | player.jump();
38 | }
39 | else
40 | {
41 | if ((world.width/2 > x ) )
42 | player.jump();
43 | else
44 | {
45 | player.setSlideDown(true);
46 | }
47 | }
48 |
49 |
50 | return false;
51 | }
52 |
53 | @Override
54 | public boolean longPress(float x, float y) {
55 |
56 | return false;
57 | }
58 |
59 | @Override
60 | public boolean fling(float velocityX, float velocityY, int button) {
61 |
62 | return false;
63 | }
64 |
65 | @Override
66 | public boolean pan(float x, float y, float deltaX, float deltaY) {
67 |
68 | return false;
69 | }
70 |
71 | @Override
72 | public boolean panStop(float x, float y, int pointer, int button) {
73 |
74 | return false;
75 | }
76 |
77 | @Override
78 | public boolean zoom (float originalDistance, float currentDistance){
79 |
80 | return false;
81 | }
82 |
83 | @Override
84 | public boolean pinch (Vector2 initialFirstPointer, Vector2 initialSecondPointer, Vector2 firstPointer, Vector2 secondPointer){
85 |
86 | return false;
87 | }
88 |
89 | }
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/handler/ScrollHandler.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.handler;
2 |
3 | import java.util.Collections;
4 | import java.util.Random;
5 |
6 | import com.badlogic.gdx.Gdx;
7 | import com.badlogic.gdx.graphics.g2d.TextureAtlas;
8 | import com.yondev.gatot.run.entity.Obstacle;
9 | import com.yondev.gatot.run.entity.Player;
10 | import com.yondev.gatot.run.entity.scrollObject;
11 | import com.yondev.gatot.run.world.GameWorld;
12 |
13 | public class ScrollHandler {
14 |
15 | //ground
16 | private scrollObject groundBack,groundmid,groundFront;
17 |
18 | //cloud
19 | private scrollObject cloud1,cloud2,cloud3,cloud4;
20 |
21 | //obtacles
22 | private Obstacle obstacle1,obstacle2,obstacle3;
23 |
24 |
25 | public static float SCROLL_SPEED_MAX = -25f;
26 | public static float SCROLL_SPEED_INIT = -13f;
27 | public static float SCROLL_SPEED = -13f;
28 |
29 | public int width;
30 | public int height;
31 | public float distance = 0;
32 | public float speed = 0;
33 |
34 | private GameWorld world;
35 | private TextureAtlas atlas;
36 |
37 |
38 | private float scaleFactor;
39 |
40 | private Player player;
41 | private float groundY;
42 |
43 | private float[] distanceObstacle;
44 | public ScrollHandler(GameWorld world) {
45 | this.world = world;
46 | atlas = this.world.getAtlas();
47 | scaleFactor = this.world.getScaleFactor();
48 |
49 |
50 | SCROLL_SPEED_MAX = -16.6f * scaleFactor;
51 | SCROLL_SPEED_INIT = -8.6f * scaleFactor;
52 | SCROLL_SPEED = -8.6f * scaleFactor;
53 |
54 | this.height = this.world.height;
55 | this.width = this.world.width;
56 |
57 | player = this.world.getPlayer();
58 |
59 |
60 | groundY = this.world.getGround().y;
61 |
62 | groundFront = new scrollObject(0,groundY , (int)(atlas.findRegion("tanah").getRegionWidth() * scaleFactor), (int)(atlas.findRegion("tanah").getRegionHeight() * scaleFactor),SCROLL_SPEED);
63 | groundmid = new scrollObject(groundFront.getTailX() - 5, groundY, (int)(atlas.findRegion("tanah").getRegionWidth() * scaleFactor), (int)(atlas.findRegion("tanah").getRegionHeight() * scaleFactor),SCROLL_SPEED);
64 | groundBack = new scrollObject(groundmid.getTailX() - 5, groundY, (int)(atlas.findRegion("tanah").getRegionWidth() * scaleFactor), (int)(atlas.findRegion("tanah").getRegionHeight() * scaleFactor),SCROLL_SPEED);
65 |
66 |
67 | distanceObstacle = new float[]{width,width/2,width - 100,width,width*1.2f,width*1.4f,width*1.5f,width*2f};
68 |
69 | initObstables();
70 | initParalaxObjet();
71 | }
72 |
73 | public void initObstables()
74 | {
75 | obstacle1 = new Obstacle(this.width * 2, groundY - (10*scaleFactor) - (int)(atlas.findRegion("gunungan/1").getRegionHeight() * scaleFactor), (int)(atlas.findRegion("gunungan/1").getRegionWidth() * scaleFactor * 1.5f), (int)(atlas.findRegion("gunungan/1").getRegionHeight() * scaleFactor * 1.2f) , SCROLL_SPEED);
76 | obstacle2 = new Obstacle(obstacle1.getTailX() + this.width, groundY - (10*scaleFactor) - (int)(atlas.findRegion("gunungan/2").getRegionHeight() * scaleFactor),(int)(atlas.findRegion("gunungan/2").getRegionWidth() * scaleFactor * 1.5f), (int)(atlas.findRegion("gunungan/2").getRegionHeight() * scaleFactor * 1.2f), SCROLL_SPEED);
77 | obstacle3 = new Obstacle(obstacle2.getTailX() + this.width, groundY - (10*scaleFactor) - (int)(atlas.findRegion("gunungan/3").getRegionHeight() * scaleFactor),(int)(atlas.findRegion("gunungan/3").getRegionWidth() * scaleFactor * 1.5f), (int)(atlas.findRegion("gunungan/3").getRegionHeight() * scaleFactor * 1.2f), SCROLL_SPEED);
78 | }
79 |
80 | public void initParalaxObjet()
81 | {
82 | cloud1 = new scrollObject(width,height/3, (int)(atlas.findRegion("awan").getRegionWidth() * scaleFactor), (int)(atlas.findRegion("awan").getRegionHeight() * scaleFactor), SCROLL_SPEED + 12);
83 | cloud2 = new scrollObject(cloud1.getX() + width/2,30,cloud1.getWidth(),cloud1.getHeight(), SCROLL_SPEED + 12);
84 | cloud3 = new scrollObject(cloud2.getX() + width,height/4,cloud1.getWidth(),cloud1.getHeight(), SCROLL_SPEED + 12);
85 | cloud4 = new scrollObject(cloud3.getX() + width,40,cloud1.getWidth(),cloud1.getHeight(), SCROLL_SPEED + 12);
86 | }
87 |
88 | public void update(float delta) {
89 |
90 | groundFront.update(delta);
91 | groundmid.update(delta);
92 | groundBack.update(delta);
93 |
94 | obstacle1.update(delta);
95 | obstacle2.update(delta);
96 | obstacle3.update(delta);
97 |
98 |
99 | cloud1.update(delta);
100 | cloud2.update(delta);
101 | cloud3.update(delta);
102 | cloud4.update(delta);
103 |
104 | if (player.state != Player.JUMP && player.state != Player.DEAD )
105 | {
106 | if (groundFront.incrementSpeed < -10)
107 | {
108 | if (player.state != Player.SPRINT)
109 | player.stateTime = 0;
110 | player.state = Player.SPRINT;
111 |
112 | }
113 | else
114 | {
115 | if (player.state != Player.RUN)
116 | player.stateTime = 0;
117 |
118 | if(player.state != Player.IDLE)
119 | player.state = Player.RUN;
120 |
121 | }
122 | }
123 |
124 |
125 |
126 | if (groundFront.isScrolledLeft()) {
127 |
128 | groundFront.reset(groundBack.getTailX() - 5);
129 |
130 | } else if (groundmid.isScrolledLeft()) {
131 | groundmid.reset(groundFront.getTailX() - 5);
132 |
133 | }
134 | else if (groundBack.isScrolledLeft()) {
135 | groundBack.reset(groundmid.getTailX() - 5);
136 | }
137 |
138 |
139 | if (cloud1.isScrolledLeft()) {
140 |
141 | cloud1.reset(cloud4.getX() + 200);
142 |
143 | } else if (cloud2.isScrolledLeft()) {
144 | cloud2.reset(cloud1.getX() + (width/2 - 200));
145 |
146 | }
147 | else if (cloud3.isScrolledLeft()) {
148 | cloud3.reset(cloud2.getX() + (width - 200));
149 | }
150 | else if (cloud4.isScrolledLeft()) {
151 | cloud4.reset(cloud3.getX() + (width - 400));
152 | }
153 |
154 | distance += (groundFront.currentSpeed);
155 | speed = groundFront.currentSpeed;
156 |
157 | cekCollision();
158 |
159 | spawnObstacles();
160 |
161 | speedLevel(delta);
162 | }
163 |
164 | private void speedLevel(float delta)
165 | {
166 | if(world.getRenderer().getScore() >= 50)
167 | {
168 | SCROLL_SPEED -= delta * 0.2;
169 | if(SCROLL_SPEED <= SCROLL_SPEED_MAX )
170 | SCROLL_SPEED = SCROLL_SPEED_MAX;
171 |
172 |
173 | this.setSpeed(SCROLL_SPEED,true);
174 | Gdx.app.debug("SPEEF", SCROLL_SPEED + "");
175 | }
176 | }
177 |
178 | private void spawnObstacles()
179 | {
180 |
181 | Random rn = new Random();
182 | int rand = rn.nextInt(distanceObstacle.length - 1) ;
183 |
184 | int score = world.getRenderer().getScore();
185 | int ran = 1;
186 | if (obstacle1.isScrolledLeft()) {
187 | if(score <= 50)
188 | {
189 | obstacle1.setType(1);
190 | }
191 | else if(score > 50 && score <= 100)
192 | {
193 | ran = rn.nextInt(3) + 1 ;
194 | obstacle1.setType(ran);
195 | }
196 | else if(score > 100)
197 | {
198 | ran = rn.nextInt(6) + 1 ;
199 | obstacle1.setType(ran);
200 | if(ran == 6)
201 | {
202 | ran = rn.nextInt(6) + 1 ;
203 | obstacle1.setPostype(ran);
204 | }
205 | }
206 |
207 | obstacle1.reset(obstacle3.getX() + distanceObstacle[rand]);
208 |
209 | } else if (obstacle2.isScrolledLeft()) {
210 | if(score <= 50)
211 | {
212 | obstacle2.setType(1);
213 | }
214 | else if(score > 50 && score <= 100)
215 | {
216 | ran = rn.nextInt(3) + 1 ;
217 | obstacle2.setType(ran);
218 | }
219 | else if(score > 100)
220 | {
221 | ran = rn.nextInt(6) + 1 ;
222 | obstacle2.setType(ran);
223 | if(ran == 6)
224 | {
225 | ran = rn.nextInt(6) + 1 ;
226 | obstacle2.setPostype(ran);
227 | }
228 | }
229 | obstacle2.reset(obstacle1.getX() + distanceObstacle[rand]);
230 | }
231 |
232 | else if (obstacle3.isScrolledLeft()) {
233 | if(score <= 50)
234 | {
235 | obstacle3.setType(1);
236 | }
237 | else if(score > 50 && score <= 100)
238 | {
239 | ran = rn.nextInt(3) + 1 ;
240 | obstacle3.setType(ran);
241 | }
242 | else if(score > 100)
243 | {
244 | ran = rn.nextInt(6) + 1 ;
245 | obstacle3.setType(ran);
246 | if(ran == 6)
247 | {
248 | ran = rn.nextInt(6) + 1 ;
249 | obstacle3.setPostype(ran);
250 | }
251 | }
252 |
253 | obstacle3.reset(obstacle2.getX() + distanceObstacle[rand]);
254 | }
255 | }
256 |
257 | private void cekCollision()
258 | {
259 | if(player.bounds.overlaps(obstacle1.getBounds()) || player.bounds.overlaps(obstacle2.getBounds()) || player.bounds.overlaps(obstacle3.getBounds()))
260 | {
261 | world.stop();
262 | }
263 | }
264 |
265 | public void setSpeed(float speed,boolean reset)
266 | {
267 | groundFront.setSpeed(speed,reset);
268 | groundBack.setSpeed(speed,reset);
269 | groundmid.setSpeed(speed,reset);
270 |
271 |
272 | obstacle1.setSpeed(speed,reset);
273 | obstacle2.setSpeed(speed,reset);
274 | obstacle3.setSpeed(speed,reset);
275 |
276 | cloud1.setSpeed(speed + 12,reset);
277 | cloud2.setSpeed(speed + 12,reset);
278 | cloud3.setSpeed(speed + 12,reset);
279 | cloud4.setSpeed(speed + 12,reset);
280 |
281 | if(speed <= -15)
282 | {
283 | player.setMaxJump();
284 | }
285 |
286 | }
287 |
288 | public void stop(){
289 | groundFront.stop();
290 | groundBack.stop();
291 | groundmid.stop();
292 |
293 | obstacle1.stop();
294 | obstacle2.stop();
295 | obstacle3.stop();
296 |
297 | cloud1.stop();
298 | cloud2.stop();
299 | cloud3.stop();
300 | cloud4.stop();
301 |
302 | }
303 |
304 | public void start() {
305 |
306 | SCROLL_SPEED = SCROLL_SPEED_INIT;
307 | this.setSpeed(SCROLL_SPEED,true);
308 | player.setResetJump();
309 | groundFront.start();
310 | groundBack.start();
311 | groundmid.start();
312 |
313 | obstacle1.start();
314 | obstacle2.start();
315 | obstacle3.start();
316 |
317 | cloud1.start();
318 | cloud2.start();
319 | cloud3.start();
320 | cloud4.start();
321 | }
322 |
323 |
324 | public scrollObject getgroundFront() {
325 | return groundFront;
326 | }
327 |
328 | public scrollObject getgroundBack() {
329 | return groundBack;
330 | }
331 |
332 | public scrollObject getgroundMid() {
333 | return groundmid;
334 | }
335 |
336 | public Obstacle getObstacle1() {
337 | return obstacle1;
338 | }
339 |
340 | public Obstacle getObstacle2() {
341 | return obstacle2;
342 | }
343 |
344 | public Obstacle getObstacle3() {
345 | return obstacle3;
346 | }
347 | public scrollObject getCloud1() {
348 | return cloud1;
349 | }
350 |
351 | public scrollObject getCloud2() {
352 | return cloud2;
353 | }
354 |
355 | public scrollObject getCloud3() {
356 | return cloud3;
357 | }
358 | public scrollObject getCloud4() {
359 | return cloud4;
360 | }
361 |
362 | }
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/helper/FontAccessor.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.helper;
2 |
3 | import aurelienribon.tweenengine.TweenAccessor;
4 |
5 | import com.badlogic.gdx.graphics.g2d.BitmapFont;
6 |
7 | public class FontAccessor implements TweenAccessor {
8 |
9 | public static final int ALPHA = 1;
10 |
11 | public int getValues(BitmapFont target, int tweenType, float[] returnValues) {
12 | switch (tweenType) {
13 | case ALPHA:
14 | returnValues[0] = target.getColor().a;
15 |
16 | return 1;
17 | default:
18 | return 0;
19 | }
20 | }
21 |
22 | public void setValues(BitmapFont target, int tweenType, float[] newValues) {
23 | switch (tweenType) {
24 | case ALPHA:
25 | target.setColor(1, 1, 1, newValues[0]);
26 | break;
27 | }
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/helper/SpriteAccessor.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.helper;
2 |
3 | import aurelienribon.tweenengine.TweenAccessor;
4 |
5 | import com.badlogic.gdx.graphics.g2d.Sprite;
6 |
7 | public class SpriteAccessor implements TweenAccessor {
8 |
9 | public static final int ALPHA = 1;
10 | public static final int SCALE = 2;
11 | public static final int POSXY = 3;
12 |
13 | public int getValues(Sprite target, int tweenType, float[] returnValues) {
14 | switch (tweenType) {
15 | case ALPHA:
16 | returnValues[0] = target.getColor().a;
17 | return 1;
18 | case SCALE:
19 | returnValues[0] = target.getScaleX();
20 | returnValues[1] = target.getScaleY();
21 | return 2;
22 | case POSXY:
23 | returnValues[0] = target.getX();
24 | returnValues[1] = target.getY();
25 | return 3;
26 | default:
27 | return 0;
28 | }
29 | }
30 |
31 | public void setValues(Sprite target, int tweenType, float[] newValues) {
32 | switch (tweenType) {
33 | case ALPHA:
34 | target.setColor(1, 1, 1, newValues[0]);
35 | break;
36 | case SCALE:
37 | target.setScale(newValues[0]);
38 | break;
39 | case POSXY:
40 | target.setPosition(newValues[0], newValues[1]);
41 | break;
42 | }
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/helper/Value.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.helper;
2 |
3 | public class Value {
4 |
5 | private float val = 1;
6 |
7 | public float getValue() {
8 | return val;
9 | }
10 |
11 | public void setValue(float newVal) {
12 | val = newVal;
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/helper/ValueAccessor.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.helper;
2 |
3 | import aurelienribon.tweenengine.TweenAccessor;
4 |
5 |
6 | public class ValueAccessor implements TweenAccessor {
7 |
8 | @Override
9 | public int getValues(Value target, int tweenType, float[] returnValues) {
10 | returnValues[0] = target.getValue();
11 | return 1;
12 | }
13 |
14 | @Override
15 | public void setValues(Value target, int tweenType, float[] newValues) {
16 | target.setValue(newValues[0]);
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/screen/GameScreen.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.screen;
2 |
3 | import com.badlogic.gdx.Gdx;
4 | import com.badlogic.gdx.Screen;
5 | import com.badlogic.gdx.graphics.g2d.TextureAtlas;
6 | import com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion;
7 | import com.yondev.gatot.run.GatotRun;
8 | import com.yondev.gatot.run.handler.InputHandler;
9 | import com.yondev.gatot.run.world.GameWorld;
10 | import com.yondev.gatot.run.world.GameWorldRenderer;
11 |
12 | public class GameScreen extends GatotScreen implements Screen{
13 |
14 | private int width;
15 | private int height;
16 |
17 | private TextureAtlas atlas;
18 |
19 | private GameWorld world;
20 | private GameWorldRenderer renderer;
21 |
22 | private float runTime;
23 | public GameScreen(GatotRun game)
24 | {
25 | super(game);
26 |
27 | width = Gdx.graphics.getWidth();
28 | height = Gdx.graphics.getHeight();
29 |
30 | atlas = game.assets.get("data/gatot.pack", TextureAtlas.class);
31 | for(AtlasRegion ar : atlas.getRegions()) {
32 | ar.flip(false, true);
33 | }
34 |
35 | world = new GameWorld(game,atlas,width,height);
36 | renderer = new GameWorldRenderer(world,width,height);
37 | world.setRenderer(renderer);
38 |
39 | // Gdx.input.setInputProcessor(new GestureDetector(new MyGestureListener(world)));
40 | Gdx.input.setInputProcessor(new InputHandler(world));
41 | // Gdx.input.setInputProcessor();
42 | // new InputHandler(world)
43 | }
44 |
45 | @Override
46 | public void render(float delta) {
47 | // TODO Auto-generated method stub
48 | runTime += delta;
49 | world.update(delta);
50 | renderer.render(delta, runTime);
51 | }
52 |
53 | @Override
54 | public void resize(int width, int height) {
55 | // TODO Auto-generated method stub
56 |
57 | }
58 |
59 | @Override
60 | public void show() {
61 | // TODO Auto-generated method stub
62 | }
63 |
64 | @Override
65 | public void hide() {
66 | // TODO Auto-generated method stub
67 |
68 | }
69 |
70 | @Override
71 | public void pause() {
72 | // TODO Auto-generated method stub
73 |
74 | }
75 |
76 | @Override
77 | public void resume() {
78 | // TODO Auto-generated method stub
79 |
80 | }
81 |
82 | @Override
83 | public void dispose() {
84 | // TODO Auto-generated method stub
85 |
86 | }
87 |
88 | public enum GameState {
89 | READY, RUNNING, GAMEOVER
90 | }
91 |
92 | }
93 |
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/screen/GatotScreen.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.screen;
2 |
3 | import com.badlogic.gdx.Screen;
4 | import com.yondev.gatot.run.GatotRun;
5 |
6 | public abstract class GatotScreen implements Screen{
7 | GatotRun game;
8 | public GatotScreen (GatotRun game) {
9 | this.game = game;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/screen/SplashScreen.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.screen;
2 |
3 | import aurelienribon.tweenengine.BaseTween;
4 | import aurelienribon.tweenengine.Timeline;
5 | import aurelienribon.tweenengine.Tween;
6 | import aurelienribon.tweenengine.TweenCallback;
7 | import aurelienribon.tweenengine.TweenEquations;
8 | import aurelienribon.tweenengine.TweenManager;
9 |
10 | import com.badlogic.gdx.Gdx;
11 | import com.badlogic.gdx.Screen;
12 | import com.badlogic.gdx.assets.AssetManager;
13 | import com.badlogic.gdx.graphics.GL20;
14 | import com.badlogic.gdx.graphics.Texture;
15 | import com.badlogic.gdx.graphics.g2d.Sprite;
16 | import com.badlogic.gdx.graphics.g2d.SpriteBatch;
17 | import com.badlogic.gdx.graphics.g2d.TextureAtlas;
18 | import com.badlogic.gdx.graphics.g2d.TextureRegion;
19 | import com.yondev.gatot.run.GatotRun;
20 | import com.yondev.gatot.run.helper.SpriteAccessor;
21 |
22 | public class SplashScreen extends GatotScreen implements Screen {
23 |
24 | private Texture logoTexture1;
25 | private TextureRegion logo1;
26 | private Texture logoTexture2;
27 | private TextureRegion logo2;
28 | private TweenManager manager;
29 | private SpriteBatch batcher;
30 | private Sprite sprite1;
31 | private Sprite sprite2;
32 | public SplashScreen(GatotRun game) {
33 | super(game);
34 | logoTexture1 = new Texture(Gdx.files.internal("data/logoyondev.png"));
35 | logo1 = new TextureRegion(logoTexture1, 0, 0, 585, 150);
36 | logoTexture2 = new Texture(Gdx.files.internal("data/gamewae.png"));
37 | logo2 = new TextureRegion(logoTexture2, 0, 0, 314, 55);
38 | }
39 |
40 | @Override
41 | public void render(float delta) {
42 | // TODO Auto-generated method stub
43 | manager.update(delta);
44 | Gdx.gl.glClearColor(1, 1, 1, 1);
45 | Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
46 | batcher.begin();
47 | sprite1.draw(batcher);
48 | sprite2.draw(batcher);
49 | batcher.end();
50 |
51 | if(game.assets != null)
52 | {
53 | if(game.assets.update()){
54 | game.setScreen(new GameScreen(game));
55 | }
56 | }
57 |
58 | }
59 |
60 | @Override
61 | public void resize(int width, int height) {
62 | // TODO Auto-generated method stub
63 |
64 | }
65 |
66 | @Override
67 | public void show() {
68 | // TODO Auto-generated method stub
69 | sprite1 = new Sprite(logo1);
70 | sprite1.setColor(1, 1, 1, 0);
71 |
72 | sprite2 = new Sprite(logo2);
73 | sprite2.setColor(1, 1, 1, 0);
74 |
75 | float width = Gdx.graphics.getWidth();
76 | float height = Gdx.graphics.getHeight();
77 | float desiredWidth = width * .7f;
78 |
79 | float scale1 = desiredWidth / sprite1.getWidth();
80 | float scale2 = desiredWidth / sprite2.getWidth();
81 |
82 | sprite1.setSize(sprite1.getWidth() * scale1, sprite1.getHeight() * scale1);
83 | sprite1.setPosition((width / 2) - (sprite1.getWidth() / 2), (height / 2)- (sprite1.getHeight() / 2));
84 |
85 | sprite2.setSize(sprite2.getWidth() * scale2, sprite2.getHeight() * scale2);
86 | sprite2.setPosition((width / 2) - (sprite2.getWidth() / 2), (height / 2)- (sprite2.getHeight() / 2));
87 |
88 | setupTween();
89 |
90 | batcher = new SpriteBatch();
91 | }
92 |
93 | private void setupTween() {
94 | Tween.registerAccessor(Sprite.class, new SpriteAccessor());
95 | manager = new TweenManager();
96 |
97 | TweenCallback cb = new TweenCallback() {
98 | @Override
99 | public void onEvent(int type, BaseTween> source) {
100 | game.assets = new AssetManager();
101 | game.assets.load("data/gatot.pack",TextureAtlas.class);
102 |
103 | }
104 | };
105 |
106 | Timeline.createSequence()
107 | .push(Tween.to(sprite1, SpriteAccessor.ALPHA, 1f).target(1)
108 | .ease(TweenEquations.easeInOutQuad).repeatYoyo(1, 2f))
109 | .push(Tween.to(sprite2, SpriteAccessor.ALPHA, 1f).target(1)
110 | .ease(TweenEquations.easeInOutQuad).repeatYoyo(1, 2f)
111 | .setCallback(cb).setCallbackTriggers(TweenCallback.COMPLETE)
112 | ).start(manager);
113 | }
114 |
115 | @Override
116 | public void hide() {
117 | // TODO Auto-generated method stub
118 |
119 | }
120 |
121 | @Override
122 | public void pause() {
123 | // TODO Auto-generated method stub
124 |
125 | }
126 |
127 | @Override
128 | public void resume() {
129 | // TODO Auto-generated method stub
130 |
131 | }
132 |
133 | @Override
134 | public void dispose() {
135 | // TODO Auto-generated method stub
136 |
137 | }
138 |
139 | }
140 |
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/world/GameWorld.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.world;
2 |
3 | import com.badlogic.gdx.Gdx;
4 | import com.badlogic.gdx.Preferences;
5 | import com.badlogic.gdx.audio.Sound;
6 | import com.badlogic.gdx.graphics.g2d.TextureAtlas;
7 | import com.badlogic.gdx.math.Rectangle;
8 | import com.yondev.gatot.run.GatotRun;
9 | import com.yondev.gatot.run.entity.Player;
10 | import com.yondev.gatot.run.handler.ScrollHandler;
11 |
12 | public class GameWorld {
13 |
14 | private GameWorldRenderer renderer;
15 |
16 | public int width;
17 | public int height;
18 |
19 | private float scaleFactor;
20 | private TextureAtlas atlas;
21 |
22 | private ScrollHandler scroller;
23 | private Player player;
24 | private Rectangle ground;
25 |
26 | public GameState currentState = GameState.READY;
27 | public enum GameState {
28 | READY, RUNNING, GAMEOVER
29 | }
30 |
31 | private Sound dead;
32 | public Preferences prefs;
33 | private GatotRun game;
34 | int gameOverCount = 0;
35 | public GameWorld(GatotRun game,TextureAtlas atlas,int width,int height)
36 | {
37 | this.game = game;
38 | this.atlas = atlas;
39 | this.width = width;
40 | this.height = height;
41 | scaleFactor = height/480f; //(float)(this.atlas.findRegion("player/1").getRegionWidth() / this.width);
42 | //scaleFactor = 2.5f;
43 |
44 | prefs = Gdx.app.getPreferences("GatotData");
45 | dead = Gdx.audio.newSound(Gdx.files.internal("data/sound/dead.mp3"));
46 |
47 | float groundHeight = this.atlas.findRegion("tanah").getRegionHeight() *scaleFactor;
48 | ground = new Rectangle(0, height - groundHeight, width, groundHeight - 13.3f*scaleFactor);
49 | player = new Player(this,66.6f*scaleFactor, ground.y - ( this.atlas.findRegion("player/1").getRegionHeight() * scaleFactor ) + (15 * scaleFactor ) , ( this.atlas.findRegion("player/1").getRegionWidth() * scaleFactor),( this.atlas.findRegion("player/1").getRegionHeight() * scaleFactor));
50 |
51 | scroller = new ScrollHandler(this);
52 | }
53 |
54 | public void setRenderer(GameWorldRenderer renderer) {
55 | this.renderer = renderer;
56 | }
57 |
58 | public GameWorldRenderer getRenderer() {
59 | return this.renderer;
60 | }
61 |
62 | public void update(float delta)
63 | {
64 | scroller.update(delta);
65 | player.update(delta);
66 | }
67 |
68 | public TextureAtlas getAtlas()
69 | {
70 | return this.atlas;
71 | }
72 |
73 | public float getScaleFactor()
74 | {
75 | return this.scaleFactor;
76 | }
77 |
78 | public ScrollHandler getScroller() {
79 | return scroller;
80 | }
81 |
82 | public Player getPlayer() {
83 | return player;
84 | }
85 |
86 | public Rectangle getGround() {
87 | return ground;
88 | }
89 |
90 | public void start() {
91 | this.game.getAdsController().hideBannerAd();
92 | currentState = GameState.RUNNING;
93 | player.state = Player.IDLE;
94 | }
95 |
96 | public void start(boolean force) {
97 | this.game.getAdsController().hideBannerAd();
98 | currentState = GameState.RUNNING;
99 | player.state = Player.RUN;
100 | }
101 |
102 | public void stop() {
103 | if(currentState != GameState.GAMEOVER)
104 | {
105 | gameOverCount++;
106 | if(gameOverCount % 3 == 0)
107 | this.game.getAdsController().showInterstitialAd();
108 | else
109 | this.game.getAdsController().showBannerAd();
110 | }
111 |
112 |
113 | currentState = GameState.GAMEOVER;
114 |
115 | if(player.state != Player.DEAD)
116 | dead.play();
117 |
118 | player.state = Player.DEAD;
119 |
120 | scroller.stop();
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/core/src/com/yondev/gatot/run/world/GameWorldRenderer.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.world;
2 |
3 | import com.badlogic.gdx.Gdx;
4 | import com.badlogic.gdx.audio.Sound;
5 | import com.badlogic.gdx.graphics.Color;
6 | import com.badlogic.gdx.graphics.GL20;
7 | import com.badlogic.gdx.graphics.OrthographicCamera;
8 | import com.badlogic.gdx.graphics.Pixmap;
9 | import com.badlogic.gdx.graphics.Texture;
10 | import com.badlogic.gdx.graphics.g2d.Animation;
11 | import com.badlogic.gdx.graphics.g2d.BitmapFont;
12 | import com.badlogic.gdx.graphics.g2d.GlyphLayout;
13 | import com.badlogic.gdx.graphics.g2d.SpriteBatch;
14 | import com.badlogic.gdx.graphics.g2d.TextureAtlas;
15 | import com.badlogic.gdx.graphics.g2d.TextureRegion;
16 | import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
17 | import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType;
18 | import com.badlogic.gdx.math.Interpolation;
19 | import com.badlogic.gdx.math.Rectangle;
20 | import com.badlogic.gdx.utils.Array;
21 | import com.yondev.gatot.run.entity.GameObject;
22 | import com.yondev.gatot.run.entity.Obstacle;
23 | import com.yondev.gatot.run.entity.Player;
24 | import com.yondev.gatot.run.entity.scrollObject;
25 | import com.yondev.gatot.run.handler.ScrollHandler;
26 | import com.yondev.gatot.run.world.GameWorld.GameState;
27 |
28 | public class GameWorldRenderer {
29 |
30 | private GameWorld world;
31 | private OrthographicCamera cam;
32 | private SpriteBatch batcher;
33 |
34 | private int width;
35 | private int height;
36 | private float scaleFactor = 0;
37 | private TextureAtlas atlas;
38 |
39 | //background
40 | private TextureRegion bgImage;
41 |
42 | // scrollobject
43 | private ScrollHandler scroller;
44 | private scrollObject groundBack,groundFront,groundMid;
45 | private scrollObject cloud1,cloud2,cloud3,cloud4;
46 |
47 | //player
48 | private Player player;
49 | private Animation playerRun,playerSprint,playerSlideDown;
50 | private TextureRegion playerIdle,playerJump;
51 |
52 | //star
53 | private Animation star;
54 |
55 | //obtacles
56 | private Obstacle obtacle1,obtacle2,obtacle3;
57 | private Animation bird;
58 |
59 | // HUD
60 | private TextureRegion play;
61 | private BitmapFont gameOverText;
62 | private float gameoverwidth;
63 | private BitmapFont scoreText;
64 | private BitmapFont hiscoreText;
65 | private float scorewidth;
66 |
67 | private BitmapFont jumpText;
68 | private BitmapFont boxText;
69 | private float jumpTextwidth;
70 |
71 | private Texture txtWrapper;
72 |
73 |
74 | ShapeRenderer shapeRenderer;
75 |
76 | private int lastscore = 0;
77 | private int score = 0;
78 |
79 | private float timer = 0;
80 | private boolean isFirstime = true;
81 |
82 | private float timerStar1 = 0;
83 | private float timerStar2 = 0;
84 | private float timerStar3 = 0;
85 |
86 | public float freezTime = 0;
87 |
88 | private float birdPos[];
89 | private Sound point;
90 |
91 | private float elapsed;
92 | private static final float FADE_TIME = 0.5f;
93 | private float blinktime = 0;
94 | private boolean playblink = false;
95 | public GameWorldRenderer(GameWorld world,int gameWidth, int gameHeight) {
96 | this.world = world;
97 | this.width = gameWidth;
98 | this.height = gameHeight;
99 |
100 | this.cam = new OrthographicCamera();
101 | this.batcher = new SpriteBatch();
102 | this.cam.setToOrtho(true, this.width, this.height);
103 |
104 | this.atlas = this.world.getAtlas();
105 | scaleFactor = this.world.getScaleFactor();
106 |
107 | lastscore = world.prefs.getInteger("hiscore", 0);
108 | if(lastscore != 0)
109 | isFirstime = false;
110 |
111 | initAnimation();
112 | initBackground();
113 | initGameObjects();
114 | initScrollerObject();
115 |
116 | shapeRenderer = new ShapeRenderer();
117 |
118 | float playerHeight = ( this.atlas.findRegion("player/1").getRegionHeight() * scaleFactor);
119 | float burungHeight = ( this.atlas.findRegion("burung/2").getRegionHeight() * scaleFactor);
120 | birdPos = new float[] {world.getGround().y - playerHeight - 6.6f*scaleFactor,
121 | world.getGround().y - burungHeight + 6.6f*scaleFactor,
122 | world.getGround().y - playerHeight - burungHeight + 13.3f*scaleFactor,
123 | world.getGround().y - playerHeight - 6.6f*scaleFactor,
124 | world.getGround().y - burungHeight + 6.6f*scaleFactor,
125 | world.getGround().y - playerHeight - burungHeight + 13.3f*scaleFactor,
126 | world.getGround().y - playerHeight - burungHeight + 13.3f*scaleFactor};
127 |
128 |
129 | point = Gdx.audio.newSound(Gdx.files.internal("data/sound/point.mp3"));
130 |
131 | }
132 |
133 | public void renderObject(GameObject obj)
134 | {
135 | shapeRenderer.begin(ShapeType.Line);
136 | shapeRenderer.rect(obj.bounds.x, obj.bounds.y, obj.bounds.width, obj.bounds.height);
137 | shapeRenderer.setColor(Color.RED);
138 | shapeRenderer.end();
139 | }
140 |
141 | public void renderObject(scrollObject obj)
142 | {
143 | shapeRenderer.begin(ShapeType.Line);
144 | shapeRenderer.rect(obj.getX(), obj.getY(), obj.getWidth(), obj.getHeight());
145 | shapeRenderer.setColor(Color.RED);
146 | shapeRenderer.end();
147 | }
148 |
149 | public void render(float delta, float runTime) {
150 |
151 | timer += delta;
152 | if( timer >= 0.25f)
153 | {
154 | if(world.currentState == GameWorld.GameState.RUNNING)
155 | {
156 | score = score + 1;
157 | if(score % 100 == 0)
158 | {
159 | playblink = true;
160 | point.play();
161 |
162 | }
163 |
164 | }
165 | else if(world.currentState == GameWorld.GameState.GAMEOVER)
166 | {
167 |
168 | if(score > lastscore)
169 | lastscore = score;
170 |
171 | world.prefs.putInteger("hiscore", lastscore);
172 | world.prefs.flush();
173 | isFirstime = false;
174 | }
175 |
176 |
177 | timer=0f;
178 | }
179 |
180 | if(world.currentState == GameWorld.GameState.GAMEOVER)
181 | freezTime += delta;
182 |
183 | timerStar1 += delta;
184 | timerStar2 += delta;
185 | timerStar3 += delta;
186 |
187 | if(playblink)
188 | {
189 | blinktime += delta;
190 | if(blinktime <= 1f)
191 | {
192 | elapsed += delta;
193 | scoreText.setColor(scoreText.getColor().r, scoreText.getColor().r, scoreText.getColor().b, Interpolation.fade.apply((elapsed / FADE_TIME) % 1f));;
194 | }
195 | else
196 | {
197 | playblink = false;
198 | blinktime = 0;
199 | scoreText.setColor(scoreText.getColor().r, scoreText.getColor().r, scoreText.getColor().b, 1);
200 |
201 | }
202 |
203 | }
204 |
205 |
206 | Gdx.gl.glClearColor(1, 1, 1, 1);
207 | Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
208 | batcher.setProjectionMatrix(cam.combined);
209 |
210 | drawBackground();
211 |
212 | batcher.enableBlending();
213 | batcher.begin();
214 |
215 | drawScrollerObject();
216 | drawPlayer(delta, runTime);
217 | drawUIScreen();
218 | drawStar();
219 | drawObstacles();
220 | batcher.end();
221 |
222 | /*
223 | shapeRenderer.setProjectionMatrix(cam.combined);
224 |
225 | renderObject(player);
226 | renderObject(groundFront);
227 | renderObject(groundMid);
228 | renderObject(groundBack);
229 | renderObject(obtacle1);
230 | renderObject(obtacle2);
231 | renderObject(obtacle3);
232 | */
233 |
234 | }
235 | public void resetScore()
236 | {
237 |
238 | score = 0;
239 | freezTime = 0;
240 | }
241 |
242 | private void initBackground()
243 | {
244 | //gress = atlas.findRegion("rumput");
245 | //sky = atlas.findRegion("background");
246 | bgImage = atlas.findRegion("bg");
247 | play = atlas.findRegion("play");
248 |
249 | gameOverText = new BitmapFont(Gdx.files.internal("data/vt232.fnt"),true);
250 | gameOverText.getData().setScale(0.47f * scaleFactor);
251 | GlyphLayout layout = new GlyphLayout();
252 | layout.setText(gameOverText,"G A M E O V E R");
253 | gameoverwidth = layout.width;
254 |
255 | scoreText = new BitmapFont(Gdx.files.internal("data/vt232.fnt"),true);
256 | hiscoreText = new BitmapFont(Gdx.files.internal("data/vt232.fnt"),true);
257 | gameOverText.getData().setScale(0.47f * scaleFactor);
258 | hiscoreText.getData().setScale(0.2f * scaleFactor);
259 | scoreText.getData().setScale(0.2f * scaleFactor);
260 |
261 |
262 | hiscoreText.setColor(Color.BLACK);
263 | scoreText.setColor(Color.BLACK);
264 | gameOverText.setColor(Color.BLACK);
265 |
266 |
267 | jumpText = new BitmapFont(Gdx.files.internal("data/vt232.fnt"),true);
268 | boxText = new BitmapFont(Gdx.files.internal("data/vt232.fnt"),true);
269 |
270 | jumpText.setColor(Color.WHITE);
271 | boxText.setColor(Color.WHITE);
272 |
273 | jumpText.getData().setScale(0.3f * scaleFactor);
274 | boxText.getData().setScale(0.3f * scaleFactor);
275 |
276 |
277 |
278 | //txtWrapper = new Rectangle(0, 0, height - 6.6f * scaleFactor, height - 6.6f * scaleFactor);
279 |
280 | Pixmap pixmap = new Pixmap( (int)(width/2 - (6.6f * scaleFactor)*2),(int)(height - (6.6f * scaleFactor)*2 - world.getGround().height), Pixmap.Format.RGBA8888);
281 |
282 | pixmap.setColor(0,0,0,0.7f);
283 | pixmap.fillRectangle(0, 0, pixmap.getWidth(), pixmap.getHeight());
284 | txtWrapper = new Texture(pixmap);
285 |
286 | GlyphLayout layout1 = new GlyphLayout();
287 | layout1.setText(hiscoreText,"0000000");
288 | scorewidth = layout1.width;
289 |
290 | GlyphLayout layout2 = new GlyphLayout();
291 | layout2.setText(jumpText,"Tap here to jump");
292 | jumpTextwidth = layout2.width;
293 |
294 | }
295 |
296 | private void drawBackground() {
297 | // batcher.begin();
298 | // batcher.disableBlending();
299 | // batcher.draw(gress,0,(int)(this.height - (gress.getRegionHeight()*scaleFactor)),(int)(gress.getRegionWidth()*scaleFactor),(int)(gress.getRegionHeight()*scaleFactor));
300 | // batcher.draw(sky,0,(int)(this.height - (gress.getRegionHeight()*scaleFactor) - (sky.getRegionHeight()*scaleFactor)),(int)(sky.getRegionWidth()*scaleFactor),(int)(sky.getRegionHeight()*scaleFactor));
301 | // batcher.end();
302 | batcher.begin();
303 | batcher.draw(bgImage,0,0,Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
304 | batcher.end();
305 | }
306 |
307 |
308 | private void initScrollerObject()
309 | {
310 | scroller = world.getScroller();
311 |
312 | groundBack = scroller.getgroundBack();
313 | groundMid = scroller.getgroundMid();
314 | groundFront = scroller.getgroundFront();
315 |
316 | cloud1 = scroller.getCloud1();
317 | cloud2 = scroller.getCloud2();
318 | cloud3 = scroller.getCloud3();
319 | cloud4 = scroller.getCloud4();
320 |
321 | initObstacle();
322 | }
323 |
324 | public void initObstacle()
325 | {
326 | obtacle1 = scroller.getObstacle1();
327 | obtacle2 = scroller.getObstacle2();
328 | obtacle3 = scroller.getObstacle3();
329 | }
330 |
331 | private void drawScrollerObject()
332 | {
333 | // batcher.draw(atlas.findRegion("pohon"), treeFront.getX(), treeFront.getY(),treeFront.getWidth(),treeFront.getHeight());
334 | // batcher.draw(atlas.findRegion("pohon"), treeBack.getX(), treeBack.getY(),treeBack.getWidth(),treeBack.getHeight());
335 |
336 | batcher.draw(atlas.findRegion("tanah"), groundFront.getX(), groundFront.getY(),groundFront.getWidth(),groundFront.getHeight());
337 | batcher.draw(atlas.findRegion("tanah"), groundMid.getX(), groundMid.getY(),groundMid.getWidth(),groundMid.getHeight());
338 | batcher.draw(atlas.findRegion("tanah"), groundBack.getX(), groundBack.getY(),groundBack.getWidth(),groundBack.getHeight());
339 |
340 | batcher.draw(atlas.findRegion("awan"), cloud1.getX(), cloud1.getY(),cloud1.getWidth(),cloud1.getHeight());
341 | batcher.draw(atlas.findRegion("awan"), cloud2.getX(), cloud2.getY(),cloud2.getWidth(),cloud2.getHeight());
342 | batcher.draw(atlas.findRegion("awan"), cloud3.getX(), cloud3.getY(),cloud3.getWidth(),cloud3.getHeight());
343 | batcher.draw(atlas.findRegion("awan"), cloud4.getX(), cloud4.getY(),cloud4.getWidth(),cloud4.getHeight());
344 |
345 | }
346 |
347 | private void initGameObjects() {
348 | player = world.getPlayer();
349 | }
350 |
351 | private void initAnimation()
352 | {
353 | Array run = new Array();
354 | // run.add(atlas.findRegion("player/1"));
355 | run.add(atlas.findRegion("player/2"));
356 | run.add(atlas.findRegion("player/3"));
357 |
358 | playerSprint = new Animation(0.05f, run, Animation.PlayMode.LOOP);
359 | playerRun = new Animation(0.10f, run, Animation.PlayMode.LOOP);
360 |
361 | playerIdle = atlas.findRegion("player/1");
362 | playerJump = atlas.findRegion("player/4");
363 |
364 | Array down = new Array();
365 | down.add(atlas.findRegion("player/5"));
366 | down.add(atlas.findRegion("player/6"));
367 | playerSlideDown = new Animation(0.10f, down, Animation.PlayMode.LOOP);
368 |
369 | Array aBird = new Array();
370 | aBird.add(atlas.findRegion("burung/1"));
371 | aBird.add(atlas.findRegion("burung/2"));
372 | bird = new Animation(0.25f, aBird, Animation.PlayMode.LOOP);
373 |
374 | Array bintang = new Array();
375 | bintang.add(atlas.findRegion("bintang/1"));
376 | bintang.add(atlas.findRegion("bintang/2"));
377 | bintang.add(atlas.findRegion("bintang/3"));
378 |
379 | star = new Animation(0.40f, bintang, Animation.PlayMode.REVERSED);
380 |
381 | }
382 |
383 | private void drawPlayer(float delta,float runTime)
384 | {
385 | int state = player.state;
386 | float playerTime = player.stateTime;
387 |
388 | if (state == Player.IDLE)
389 | {
390 | player.setWidth(playerIdle.getRegionWidth()* scaleFactor);
391 | player.setHeight(playerIdle.getRegionHeight() * scaleFactor);
392 | player.setBoundX((66.6f*scaleFactor) + player.bounds.width/2 + 20);
393 | batcher.draw(playerIdle,player.getX(),player.getY(),player.getWidth(),player.getHeight());
394 |
395 | }
396 | else if (state == Player.RUN && !player.isSlideDown())
397 | {
398 | player.setWidth(playerRun.getKeyFrame(playerTime,false).getRegionWidth() * scaleFactor);
399 | player.setHeight(playerRun.getKeyFrame(playerTime,false).getRegionHeight()* scaleFactor);
400 | player.setBoundX((66.6f*scaleFactor) + player.bounds.width/2 + 20);
401 | batcher.draw(playerRun.getKeyFrame(playerTime,true),player.getX(),player.getY(),player.getWidth(),player.getHeight());
402 |
403 | }
404 | else if (state == Player.SPRINT && !player.isSlideDown())
405 | {
406 |
407 | player.setWidth(playerSprint.getKeyFrame(playerTime,false).getRegionWidth()* scaleFactor);
408 | player.setHeight(playerSprint.getKeyFrame(playerTime,false).getRegionHeight()* scaleFactor);
409 | player.setBoundX((66.6f*scaleFactor) + player.bounds.width/2 + 20);
410 | batcher.draw(playerSprint.getKeyFrame(playerTime,true),player.getX(),player.getY(),player.getWidth(),player.getHeight());
411 |
412 | }
413 | else if(state == Player.JUMP || state == Player.DEAD)
414 | {
415 | player.setWidth(playerJump.getRegionWidth()* scaleFactor);
416 | player.setHeight(playerJump.getRegionHeight() * scaleFactor);
417 | player.setBoundX((66.6f*scaleFactor) + player.bounds.width/2 + 20);
418 | batcher.draw(playerJump,player.getX(),player.getY(),player.getWidth(),player.getHeight());
419 | }
420 | else if((state == Player.RUN || state == Player.SPRINT) && player.isSlideDown())
421 | {
422 | player.setWidth(playerSlideDown.getKeyFrame(playerTime,false).getRegionWidth()* scaleFactor);
423 | player.setHeight(playerSlideDown.getKeyFrame(playerTime,false).getRegionHeight()* scaleFactor);
424 | player.setBoundY(world.getGround().y - player.getHeight() + (15 * scaleFactor ));
425 | player.setBoundX(player.getX() + player.getWidth() - player.bounds.width - 25);
426 | batcher.draw(playerSlideDown.getKeyFrame(playerTime,true),player.getX(),world.getGround().y - player.getHeight() + (15 * scaleFactor ),player.getWidth(),player.getHeight());
427 |
428 | }
429 |
430 |
431 | }
432 |
433 | private void drawStar()
434 | {
435 | if( timerStar1 >= 10f)
436 | {
437 | if(player.state != Player.IDLE)
438 | batcher.draw(star.getKeyFrame(player.stateTime,true),100,100,star.getKeyFrame(player.stateTime,false).getRegionWidth()* scaleFactor,star.getKeyFrame(player.stateTime,false).getRegionHeight()* scaleFactor);
439 |
440 | if(timerStar1 >= 15f)
441 | timerStar1 = 0;
442 | }
443 |
444 |
445 | if( timerStar2 >= 15f)
446 | {
447 | if(player.state != Player.IDLE)
448 | batcher.draw(star.getKeyFrame(player.stateTime,true),width/2 - 200,height/3 - 100 ,star.getKeyFrame(player.stateTime,false).getRegionWidth()* scaleFactor,star.getKeyFrame(player.stateTime,false).getRegionHeight()* scaleFactor);
449 |
450 | if(timerStar2 >= 20f)
451 | timerStar2 = 0;
452 | }
453 |
454 | if( timerStar3 >= 30f)
455 | {
456 | if(player.state != Player.IDLE)
457 | batcher.draw(star.getKeyFrame(player.stateTime,true),width - 100,50,star.getKeyFrame(player.stateTime,false).getRegionWidth()* scaleFactor,star.getKeyFrame(player.stateTime,false).getRegionHeight()* scaleFactor);
458 |
459 | if(timerStar3 >= 50f)
460 | timerStar3 = 0;
461 | }
462 |
463 | }
464 |
465 | private void drawUIScreen()
466 | {
467 | if(world.currentState == GameState.GAMEOVER)
468 | {
469 | batcher.draw(atlas.findRegion("play"), world.width/2 - (atlas.findRegion("play").getRegionWidth()*scaleFactor)/2, world.height/2 + 20,atlas.findRegion("play").getRegionWidth()*scaleFactor,atlas.findRegion("play").getRegionHeight()*scaleFactor);
470 | gameOverText.draw(batcher, "G A M E O V E R", world.width/2 - (gameoverwidth)/2,world.height/2 - (73.3f * scaleFactor));
471 | }
472 |
473 | scoreText.draw(batcher, String.format("%05d", score), world.width - (scorewidth - 10),6.6f * scaleFactor);
474 |
475 | if(lastscore != 0 && !isFirstime)
476 | hiscoreText.draw(batcher,"HI " + String.format("%05d", lastscore),world.width - scorewidth*2 - 23.3f * scaleFactor,6.6f * scaleFactor);
477 |
478 | if (player.state == Player.IDLE)
479 | {
480 | if(isFirstime)
481 | {
482 |
483 | batcher.draw(txtWrapper, 6.6f * scaleFactor, 6.6f * scaleFactor, txtWrapper.getWidth(), txtWrapper.getHeight());
484 | batcher.draw(txtWrapper, width - txtWrapper.getWidth() - 6.6f * scaleFactor, 6.6f * scaleFactor, txtWrapper.getWidth(), txtWrapper.getHeight());
485 |
486 | jumpText.draw(batcher, "Tap here to jump", world.width - world.width/4 - (jumpTextwidth)/2,world.height/2 - 10);
487 | boxText.draw(batcher, "Tap here to bow", world.width/4 - (jumpTextwidth)/2,world.height/2 - 10);
488 |
489 | }
490 | }
491 |
492 | }
493 |
494 | private void drawObstacles()
495 | {
496 | int rand = obtacle2.getType();
497 |
498 | if(rand != 6)
499 | {
500 | obtacle1.setWidth((int)(atlas.findRegion("gunungan/" + rand).getRegionWidth() * scaleFactor * 1.2f));
501 | obtacle1.setHeight((int)(atlas.findRegion("gunungan/" + rand).getRegionHeight() * scaleFactor * 1.2f));
502 | obtacle1.setY(world.getGround().y + (15*scaleFactor) - (int)(atlas.findRegion("gunungan/" + rand).getRegionHeight() * scaleFactor * 1.2f));
503 | batcher.draw(atlas.findRegion("gunungan/" + rand), obtacle1.getX(), obtacle1.getY(),obtacle1.getWidth(),obtacle1.getHeight());
504 | }
505 | else
506 | {
507 | obtacle1.setWidth(bird.getKeyFrame(player.stateTime,true).getRegionWidth() * scaleFactor * 0.8f );
508 | obtacle1.setHeight(bird.getKeyFrame(player.stateTime,true).getRegionHeight() * scaleFactor * 0.8f );
509 | obtacle1.setY(birdPos[obtacle1.getPostype()]);
510 | batcher.draw(bird.getKeyFrame(player.stateTime,true), obtacle1.getX(), obtacle1.getY(),obtacle1.getWidth(),obtacle1.getHeight());
511 | }
512 |
513 |
514 | rand = obtacle2.getType();
515 | if(rand != 6)
516 | {
517 | obtacle2.setWidth((int)(atlas.findRegion("gunungan/" + rand).getRegionWidth() * scaleFactor * 1.2f));
518 | obtacle2.setHeight((int)(atlas.findRegion("gunungan/" + rand).getRegionHeight() * scaleFactor * 1.2f));
519 | obtacle2.setY(world.getGround().y + (15*scaleFactor) - (int)(atlas.findRegion("gunungan/" + rand).getRegionHeight() * scaleFactor * 1.2f));
520 | batcher.draw(atlas.findRegion("gunungan/" + rand), obtacle2.getX(), obtacle2.getY(),obtacle2.getWidth(),obtacle2.getHeight());
521 | }
522 | else
523 | {
524 | obtacle2.setWidth(bird.getKeyFrame(player.stateTime,true).getRegionWidth() * scaleFactor * 0.8f );
525 | obtacle2.setHeight(bird.getKeyFrame(player.stateTime,true).getRegionHeight() * scaleFactor * 0.8f);
526 | obtacle2.setY(birdPos[obtacle2.getPostype()]);
527 | batcher.draw(bird.getKeyFrame(player.stateTime,true), obtacle2.getX(), obtacle2.getY(),obtacle2.getWidth(),obtacle2.getHeight());
528 | }
529 |
530 |
531 | rand = obtacle3.getType();
532 | if(rand != 6)
533 | {
534 | obtacle3.setWidth((int)(atlas.findRegion("gunungan/" + rand).getRegionWidth() * scaleFactor * 1.2f));
535 | obtacle3.setHeight((int)(atlas.findRegion("gunungan/" + rand).getRegionHeight() * scaleFactor * 1.2f));
536 | obtacle3.setY(world.getGround().y + (15*scaleFactor) - (int)(atlas.findRegion("gunungan/" + rand).getRegionHeight() * scaleFactor * 1.2f));
537 | batcher.draw(atlas.findRegion("gunungan/" + rand), obtacle3.getX(), obtacle3.getY(),obtacle3.getWidth(),obtacle3.getHeight());
538 | }
539 | else
540 | {
541 | obtacle3.setWidth(bird.getKeyFrame(player.stateTime,true).getRegionWidth() * scaleFactor * 0.8f );
542 | obtacle3.setHeight(bird.getKeyFrame(player.stateTime,true).getRegionHeight() * scaleFactor * 0.8f );
543 | obtacle3.setY(birdPos[obtacle3.getPostype()]);
544 | batcher.draw(bird.getKeyFrame(player.stateTime,true), obtacle3.getX(), obtacle3.getY(),obtacle3.getWidth(),obtacle3.getHeight());
545 | }
546 | }
547 |
548 | public int getScore() {
549 | return score;
550 | }
551 |
552 | public void setScore(int score) {
553 | this.score = score;
554 | }
555 |
556 | }
557 |
--------------------------------------------------------------------------------
/desktop/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "java"
2 |
3 | sourceCompatibility = 1.6
4 | sourceSets.main.java.srcDirs = [ "src/" ]
5 |
6 | project.ext.mainClassName = "com.yondev.gatot.run.desktop.DesktopLauncher"
7 | project.ext.assetsDir = new File("../android/assets");
8 |
9 | task run(dependsOn: classes, type: JavaExec) {
10 | main = project.mainClassName
11 | classpath = sourceSets.main.runtimeClasspath
12 | standardInput = System.in
13 | workingDir = project.assetsDir
14 | ignoreExitValue = true
15 | }
16 |
17 | task dist(type: Jar) {
18 | from files(sourceSets.main.output.classesDir)
19 | from files(sourceSets.main.output.resourcesDir)
20 | from {configurations.compile.collect {zipTree(it)}}
21 | from files(project.assetsDir);
22 |
23 | manifest {
24 | attributes 'Main-Class': project.mainClassName
25 | }
26 | }
27 |
28 | dist.dependsOn classes
29 |
30 | eclipse {
31 | project {
32 | name = appName + "-desktop"
33 | linkedResource name: 'assets', type: '2', location: 'PARENT-1-PROJECT_LOC/android/assets'
34 | }
35 | }
36 |
37 | task afterEclipseImport(description: "Post processing after project generation", group: "IDE") {
38 | doLast {
39 | def classpath = new XmlParser().parse(file(".classpath"))
40 | new Node(classpath, "classpathentry", [ kind: 'src', path: 'assets' ]);
41 | def writer = new FileWriter(file(".classpath"))
42 | def printer = new XmlNodePrinter(new PrintWriter(writer))
43 | printer.setPreserveWhitespace(true)
44 | printer.print(classpath)
45 | }
46 | }
--------------------------------------------------------------------------------
/desktop/src/com/yondev/gatot/run/desktop/DesktopLauncher.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.desktop;
2 |
3 | import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
4 | import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
5 | import com.yondev.gatot.run.GatotRun;
6 |
7 | public class DesktopLauncher {
8 | public static void main (String[] arg) {
9 | LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
10 | new LwjglApplication(new GatotRun(), config);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/featured.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/featured.png
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.daemon=true
2 | org.gradle.jvmargs=-Xms128m -Xmx512m
3 | org.gradle.configureondemand=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Sep 21 13:08:26 CEST 2013
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=http\://services.gradle.org/distributions/gradle-2.4-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/html/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "java"
2 | apply plugin: "jetty"
3 |
4 | gwt {
5 | gwtVersion='2.6.0' // Should match the gwt version used for building the gwt backend
6 | maxHeapSize="1G" // Default 256m is not enough for gwt compiler. GWT is HUNGRY
7 | minHeapSize="1G"
8 |
9 | src = files(file("src/")) // Needs to be in front of "modules" below.
10 | modules 'com.yondev.gatot.run.GdxDefinition'
11 | devModules 'com.yondev.gatot.run.GdxDefinitionSuperdev'
12 | project.webAppDirName = 'webapp'
13 |
14 | compiler {
15 | strict = true;
16 | enableClosureCompiler = true;
17 | disableCastChecking = true;
18 | }
19 | }
20 |
21 | task draftRun(type: JettyRunWar) {
22 | dependsOn draftWar
23 | dependsOn.remove('war')
24 | webApp=draftWar.archivePath
25 | daemon=true
26 | }
27 |
28 | task superDev(type: de.richsource.gradle.plugins.gwt.GwtSuperDev) {
29 | dependsOn draftRun
30 | doFirst {
31 | gwt.modules = gwt.devModules
32 | }
33 | }
34 |
35 | task dist(dependsOn: [clean, compileGwt]) {
36 | doLast {
37 | file("build/dist").mkdirs()
38 | copy {
39 | from "build/gwt/out"
40 | into "build/dist"
41 | }
42 | copy {
43 | from "webapp"
44 | into "build/dist"
45 | }
46 | copy {
47 | from "war"
48 | into "build/dist"
49 | }
50 | }
51 | }
52 |
53 | draftWar {
54 | from "war"
55 | }
56 |
57 | task addSource << {
58 | sourceSets.main.compileClasspath += files(project(':core').sourceSets.main.allJava.srcDirs)
59 | }
60 |
61 | tasks.compileGwt.dependsOn(addSource)
62 | tasks.draftCompileGwt.dependsOn(addSource)
63 |
64 | sourceCompatibility = 1.6
65 | sourceSets.main.java.srcDirs = [ "src/" ]
66 |
67 |
68 | eclipse.project {
69 | name = appName + "-html"
70 | }
71 |
--------------------------------------------------------------------------------
/html/src/com/yondev/gatot/run/GdxDefinition.gwt.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/html/src/com/yondev/gatot/run/GdxDefinitionSuperdev.gwt.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/html/src/com/yondev/gatot/run/client/HtmlLauncher.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run.client;
2 |
3 | import com.badlogic.gdx.ApplicationListener;
4 | import com.badlogic.gdx.backends.gwt.GwtApplication;
5 | import com.badlogic.gdx.backends.gwt.GwtApplicationConfiguration;
6 | import com.yondev.gatot.run.GatotRun;
7 |
8 | public class HtmlLauncher extends GwtApplication {
9 |
10 | @Override
11 | public GwtApplicationConfiguration getConfig () {
12 | return new GwtApplicationConfiguration(480, 320);
13 | }
14 |
15 | @Override
16 | public ApplicationListener getApplicationListener () {
17 | return new GatotRun();
18 | }
19 | }
--------------------------------------------------------------------------------
/html/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/html/webapp/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | GatotRun
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | ↻
13 |
14 |
15 |
16 |
17 |
32 |
33 |
--------------------------------------------------------------------------------
/html/webapp/refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/html/webapp/refresh.png
--------------------------------------------------------------------------------
/html/webapp/soundmanager2-jsmin.js:
--------------------------------------------------------------------------------
1 | /** @license
2 |
3 |
4 | SoundManager 2: JavaScript Sound for the Web
5 | ----------------------------------------------
6 | http://schillmania.com/projects/soundmanager2/
7 |
8 | Copyright (c) 2007, Scott Schiller. All rights reserved.
9 | Code provided under the BSD License:
10 | http://schillmania.com/projects/soundmanager2/license.txt
11 |
12 | V2.97a.20130512
13 | */
14 | (function(h,g){function fa(fa,wa){function ga(b){return c.preferFlash&&H&&!c.ignoreFlash&&c.flash[b]!==g&&c.flash[b]}function s(b){return function(d){var e=this._s;!e||!e._a?(e&&e.id?c._wD(e.id+": Ignoring "+d.type):c._wD(rb+"Ignoring "+d.type),d=null):d=b.call(this,d);return d}}this.setupOptions={url:fa||null,flashVersion:8,debugMode:!0,debugFlash:!1,useConsole:!0,consoleOnly:!0,waitForWindowLoad:!1,bgColor:"#ffffff",useHighPerformance:!1,flashPollingInterval:null,html5PollingInterval:null,flashLoadTimeout:1E3,
15 | wmode:null,allowScriptAccess:"always",useFlashBlock:!1,useHTML5Audio:!0,html5Test:/^(probably|maybe)$/i,preferFlash:!0,noSWFCache:!1,idPrefix:"sound"};this.defaultOptions={autoLoad:!1,autoPlay:!1,from:null,loops:1,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onposition:null,onstop:null,onfailure:null,onfinish:null,multiShot:!0,multiShotEvents:!1,position:null,pan:0,stream:!0,to:null,type:null,usePolicyFile:!1,volume:100};this.flash9Options={isMovieStar:null,
16 | usePeakData:!1,useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null};this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,duration:null};this.audioFormats={mp3:{type:['audio/mpeg; codecs\x3d"mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:!0},mp4:{related:["aac","m4a","m4b"],type:['audio/mp4; codecs\x3d"mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:!1},ogg:{type:["audio/ogg; codecs\x3dvorbis"],required:!1},
17 | opus:{type:["audio/ogg; codecs\x3dopus","audio/opus"],required:!1},wav:{type:['audio/wav; codecs\x3d"1"',"audio/wav","audio/wave","audio/x-wav"],required:!1}};this.movieID="sm2-container";this.id=wa||"sm2movie";this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.versionNumber="V2.97a.20130512";this.altURL=this.movieURL=this.version=null;this.enabled=this.swfLoaded=!1;this.oMC=null;this.sounds={};this.soundIDs=[];this.didFlashBlock=this.muted=!1;this.filePattern=null;this.filePatterns=
18 | {flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.features={buffering:!1,peakData:!1,waveformData:!1,eqData:!1,movieStar:!1};this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local+internet access)"},description:null,noRemote:null,noLocal:null};this.html5={usingFlash:null};this.flash={};this.ignoreFlash=this.html5Only=
19 | !1;var Ua,c=this,Va=null,k=null,rb="HTML5::",A,t=navigator.userAgent,U=h.location.href.toString(),m=document,xa,Wa,ya,n,F=[],za=!0,C,V=!1,W=!1,q=!1,y=!1,ha=!1,p,sb=0,X,B,Aa,O,Ba,M,P,Q,Xa,Ca,ia,I,ja,Da,R,Ea,Y,ka,la,S,Ya,Fa,Za=["log","info","warn","error"],$a,Ga,ab,Z=null,Ha=null,r,Ia,T,bb,ma,na,J,v,$=!1,Ja=!1,cb,db,eb,oa=0,aa=null,pa,N=[],qa,u=null,fb,ra,ba,K,sa,Ka,gb,w,hb=Array.prototype.slice,E=!1,La,H,Ma,ib,G,jb,Na,ta,kb=0,ca=t.match(/(ipad|iphone|ipod)/i),lb=t.match(/android/i),L=t.match(/msie/i),
20 | tb=t.match(/webkit/i),ua=t.match(/safari/i)&&!t.match(/chrome/i),Oa=t.match(/opera/i),ub=t.match(/firefox/i),Pa=t.match(/(mobile|pre\/|xoom)/i)||ca||lb,Qa=!U.match(/usehtml5audio/i)&&!U.match(/sm2\-ignorebadua/i)&&ua&&!t.match(/silk/i)&&t.match(/OS X 10_6_([3-7])/i),da=h.console!==g&&console.log!==g,Ra=m.hasFocus!==g?m.hasFocus():null,va=ua&&(m.hasFocus===g||!m.hasFocus()),mb=!va,nb=/(mp3|mp4|mpa|m4a|m4b)/i,ea=m.location?m.location.protocol.match(/http/i):null,ob=!ea?"http://":"",pb=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4||m4v|m4a|m4b|mp4v|3gp|3g2)\s*(?:$|;)/i,
21 | qb="mpeg4 aac flv mov mp4 m4v f4v m4a m4b mp4v 3gp 3g2".split(" "),vb=RegExp("\\.("+qb.join("|")+")(\\?.*)?$","i");this.mimePattern=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.useAltURL=!ea;var Sa;try{Sa=Audio!==g&&(Oa&&opera!==g&&10>opera.version()?new Audio(null):new Audio).canPlayType!==g}catch(wb){Sa=!1}this.hasHTML5=Sa;this.setup=function(b){var d=!c.url;b!==g&&(q&&u&&c.ok()&&(b.flashVersion!==g||b.url!==g||b.html5Test!==g))&&J(r("setupLate"));Aa(b);b&&(d&&(Y&&b.url!==g)&&c.beginDelayedInit(),
22 | !Y&&(b.url!==g&&"complete"===m.readyState)&&setTimeout(R,1));return c};this.supported=this.ok=function(){return u?q&&!y:c.useHTML5Audio&&c.hasHTML5};this.getMovie=function(c){return A(c)||m[c]||h[c]};this.createSound=function(b,d){function e(){f=ma(f);c.sounds[f.id]=new Ua(f);c.soundIDs.push(f.id);return c.sounds[f.id]}var a,f;a=null;a="soundManager.createSound(): "+r(!q?"notReady":"notOK");if(!q||!c.ok())return J(a),!1;d!==g&&(b={id:b,url:d});f=B(b);f.url=pa(f.url);void 0===f.id&&(f.id=c.setupOptions.idPrefix+
23 | kb++);f.id.toString().charAt(0).match(/^[0-9]$/)&&c._wD("soundManager.createSound(): "+r("badID",f.id),2);c._wD("soundManager.createSound(): "+f.id+(f.url?" ("+f.url+")":""),1);if(v(f.id,!0))return c._wD("soundManager.createSound(): "+f.id+" exists",1),c.sounds[f.id];if(ra(f))a=e(),c._wD(f.id+": Using HTML5"),a._setup_html5(f);else{if(c.html5Only)return c._wD(f.id+": No HTML5 support for this sound, and no Flash. Exiting."),e();if(c.html5.usingFlash&&f.url&&f.url.match(/data\:/i))return c._wD(f.id+
24 | ": data: URIs not supported via Flash. Exiting."),e();8a.instanceCount?(m(),e=a._setup_html5(),a.setPosition(a._iO.position),e.play()):(c._wD(a.id+": Cloning Audio() for instance #"+a.instanceCount+"..."),l=new Audio(a._iO.url),z=function(){w.remove(l,"onended",z);a._onfinish(a);sa(l);l=null},h=function(){w.remove(l,"canplay",h);try{l.currentTime=a._iO.position/1E3}catch(c){J(a.id+": multiShot play() failed to apply position of "+a._iO.position/1E3)}l.play()},w.add(l,"ended",z),a._iO.position?
45 | w.add(l,"canplay",h):l.play()):(x=k._start(a.id,a._iO.loops||1,9===n?a.position:a.position/1E3,a._iO.multiShot||!1),9===n&&!x&&(c._wD(e+"No sound hardware, or 32-sound ceiling hit",2),a._iO.onplayerror&&a._iO.onplayerror.apply(a)))}return a};this.stop=function(b){var d=a._iO;1===a.playState&&(c._wD(a.id+": stop()"),a._onbufferchange(0),a._resetOnPosition(0),a.paused=!1,a.isHTML5||(a.playState=0),Ta(),d.to&&a.clearOnPosition(d.to),a.isHTML5?a._a&&(b=a.position,a.setPosition(0),a.position=b,a._a.pause(),
46 | a.playState=0,a._onTimer(),l()):(k._stop(a.id,b),d.serverURL&&a.unload()),a.instanceCount=0,a._iO={},d.onstop&&d.onstop.apply(a));return a};this.setAutoPlay=function(b){c._wD(a.id+": Autoplay turned "+(b?"on":"off"));a._iO.autoPlay=b;a.isHTML5||(k._setAutoPlay(a.id,b),b&&(!a.instanceCount&&1===a.readyState)&&(a.instanceCount++,c._wD(a.id+": Incremented instance count to "+a.instanceCount)))};this.getAutoPlay=function(){return a._iO.autoPlay};this.setPosition=function(b){b===g&&(b=0);var d=a.isHTML5?
47 | Math.max(b,0):Math.min(a.duration||a._iO.duration,Math.max(b,0));a.position=d;b=a.position/1E3;a._resetOnPosition(a.position);a._iO.position=d;if(a.isHTML5){if(a._a){if(a._html5_canplay){if(a._a.currentTime!==b){c._wD(a.id+": setPosition("+b+")");try{a._a.currentTime=b,(0===a.playState||a.paused)&&a._a.pause()}catch(e){c._wD(a.id+": setPosition("+b+") failed: "+e.message,2)}}}else if(b)return c._wD(a.id+": setPosition("+b+"): Cannot seek yet, sound not ready",2),a;a.paused&&a._onTimer(!0)}}else b=
48 | 9===n?a.position:b,a.readyState&&2!==a.readyState&&k._setPosition(a.id,b,a.paused||!a.playState,a._iO.multiShot);return a};this.pause=function(b){if(a.paused||0===a.playState&&1!==a.readyState)return a;c._wD(a.id+": pause()");a.paused=!0;a.isHTML5?(a._setup_html5().pause(),l()):(b||b===g)&&k._pause(a.id,a._iO.multiShot);a._iO.onpause&&a._iO.onpause.apply(a);return a};this.resume=function(){var b=a._iO;if(!a.paused)return a;c._wD(a.id+": resume()");a.paused=!1;a.playState=1;a.isHTML5?(a._setup_html5().play(),
49 | m()):(b.isMovieStar&&!b.serverURL&&a.setPosition(a.position),k._pause(a.id,b.multiShot));!s&&b.onplay?(b.onplay.apply(a),s=!0):b.onresume&&b.onresume.apply(a);return a};this.togglePause=function(){c._wD(a.id+": togglePause()");if(0===a.playState)return a.play({position:9===n&&!a.isHTML5?a.position:a.position/1E3}),a;a.paused?a.resume():a.pause();return a};this.setPan=function(b,c){b===g&&(b=0);c===g&&(c=!1);a.isHTML5||k._setPan(a.id,b);a._iO.pan=b;c||(a.pan=b,a.options.pan=b);return a};this.setVolume=
50 | function(b,d){b===g&&(b=100);d===g&&(d=!1);a.isHTML5?a._a&&(a._a.volume=Math.max(0,Math.min(1,b/100))):k._setVolume(a.id,c.muted&&!a.muted||a.muted?0:b);a._iO.volume=b;d||(a.volume=b,a.options.volume=b);return a};this.mute=function(){a.muted=!0;a.isHTML5?a._a&&(a._a.muted=!0):k._setVolume(a.id,0);return a};this.unmute=function(){a.muted=!1;var b=a._iO.volume!==g;a.isHTML5?a._a&&(a._a.muted=!1):k._setVolume(a.id,b?a._iO.volume:a.options.volume);return a};this.toggleMute=function(){return a.muted?a.unmute():
51 | a.mute()};this.onposition=this.onPosition=function(b,c,d){D.push({position:parseInt(b,10),method:c,scope:d!==g?d:a,fired:!1});return a};this.clearOnPosition=function(a,b){var c;a=parseInt(a,10);if(isNaN(a))return!1;for(c=0;c=b)return!1;for(b-=1;0<=b;b--)c=D[b],!c.fired&&a.position>=c.position&&(c.fired=!0,t++,c.method.apply(c.scope,[c.position]));
52 | return!0};this._resetOnPosition=function(a){var b,c;b=D.length;if(!b)return!1;for(b-=1;0<=b;b--)c=D[b],c.fired&&a<=c.position&&(c.fired=!1,t--);return!0};y=function(){var b=a._iO,d=b.from,e=b.to,f,g;g=function(){c._wD(a.id+': "To" time of '+e+" reached.");a.clearOnPosition(e,g);a.stop()};f=function(){c._wD(a.id+': Playing "from" '+d);if(null!==e&&!isNaN(e))a.onPosition(e,g)};null!==d&&!isNaN(d)&&(b.position=d,b.multiShot=!1,f());return b};q=function(){var b,c=a._iO.onposition;if(c)for(b in c)if(c.hasOwnProperty(b))a.onPosition(parseInt(b,
53 | 10),c[b])};Ta=function(){var b,c=a._iO.onposition;if(c)for(b in c)c.hasOwnProperty(b)&&a.clearOnPosition(parseInt(b,10))};m=function(){a.isHTML5&&cb(a)};l=function(){a.isHTML5&&db(a)};f=function(b){b||(D=[],t=0);s=!1;a._hasTimer=null;a._a=null;a._html5_canplay=!1;a.bytesLoaded=null;a.bytesTotal=null;a.duration=a._iO&&a._iO.duration?a._iO.duration:null;a.durationEstimate=null;a.buffered=[];a.eqData=[];a.eqData.left=[];a.eqData.right=[];a.failures=0;a.isBuffering=!1;a.instanceOptions={};a.instanceCount=
54 | 0;a.loaded=!1;a.metadata={};a.readyState=0;a.muted=!1;a.paused=!1;a.peakData={left:0,right:0};a.waveformData={left:[],right:[]};a.playState=0;a.position=null;a.id3={}};f();this._onTimer=function(b){var c,f=!1,g={};if(a._hasTimer||b){if(a._a&&(b||(0opera.version()?new Audio(null):new Audio,c=a._a,c._called_load=!1,E&&(Va=c);a.isHTML5=!0;a._a=c;c._s=a;h();a._apply_loop(c,b.loops);b.autoLoad||b.autoPlay?a.load():(c.autobuffer=!1,c.preload="auto");return c};h=function(){if(a._a._added_events)return!1;var b;a._a._added_events=!0;for(b in G)G.hasOwnProperty(b)&&a._a&&a._a.addEventListener(b,G[b],!1);return!0};z=function(){var b;c._wD(a.id+": Removing event listeners");
57 | a._a._added_events=!1;for(b in G)G.hasOwnProperty(b)&&a._a&&a._a.removeEventListener(b,G[b],!1)};this._onload=function(b){var d=!!b||!a.isHTML5&&8===n&&a.duration;b=a.id+": ";c._wD(b+(d?"onload()":"Failed to load / invalid sound?"+(!a.duration?" Zero-length duration reported.":" -")+" ("+a.url+")"),d?1:2);!d&&!a.isHTML5&&(!0===c.sandbox.noRemote&&c._wD(b+r("noNet"),1),!0===c.sandbox.noLocal&&c._wD(b+r("noLocal"),1));a.loaded=d;a.readyState=d?3:2;a._onbufferchange(0);a._iO.onload&&ta(a,function(){a._iO.onload.apply(a,
58 | [d])});return!0};this._onbufferchange=function(b){if(0===a.playState||b&&a.isBuffering||!b&&!a.isBuffering)return!1;a.isBuffering=1===b;a._iO.onbufferchange&&(c._wD(a.id+": Buffer state change: "+b),a._iO.onbufferchange.apply(a));return!0};this._onsuspend=function(){a._iO.onsuspend&&(c._wD(a.id+": Playback suspended"),a._iO.onsuspend.apply(a));return!0};this._onfailure=function(b,d,e){a.failures++;c._wD(a.id+": Failures \x3d "+a.failures);if(a._iO.onfailure&&1===a.failures)a._iO.onfailure(a,b,d,e);
59 | else c._wD(a.id+": Ignoring failure")};this._onfinish=function(){var b=a._iO.onfinish;a._onbufferchange(0);a._resetOnPosition(0);if(a.instanceCount&&(a.instanceCount--,a.instanceCount||(Ta(),a.playState=0,a.paused=!1,a.instanceCount=0,a.instanceOptions={},a._iO={},l(),a.isHTML5&&(a.position=0)),(!a.instanceCount||a._iO.multiShotEvents)&&b))c._wD(a.id+": onfinish()"),ta(a,function(){b.apply(a)})};this._whileloading=function(b,c,d,e){var f=a._iO;a.bytesLoaded=b;a.bytesTotal=c;a.duration=Math.floor(d);
60 | a.bufferLength=e;a.durationEstimate=!a.isHTML5&&!f.isMovieStar?f.duration?a.duration>f.duration?a.duration:f.duration:parseInt(a.bytesTotal/a.bytesLoaded*a.duration,10):a.duration;a.isHTML5||(a.buffered=[{start:0,end:a.duration}]);(3!==a.readyState||a.isHTML5)&&f.whileloading&&f.whileloading.apply(a)};this._whileplaying=function(b,c,d,e,f){var l=a._iO;if(isNaN(b)||null===b)return!1;a.position=Math.max(0,b);a._processOnPosition();!a.isHTML5&&8opera.version()?new Audio(null):new Audio:null,e,a,f={},h;h=c.audioFormats;for(e in h)if(h.hasOwnProperty(e)&&(a="audio/"+e,f[e]=b(h[e].type),f[a]=f[e],e.match(nb)?(c.flash[e]=!0,c.flash[a]=!0):(c.flash[e]=!1,c.flash[a]=!1),h[e]&&h[e].related))for(a=h[e].related.length-
74 | 1;0<=a;a--)f["audio/"+h[e].related[a]]=f[e],c.html5[h[e].related[a]]=f[e],c.flash[h[e].related[a]]=f[e];f.canPlayType=d?b:null;c.html5=B(c.html5,f);c.html5.usingFlash=fb();u=c.html5.usingFlash;return!0};I={notReady:"Unavailable - wait until onready() has fired.",notOK:"Audio support is not available.",domError:"soundManagerexception caught while appending SWF to DOM.",spcWmode:"Removing wmode, preventing known SWF loading issue(s)",swf404:"soundManager: Verify that %s is a valid path.",tryDebug:"Try soundManager.debugFlash \x3d true for more security details (output goes to SWF.)",
75 | checkSWF:"See SWF output for more debug info.",localFail:"soundManager: Non-HTTP page ("+m.location.protocol+" URL?) Review Flash player security settings for this special case:\nhttp://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html\nMay need to add/allow path, eg. c:/sm2/ or /users/me/sm2/",waitFocus:"soundManager: Special case: Waiting for SWF to load with window focus...",waitForever:"soundManager: Waiting indefinitely for Flash (will recover if unblocked)...",
76 | waitSWF:"soundManager: Waiting for 100% SWF load...",needFunction:"soundManager: Function object expected for %s",badID:'Sound ID "%s" should be a string, starting with a non-numeric character',currentObj:"soundManager: _debug(): Current sound objects",waitOnload:"soundManager: Waiting for window.onload()",docLoaded:"soundManager: Document already loaded",onload:"soundManager: initComplete(): calling soundManager.onload()",onloadOK:"soundManager.onload() complete",didInit:"soundManager: init(): Already called?",
77 | secNote:"Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html",badRemove:"soundManager: Failed to remove Flash node.",shutdown:"soundManager.disable(): Shutting down",queue:"soundManager: Queueing %s handler",smError:"SMSound.load(): Exception: JS-Flash communication failed, or JS error.",fbTimeout:"No flash response, applying .swf_timedout CSS...",
78 | fbLoaded:"Flash loaded",fbHandler:"soundManager: flashBlockHandler()",manURL:"SMSound.load(): Using manually-assigned URL",onURL:"soundManager.load(): current URL already assigned.",badFV:'soundManager.flashVersion must be 8 or 9. "%s" is invalid. Reverting to %s.',as2loop:"Note: Setting stream:false so looping can work (flash 8 limitation)",noNSLoop:"Note: Looping not implemented for MovieStar formats",needfl9:"Note: Switching to flash 9, required for MP4 formats.",mfTimeout:"Setting flashLoadTimeout \x3d 0 (infinite) for off-screen, mobile flash case",
79 | needFlash:"soundManager: Fatal error: Flash is needed to play some required formats, but is not available.",gotFocus:"soundManager: Got window focus.",policy:"Enabling usePolicyFile for data access",setup:"soundManager.setup(): allowed parameters: %s",setupError:'soundManager.setup(): "%s" cannot be assigned with this method.',setupUndef:'soundManager.setup(): Could not find option "%s"',setupLate:"soundManager.setup(): url, flashVersion and html5Test property changes will not take effect until reboot().",
80 | noURL:"soundManager: Flash URL required. Call soundManager.setup({url:...}) to get started.",sm2Loaded:"SoundManager 2: Ready.",reset:"soundManager.reset(): Removing event callbacks",mobileUA:"Mobile UA detected, preferring HTML5 by default.",globalHTML5:"Using singleton HTML5 Audio() pattern for this device."};r=function(){var b=hb.call(arguments),c=b.shift(),c=I&&I[c]?I[c]:"",e,a;if(c&&b&&b.length){e=0;for(a=b.length;en)&&(c._wD(r("needfl9")),c.flashVersion=n=9);c.version=c.versionNumber+(c.html5Only?" (HTML5-only mode)":
83 | 9===n?" (AS3/Flash 9)":" (AS2/Flash 8)");8b&&(d=
102 | !0));setTimeout(function(){b=c.getMoviePercent();if(d)return $=!1,c._wD(r("waitSWF")),h.setTimeout(Q,1),!1;q||(c._wD("soundManager: No Flash response within expected time. Likely causes: "+(0===b?"SWF load failed, ":"")+"Flash blocked or JS-Flash security error."+(c.debugFlash?" "+r("checkSWF"):""),2),!ea&&b&&(p("localFail",2),c.debugFlash||p("tryDebug",2)),0===b&&c._wD(r("swf404",c.url),1),C("flashtojs",!1,": Timed out"+ea?" (Check flash security or flash blockers)":" (No plugin/missing SWF?)"));
103 | !q&&mb&&(null===b?c.useFlashBlock||0===c.flashLoadTimeout?(c.useFlashBlock&&Ia(),p("waitForever")):!c.useFlashBlock&&qa?h.setTimeout(function(){J("soundManager: useFlashBlock is false, 100% HTML5 mode is possible. Rebooting with preferFlash: false...");c.setup({preferFlash:!1}).reboot();c.didFlashBlock=!0;c.beginDelayedInit()},1):(p("waitForever"),M({type:"ontimeout",ignoreInit:!0})):0===c.flashLoadTimeout?p("waitForever"):Ga(!0))},c.flashLoadTimeout)};ia=function(){if(Ra||!va)return w.remove(h,"focus",
104 | ia),!0;Ra=mb=!0;p("gotFocus");$=!1;Q();w.remove(h,"focus",ia);return!0};Na=function(){N.length&&(c._wD("SoundManager 2: "+N.join(" "),1),N=[])};jb=function(){Na();var b,d=[];if(c.useHTML5Audio&&c.hasHTML5){for(b in c.audioFormats)c.audioFormats.hasOwnProperty(b)&&d.push(b+" \x3d "+c.html5[b]+(!c.html5[b]&&u&&c.flash[b]?" (using flash)":c.preferFlash&&c.flash[b]&&u?" (preferring flash)":!c.html5[b]?" ("+(c.audioFormats[b].required?"required, ":"")+"and no flash support)":""));c._wD("SoundManager 2 HTML5 support: "+
105 | d.join(", "),1)}};X=function(b){if(q)return!1;if(c.html5Only)return p("sm2Loaded"),q=!0,P(),C("onload",!0),!0;var d=!0,e;if(!c.useFlashBlock||!c.flashLoadTimeout||c.getMoviePercent())q=!0,y&&(e={type:!H&&u?"NO_FLASH":"INIT_TIMEOUT"});c._wD("SoundManager 2 "+(y?"failed to load":"loaded")+" ("+(y?"Flash security/load error":"OK")+")",y?2:1);y||b?(c.useFlashBlock&&c.oMC&&(c.oMC.className=T()+" "+(null===c.getMoviePercent()?"swf_timedout":"swf_error")),M({type:"ontimeout",error:e,ignoreInit:!0}),C("onload",
106 | !1),S(e),d=!1):C("onload",!0);y||(c.waitForWindowLoad&&!ha?(p("waitOnload"),w.add(h,"load",P)):(c.waitForWindowLoad&&ha&&p("docLoaded"),P()));return d};Wa=function(){var b,d=c.setupOptions;for(b in d)d.hasOwnProperty(b)&&(c[b]===g?c[b]=d[b]:c[b]!==d[b]&&(c.setupOptions[b]=c[b]))};ya=function(){if(q)return p("didInit"),!1;if(c.html5Only)return q||(w.remove(h,"load",c.beginDelayedInit),c.enabled=!0,X()),!0;ja();try{k._externalInterfaceTest(!1),Ya(!0,c.flashPollingInterval||(c.useHighPerformance?10:
107 | 50)),c.debugMode||k._disableDebug(),c.enabled=!0,C("jstoflash",!0),c.html5Only||w.add(h,"unload",xa)}catch(b){return c._wD("js/flash exception: "+b.toString()),C("jstoflash",!1),S({type:"JS_TO_FLASH_EXCEPTION",fatal:!0}),Ga(!0),X(),!1}X();w.remove(h,"load",c.beginDelayedInit);return!0};R=function(){if(Y)return!1;Y=!0;Wa();Fa();var b=null,b=null,d=U.toLowerCase();-1!==d.indexOf("sm2-usehtml5audio\x3d")&&(b="1"===d.charAt(d.indexOf("sm2-usehtml5audio\x3d")+18),da&&console.log((b?"Enabling ":"Disabling ")+
108 | "useHTML5Audio via URL parameter"),c.setup({useHTML5Audio:b}));-1!==d.indexOf("sm2-preferflash\x3d")&&(b="1"===d.charAt(d.indexOf("sm2-preferflash\x3d")+16),da&&console.log((b?"Enabling ":"Disabling ")+"preferFlash via URL parameter"),c.setup({preferFlash:b}));!H&&c.hasHTML5&&(c._wD("SoundManager: No Flash detected"+(!c.useHTML5Audio?", enabling HTML5.":". Trying HTML5-only mode."),1),c.setup({useHTML5Audio:!0,preferFlash:!1}));gb();!H&&u&&(N.push(I.needFlash),c.setup({flashLoadTimeout:1}));m.removeEventListener&&
109 | m.removeEventListener("DOMContentLoaded",R,!1);ja();return!0};Ka=function(){"complete"===m.readyState&&(R(),m.detachEvent("onreadystatechange",Ka));return!0};Ea=function(){ha=!0;w.remove(h,"load",Ea)};Da=function(){if(Pa&&((!c.setupOptions.useHTML5Audio||c.setupOptions.preferFlash)&&N.push(I.mobileUA),c.setupOptions.useHTML5Audio=!0,c.setupOptions.preferFlash=!1,ca||lb&&!t.match(/android\s2\.3/i)))N.push(I.globalHTML5),ca&&(c.ignoreFlash=!0),E=!0};Da();Ma();w.add(h,"focus",ia);w.add(h,"load",Q);w.add(h,
110 | "load",Ea);m.addEventListener?m.addEventListener("DOMContentLoaded",R,!1):m.attachEvent?m.attachEvent("onreadystatechange",Ka):(C("onload",!1),S({type:"NO_DOM2_EVENTS",fatal:!0}))}var wa=null;if(void 0===h.SM2_DEFER||!SM2_DEFER)wa=new fa;h.SoundManager=fa;h.soundManager=wa})(window);
--------------------------------------------------------------------------------
/html/webapp/soundmanager2-setup.js:
--------------------------------------------------------------------------------
1 | window.SM2_DEFER = true;
--------------------------------------------------------------------------------
/html/webapp/styles.css:
--------------------------------------------------------------------------------
1 | canvas {
2 | cursor: default;
3 | outline: none;
4 | }
5 |
6 | body {
7 | background-color: #222222;
8 | }
9 |
10 | .superdev {
11 | color: rgb(37,37,37);
12 | text-shadow: 0px 1px 1px rgba(250,250,250,0.1);
13 | font-size: 50pt;
14 | display: block;
15 | position: relative;
16 | text-decoration: none;
17 | background-color: rgb(83,87,93);
18 | box-shadow: 0px 3px 0px 0px rgb(34,34,34),
19 | 0px 7px 10px 0px rgb(17,17,17),
20 | inset 0px 1px 1px 0px rgba(250, 250, 250, .2),
21 | inset 0px -12px 35px 0px rgba(0, 0, 0, .5);
22 | width: 70px;
23 | height: 70px;
24 | border: 0;
25 | border-radius: 35px;
26 | text-align: center;
27 | line-height: 68px;
28 | }
29 |
30 | .superdev:active {
31 | box-shadow: 0px 0px 0px 0px rgb(34,34,34),
32 | 0px 3px 7px 0px rgb(17,17,17),
33 | inset 0px 1px 1px 0px rgba(250, 250, 250, .2),
34 | inset 0px -10px 35px 5px rgba(0, 0, 0, .5);
35 | background-color: rgb(83,87,93);
36 | top: 3px;
37 | color: #fff;
38 | text-shadow: 0px 0px 3px rgb(250,250,250);
39 | }
40 |
41 | .superdev:hover {
42 | background-color: rgb(100,100,100);
43 | }
44 |
--------------------------------------------------------------------------------
/ios/Info.plist.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${app.name}
9 | CFBundleExecutable
10 | ${app.executable}
11 | CFBundleIdentifier
12 | ${app.id}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${app.name}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | ${app.version}
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | ${app.build}
25 | LSRequiresIPhoneOS
26 |
27 | UIViewControllerBasedStatusBarAppearance
28 |
29 | UIStatusBarHidden
30 |
31 | UIDeviceFamily
32 |
33 | 1
34 | 2
35 |
36 | UIRequiredDeviceCapabilities
37 |
38 | armv7
39 | opengles-2
40 |
41 | UISupportedInterfaceOrientations
42 |
43 | UIInterfaceOrientationPortrait
44 | UIInterfaceOrientationLandscapeLeft
45 | UIInterfaceOrientationLandscapeRight
46 |
47 | CFBundleIcons
48 |
49 | CFBundlePrimaryIcon
50 |
51 | CFBundleIconFiles
52 |
53 | Icon
54 | Icon-72
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/ios/build.gradle:
--------------------------------------------------------------------------------
1 | sourceSets.main.java.srcDirs = [ "src/" ]
2 |
3 | sourceCompatibility = '1.7'
4 | [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
5 |
6 | ext {
7 | mainClassName = "com.yondev.gatot.run.IOSLauncher"
8 | }
9 |
10 | launchIPhoneSimulator.dependsOn build
11 | launchIPadSimulator.dependsOn build
12 | launchIOSDevice.dependsOn build
13 | createIPA.dependsOn build
14 |
15 |
16 | eclipse.project {
17 | name = appName + "-ios"
18 | natures 'org.robovm.eclipse.RoboVMNature'
19 | }
--------------------------------------------------------------------------------
/ios/data/Default-375w-667h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/ios/data/Default-375w-667h@2x.png
--------------------------------------------------------------------------------
/ios/data/Default-414w-736h@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/ios/data/Default-414w-736h@3x.png
--------------------------------------------------------------------------------
/ios/data/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/ios/data/Default-568h@2x.png
--------------------------------------------------------------------------------
/ios/data/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/ios/data/Default.png
--------------------------------------------------------------------------------
/ios/data/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/ios/data/Default@2x.png
--------------------------------------------------------------------------------
/ios/data/Default@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/ios/data/Default@2x~ipad.png
--------------------------------------------------------------------------------
/ios/data/Default~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/ios/data/Default~ipad.png
--------------------------------------------------------------------------------
/ios/data/Icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/ios/data/Icon-72.png
--------------------------------------------------------------------------------
/ios/data/Icon-72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/ios/data/Icon-72@2x.png
--------------------------------------------------------------------------------
/ios/data/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/ios/data/Icon.png
--------------------------------------------------------------------------------
/ios/data/Icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trionoputra/android-endless-running-game/2af67326f7062fa0014cf495a37c0f75efca31d9/ios/data/Icon@2x.png
--------------------------------------------------------------------------------
/ios/robovm.properties:
--------------------------------------------------------------------------------
1 | app.version=1.0
2 | app.id=com.yondev.gatot.run.IOSLauncher
3 | app.mainclass=com.yondev.gatot.run.IOSLauncher
4 | app.executable=IOSLauncher
5 | app.build=1
6 | app.name=GatotRun
7 |
--------------------------------------------------------------------------------
/ios/robovm.xml:
--------------------------------------------------------------------------------
1 |
2 | ${app.executable}
3 | ${app.mainclass}
4 | ios
5 | thumbv7
6 | ios
7 | Info.plist.xml
8 |
9 |
10 | ../android/assets
11 |
12 | **
13 |
14 | true
15 |
16 |
17 | data
18 |
19 |
20 |
21 | com.badlogic.gdx.scenes.scene2d.ui.*
22 | com.badlogic.gdx.physics.bullet.**
23 | com.badlogic.gdx.graphics.g3d.particles.**
24 | com.android.okhttp.HttpHandler
25 | com.android.okhttp.HttpsHandler
26 | com.android.org.conscrypt.**
27 | com.android.org.bouncycastle.jce.provider.BouncyCastleProvider
28 | com.android.org.bouncycastle.jcajce.provider.keystore.BC$Mappings
29 | com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi
30 | com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi$Std
31 | com.android.org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi
32 | com.android.org.bouncycastle.crypto.digests.AndroidDigestFactoryOpenSSL
33 | org.apache.harmony.security.provider.cert.DRLCertFactory
34 | org.apache.harmony.security.provider.crypto.CryptoProvider
35 |
36 |
37 | z
38 |
39 |
40 | UIKit
41 | OpenGLES
42 | QuartzCore
43 | CoreGraphics
44 | OpenAL
45 | AudioToolbox
46 | AVFoundation
47 |
48 |
49 |
--------------------------------------------------------------------------------
/ios/src/com/yondev/gatot/run/IOSLauncher.java:
--------------------------------------------------------------------------------
1 | package com.yondev.gatot.run;
2 |
3 | import org.robovm.apple.foundation.NSAutoreleasePool;
4 | import org.robovm.apple.uikit.UIApplication;
5 |
6 | import com.badlogic.gdx.backends.iosrobovm.IOSApplication;
7 | import com.badlogic.gdx.backends.iosrobovm.IOSApplicationConfiguration;
8 | import com.yondev.gatot.run.GatotRun;
9 |
10 | public class IOSLauncher extends IOSApplication.Delegate {
11 | @Override
12 | protected IOSApplication createApplication() {
13 | IOSApplicationConfiguration config = new IOSApplicationConfiguration();
14 | return new IOSApplication(new GatotRun(), config);
15 | }
16 |
17 | public static void main(String[] argv) {
18 | NSAutoreleasePool pool = new NSAutoreleasePool();
19 | UIApplication.main(argv, null, IOSLauncher.class);
20 | pool.close();
21 | }
22 | }
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include 'desktop', 'android', 'ios', 'html', 'core'
--------------------------------------------------------------------------------