├── .gitignore ├── Android ├── AndroidManifest.xml ├── assets │ ├── Check_32x32.png │ ├── Logo.png │ ├── Positive_256x256.png │ ├── Undo_32x32.png │ ├── animals │ │ ├── Butterfly_128x128.png │ │ ├── Dolphin_128x128.png │ │ ├── Elephant_128x128.png │ │ ├── Hippopotamus_128x128.png │ │ ├── Panda_128x128.png │ │ └── Turtle_128x128.png │ ├── background.jpg │ ├── berlin.hiero │ ├── berlin_42.fnt │ ├── berlin_42.png │ ├── berlin_64.fnt │ ├── berlin_641.png │ ├── berlin_642.png │ ├── berlin_643.png │ ├── card-back-mark.png │ ├── card-back.png │ ├── card-front.png │ ├── ding.ogg │ ├── drums.ogg │ ├── fire.png │ ├── fireworks │ ├── flipcard.ogg │ ├── gradient_oben.png │ ├── gradient_unten.png │ ├── grey.png │ ├── vacation │ │ ├── surfboard_256x256.png │ │ └── umbrella_256x256.png │ └── vehicles.png ├── build.gradle ├── ic_launcher-web.png ├── libs │ ├── arm64-v8a │ │ └── libgdx.so │ └── x86_64 │ │ └── libgdx.so ├── proguard-project.txt ├── project.properties ├── res │ ├── drawable-hdpi │ │ └── ic_launcher.png │ ├── drawable-ldpi │ │ └── ic_launcher.png │ ├── drawable-mdpi │ │ └── ic_launcher.png │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ ├── layout │ │ └── main.xml │ └── values │ │ ├── strings.xml │ │ └── styles.xml └── src │ └── at │ └── juggle │ └── games │ └── memory │ └── AndroidLauncher.java ├── Desktop ├── build.gradle └── src │ └── at │ └── juggle │ └── games │ └── memory │ └── desktop │ └── DesktopLauncher.java ├── LICENSE.txt ├── README.md ├── build.gradle ├── core ├── build.gradle └── src │ ├── MemoryGame.gwt.xml │ └── at │ └── juggle │ └── games │ └── memory │ ├── AbstractScreen.java │ ├── AssetManager.java │ ├── CreditsScreen.java │ ├── GameOptions.java │ ├── GameScreen.java │ ├── MemoryGame.java │ └── MenuScreen.java ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── html ├── build.gradle ├── src │ └── at │ │ └── juggle │ │ └── games │ │ └── memory │ │ ├── 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 │ └── at │ └── juggle │ └── games │ └── memory │ └── IOSLauncher.java ├── media ├── Logo.png ├── Logo.psd ├── Logo_512.png ├── card.psd ├── new-logo.png └── new-logo.psd └── 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 | -------------------------------------------------------------------------------- /Android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 14 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Android/assets/Check_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/Check_32x32.png -------------------------------------------------------------------------------- /Android/assets/Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/Logo.png -------------------------------------------------------------------------------- /Android/assets/Positive_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/Positive_256x256.png -------------------------------------------------------------------------------- /Android/assets/Undo_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/Undo_32x32.png -------------------------------------------------------------------------------- /Android/assets/animals/Butterfly_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/animals/Butterfly_128x128.png -------------------------------------------------------------------------------- /Android/assets/animals/Dolphin_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/animals/Dolphin_128x128.png -------------------------------------------------------------------------------- /Android/assets/animals/Elephant_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/animals/Elephant_128x128.png -------------------------------------------------------------------------------- /Android/assets/animals/Hippopotamus_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/animals/Hippopotamus_128x128.png -------------------------------------------------------------------------------- /Android/assets/animals/Panda_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/animals/Panda_128x128.png -------------------------------------------------------------------------------- /Android/assets/animals/Turtle_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/animals/Turtle_128x128.png -------------------------------------------------------------------------------- /Android/assets/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/background.jpg -------------------------------------------------------------------------------- /Android/assets/berlin.hiero: -------------------------------------------------------------------------------- 1 | font.size=42 2 | font.bold=true 3 | font.italic=false 4 | 5 | pad.top=0 6 | pad.right=1 7 | pad.bottom=0 8 | pad.left=1 9 | pad.advance.x=0 10 | pad.advance.y=0 11 | 12 | glyph.native.rendering=false 13 | glyph.page.width=512 14 | glyph.page.height=512 15 | 16 | effect.class=com.badlogic.gdx.hiero.unicodefont.effects.ColorEffect 17 | effect.Color=ffffff 18 | 19 | effect.class=com.badlogic.gdx.hiero.unicodefont.effects.ShadowEffect 20 | effect.Color=0000ff 21 | effect.Opacity=0.7 22 | effect.X distance=0.1 23 | effect.Y distance=2.0 24 | effect.Blur kernel size=0 25 | effect.Blur passes=1 26 | 27 | -------------------------------------------------------------------------------- /Android/assets/berlin_42.fnt: -------------------------------------------------------------------------------- 1 | info face="Berlin Sans FB Bold" size=42 bold=1 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 2 | common lineHeight=53 base=39 scaleW=512 scaleH=512 pages=1 packed=0 3 | page id=0 file="berlin_42.png" 4 | chars count=95 5 | char id=32 x=0 y=0 width=0 height=0 xoffset=0 yoffset=39 xadvance=13 page=0 chnl=0 6 | char id=125 x=0 y=0 width=19 height=40 xoffset=0 yoffset=8 xadvance=20 page=0 chnl=0 7 | char id=123 x=19 y=0 width=19 height=40 xoffset=0 yoffset=8 xadvance=20 page=0 chnl=0 8 | char id=93 x=38 y=0 width=18 height=40 xoffset=0 yoffset=9 xadvance=21 page=0 chnl=0 9 | char id=91 x=56 y=0 width=18 height=40 xoffset=3 yoffset=9 xadvance=21 page=0 chnl=0 10 | char id=41 x=74 y=0 width=20 height=40 xoffset=0 yoffset=9 xadvance=21 page=0 chnl=0 11 | char id=40 x=94 y=0 width=20 height=40 xoffset=1 yoffset=9 xadvance=21 page=0 chnl=0 12 | char id=74 x=114 y=0 width=19 height=38 xoffset=-1 yoffset=9 xadvance=19 page=0 chnl=0 13 | char id=106 x=133 y=0 width=17 height=37 xoffset=-1 yoffset=8 xadvance=16 page=0 chnl=0 14 | char id=81 x=150 y=0 width=35 height=37 xoffset=0 yoffset=8 xadvance=35 page=0 chnl=0 15 | char id=127 x=185 y=0 width=19 height=35 xoffset=2 yoffset=5 xadvance=23 page=0 chnl=0 16 | char id=92 x=204 y=0 width=17 height=35 xoffset=0 yoffset=8 xadvance=18 page=0 chnl=0 17 | char id=47 x=221 y=0 width=17 height=35 xoffset=0 yoffset=8 xadvance=18 page=0 chnl=0 18 | char id=124 x=238 y=0 width=11 height=34 xoffset=3 yoffset=8 xadvance=18 page=0 chnl=0 19 | char id=100 x=249 y=0 width=27 height=34 xoffset=0 yoffset=7 xadvance=28 page=0 chnl=0 20 | char id=98 x=276 y=0 width=28 height=34 xoffset=0 yoffset=7 xadvance=28 page=0 chnl=0 21 | char id=35 x=304 y=0 width=31 height=33 xoffset=1 yoffset=9 xadvance=33 page=0 chnl=0 22 | char id=36 x=335 y=0 width=23 height=33 xoffset=1 yoffset=10 xadvance=25 page=0 chnl=0 23 | char id=64 x=358 y=0 width=33 height=33 xoffset=0 yoffset=8 xadvance=34 page=0 chnl=0 24 | char id=107 x=391 y=0 width=27 height=33 xoffset=1 yoffset=8 xadvance=29 page=0 chnl=0 25 | char id=104 x=418 y=0 width=27 height=33 xoffset=0 yoffset=8 xadvance=28 page=0 chnl=0 26 | char id=102 x=445 y=0 width=19 height=33 xoffset=0 yoffset=8 xadvance=19 page=0 chnl=0 27 | char id=83 x=464 y=0 width=21 height=33 xoffset=-1 yoffset=9 xadvance=22 page=0 chnl=0 28 | char id=79 x=0 y=40 width=35 height=33 xoffset=0 yoffset=8 xadvance=35 page=0 chnl=0 29 | char id=71 x=35 y=40 width=33 height=33 xoffset=0 yoffset=8 xadvance=34 page=0 chnl=0 30 | char id=67 x=68 y=40 width=29 height=33 xoffset=0 yoffset=8 xadvance=29 page=0 chnl=0 31 | char id=38 x=97 y=40 width=31 height=32 xoffset=0 yoffset=9 xadvance=31 page=0 chnl=0 32 | char id=105 x=128 y=40 width=17 height=32 xoffset=-1 yoffset=8 xadvance=16 page=0 chnl=0 33 | char id=89 x=145 y=40 width=31 height=32 xoffset=-1 yoffset=9 xadvance=30 page=0 chnl=0 34 | char id=85 x=176 y=40 width=30 height=32 xoffset=0 yoffset=9 xadvance=31 page=0 chnl=0 35 | char id=84 x=206 y=40 width=25 height=32 xoffset=0 yoffset=9 xadvance=25 page=0 chnl=0 36 | char id=82 x=231 y=40 width=30 height=32 xoffset=1 yoffset=9 xadvance=31 page=0 chnl=0 37 | char id=80 x=261 y=40 width=30 height=32 xoffset=1 yoffset=9 xadvance=31 page=0 chnl=0 38 | char id=75 x=291 y=40 width=31 height=32 xoffset=1 yoffset=9 xadvance=32 page=0 chnl=0 39 | char id=73 x=322 y=40 width=15 height=32 xoffset=1 yoffset=9 xadvance=17 page=0 chnl=0 40 | char id=72 x=337 y=40 width=32 height=32 xoffset=1 yoffset=9 xadvance=34 page=0 chnl=0 41 | char id=68 x=369 y=40 width=32 height=32 xoffset=1 yoffset=9 xadvance=33 page=0 chnl=0 42 | char id=63 x=401 y=40 width=22 height=31 xoffset=-1 yoffset=9 xadvance=21 page=0 chnl=0 43 | char id=33 x=423 y=40 width=14 height=31 xoffset=1 yoffset=9 xadvance=16 page=0 chnl=0 44 | char id=108 x=437 y=40 width=14 height=31 xoffset=1 yoffset=9 xadvance=16 page=0 chnl=0 45 | char id=90 x=451 y=40 width=24 height=31 xoffset=0 yoffset=9 xadvance=24 page=0 chnl=0 46 | char id=88 x=475 y=40 width=30 height=31 xoffset=-1 yoffset=9 xadvance=30 page=0 chnl=0 47 | char id=87 x=0 y=73 width=43 height=31 xoffset=0 yoffset=9 xadvance=43 page=0 chnl=0 48 | char id=86 x=43 y=73 width=31 height=31 xoffset=0 yoffset=9 xadvance=31 page=0 chnl=0 49 | char id=78 x=74 y=73 width=32 height=31 xoffset=1 yoffset=9 xadvance=34 page=0 chnl=0 50 | char id=77 x=106 y=73 width=35 height=31 xoffset=2 yoffset=9 xadvance=38 page=0 chnl=0 51 | char id=76 x=141 y=73 width=25 height=31 xoffset=1 yoffset=9 xadvance=26 page=0 chnl=0 52 | char id=70 x=166 y=73 width=25 height=31 xoffset=1 yoffset=9 xadvance=27 page=0 chnl=0 53 | char id=69 x=191 y=73 width=26 height=31 xoffset=1 yoffset=9 xadvance=27 page=0 chnl=0 54 | char id=66 x=217 y=73 width=31 height=31 xoffset=0 yoffset=9 xadvance=31 page=0 chnl=0 55 | char id=65 x=248 y=73 width=34 height=31 xoffset=-1 yoffset=9 xadvance=33 page=0 chnl=0 56 | char id=37 x=282 y=73 width=40 height=29 xoffset=-1 yoffset=11 xadvance=38 page=0 chnl=0 57 | char id=116 x=322 y=73 width=21 height=29 xoffset=-2 yoffset=11 xadvance=20 page=0 chnl=0 58 | char id=113 x=343 y=73 width=27 height=29 xoffset=0 yoffset=17 xadvance=28 page=0 chnl=0 59 | char id=103 x=370 y=73 width=27 height=29 xoffset=0 yoffset=17 xadvance=28 page=0 chnl=0 60 | char id=53 x=397 y=73 width=25 height=28 xoffset=-1 yoffset=12 xadvance=24 page=0 chnl=0 61 | char id=50 x=422 y=73 width=25 height=28 xoffset=0 yoffset=13 xadvance=25 page=0 chnl=0 62 | char id=49 x=447 y=73 width=17 height=28 xoffset=0 yoffset=13 xadvance=18 page=0 chnl=0 63 | char id=121 x=464 y=73 width=27 height=28 xoffset=-1 yoffset=18 xadvance=27 page=0 chnl=0 64 | char id=112 x=0 y=104 width=29 height=28 xoffset=0 yoffset=18 xadvance=29 page=0 chnl=0 65 | char id=59 x=29 y=104 width=18 height=27 xoffset=-3 yoffset=19 xadvance=15 page=0 chnl=0 66 | char id=48 x=47 y=104 width=30 height=27 xoffset=0 yoffset=13 xadvance=30 page=0 chnl=0 67 | char id=57 x=77 y=104 width=28 height=27 xoffset=-1 yoffset=13 xadvance=27 page=0 chnl=0 68 | char id=56 x=105 y=104 width=25 height=27 xoffset=-1 yoffset=13 xadvance=24 page=0 chnl=0 69 | char id=55 x=130 y=104 width=25 height=27 xoffset=-1 yoffset=13 xadvance=24 page=0 chnl=0 70 | char id=54 x=155 y=104 width=27 height=27 xoffset=0 yoffset=13 xadvance=27 page=0 chnl=0 71 | char id=52 x=182 y=104 width=26 height=27 xoffset=0 yoffset=14 xadvance=27 page=0 chnl=0 72 | char id=51 x=208 y=104 width=23 height=27 xoffset=0 yoffset=13 xadvance=23 page=0 chnl=0 73 | char id=115 x=231 y=104 width=19 height=26 xoffset=-1 yoffset=17 xadvance=17 page=0 chnl=0 74 | char id=62 x=250 y=104 width=20 height=24 xoffset=0 yoffset=15 xadvance=21 page=0 chnl=0 75 | char id=60 x=270 y=104 width=21 height=24 xoffset=0 yoffset=16 xadvance=21 page=0 chnl=0 76 | char id=43 x=291 y=104 width=26 height=23 xoffset=-1 yoffset=15 xadvance=25 page=0 chnl=0 77 | char id=122 x=317 y=104 width=23 height=23 xoffset=0 yoffset=17 xadvance=24 page=0 chnl=0 78 | char id=117 x=340 y=104 width=26 height=23 xoffset=1 yoffset=18 xadvance=28 page=0 chnl=0 79 | char id=114 x=366 y=104 width=20 height=23 xoffset=0 yoffset=18 xadvance=20 page=0 chnl=0 80 | char id=111 x=386 y=104 width=25 height=23 xoffset=0 yoffset=17 xadvance=25 page=0 chnl=0 81 | char id=110 x=411 y=104 width=27 height=23 xoffset=0 yoffset=18 xadvance=28 page=0 chnl=0 82 | char id=109 x=438 y=104 width=39 height=23 xoffset=0 yoffset=18 xadvance=40 page=0 chnl=0 83 | char id=101 x=477 y=104 width=25 height=23 xoffset=0 yoffset=17 xadvance=25 page=0 chnl=0 84 | char id=99 x=0 y=132 width=19 height=23 xoffset=0 yoffset=17 xadvance=20 page=0 chnl=0 85 | char id=97 x=19 y=132 width=27 height=23 xoffset=0 yoffset=18 xadvance=28 page=0 chnl=0 86 | char id=120 x=46 y=132 width=25 height=22 xoffset=0 yoffset=18 xadvance=25 page=0 chnl=0 87 | char id=119 x=71 y=132 width=37 height=22 xoffset=0 yoffset=18 xadvance=36 page=0 chnl=0 88 | char id=118 x=108 y=132 width=27 height=22 xoffset=-1 yoffset=18 xadvance=26 page=0 chnl=0 89 | char id=42 x=135 y=132 width=22 height=21 xoffset=0 yoffset=9 xadvance=23 page=0 chnl=0 90 | char id=58 x=157 y=132 width=15 height=21 xoffset=0 yoffset=19 xadvance=15 page=0 chnl=0 91 | char id=61 x=172 y=132 width=24 height=20 xoffset=0 yoffset=18 xadvance=24 page=0 chnl=0 92 | char id=94 x=196 y=132 width=27 height=18 xoffset=-1 yoffset=17 xadvance=26 page=0 chnl=0 93 | char id=44 x=223 y=132 width=18 height=18 xoffset=-2 yoffset=28 xadvance=17 page=0 chnl=0 94 | char id=126 x=241 y=132 width=28 height=17 xoffset=-1 yoffset=17 xadvance=27 page=0 chnl=0 95 | char id=46 x=269 y=132 width=17 height=15 xoffset=0 yoffset=25 xadvance=17 page=0 chnl=0 96 | char id=39 x=286 y=132 width=13 height=15 xoffset=1 yoffset=9 xadvance=14 page=0 chnl=0 97 | char id=34 x=299 y=132 width=22 height=14 xoffset=0 yoffset=9 xadvance=22 page=0 chnl=0 98 | char id=96 x=321 y=132 width=17 height=12 xoffset=0 yoffset=6 xadvance=18 page=0 chnl=0 99 | char id=95 x=338 y=132 width=25 height=10 xoffset=-2 yoffset=39 xadvance=22 page=0 chnl=0 100 | char id=45 x=363 y=132 width=19 height=10 xoffset=1 yoffset=21 xadvance=21 page=0 chnl=0 101 | kernings count=-1 102 | -------------------------------------------------------------------------------- /Android/assets/berlin_42.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/berlin_42.png -------------------------------------------------------------------------------- /Android/assets/berlin_64.fnt: -------------------------------------------------------------------------------- 1 | info face="Berlin Sans FB Demi Bold" size=64 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=0,0 2 | common lineHeight=74 base=60 scaleW=256 scaleH=256 pages=3 packed=0 3 | page id=0 file="berlin_641.png" 4 | page id=1 file="berlin_642.png" 5 | page id=2 file="berlin_643.png" 6 | chars count=95 7 | char id=32 x=0 y=0 width=0 height=0 xoffset=0 yoffset=60 xadvance=16 page=0 chnl=0 8 | char id=125 x=0 y=0 width=23 height=60 xoffset=2 yoffset=14 xadvance=25 page=0 chnl=0 9 | char id=123 x=23 y=0 width=23 height=60 xoffset=1 yoffset=14 xadvance=25 page=0 chnl=0 10 | char id=41 x=46 y=0 width=23 height=60 xoffset=1 yoffset=14 xadvance=25 page=0 chnl=0 11 | char id=40 x=69 y=0 width=24 height=60 xoffset=3 yoffset=14 xadvance=25 page=0 chnl=0 12 | char id=93 x=93 y=0 width=22 height=58 xoffset=3 yoffset=15 xadvance=26 page=0 chnl=0 13 | char id=91 x=115 y=0 width=23 height=58 xoffset=4 yoffset=15 xadvance=26 page=0 chnl=0 14 | char id=81 x=138 y=0 width=46 height=55 xoffset=2 yoffset=14 xadvance=48 page=0 chnl=0 15 | char id=74 x=184 y=0 width=20 height=54 xoffset=0 yoffset=15 xadvance=21 page=0 chnl=0 16 | char id=127 x=204 y=0 width=26 height=53 xoffset=4 yoffset=8 xadvance=32 page=0 chnl=0 17 | char id=106 x=230 y=0 width=18 height=53 xoffset=-1 yoffset=16 xadvance=18 page=0 chnl=0 18 | char id=36 x=0 y=60 width=29 height=51 xoffset=2 yoffset=17 xadvance=31 page=0 chnl=0 19 | char id=124 x=29 y=60 width=10 height=51 xoffset=5 yoffset=14 xadvance=20 page=0 chnl=0 20 | char id=35 x=39 y=60 width=43 height=49 xoffset=3 yoffset=15 xadvance=45 page=0 chnl=0 21 | char id=92 x=82 y=60 width=21 height=49 xoffset=1 yoffset=16 xadvance=21 page=0 chnl=0 22 | char id=47 x=103 y=60 width=20 height=49 xoffset=1 yoffset=16 xadvance=21 page=0 chnl=0 23 | char id=102 x=123 y=60 width=23 height=49 xoffset=1 yoffset=13 xadvance=23 page=0 chnl=0 24 | char id=64 x=146 y=60 width=41 height=48 xoffset=2 yoffset=14 xadvance=44 page=0 chnl=0 25 | char id=107 x=187 y=60 width=37 height=48 xoffset=2 yoffset=14 xadvance=38 page=0 chnl=0 26 | char id=104 x=0 y=111 width=34 height=48 xoffset=1 yoffset=14 xadvance=36 page=0 chnl=0 27 | char id=98 x=34 y=111 width=35 height=48 xoffset=2 yoffset=14 xadvance=38 page=0 chnl=0 28 | char id=83 x=69 y=111 width=24 height=48 xoffset=1 yoffset=14 xadvance=25 page=0 chnl=0 29 | char id=79 x=93 y=111 width=46 height=48 xoffset=2 yoffset=14 xadvance=48 page=0 chnl=0 30 | char id=78 x=139 y=111 width=44 height=48 xoffset=3 yoffset=14 xadvance=48 page=0 chnl=0 31 | char id=71 x=183 y=111 width=45 height=48 xoffset=2 yoffset=14 xadvance=46 page=0 chnl=0 32 | char id=67 x=0 y=159 width=39 height=48 xoffset=2 yoffset=14 xadvance=40 page=0 chnl=0 33 | char id=38 x=39 y=159 width=43 height=47 xoffset=2 yoffset=15 xadvance=45 page=0 chnl=0 34 | char id=63 x=82 y=159 width=28 height=47 xoffset=0 yoffset=15 xadvance=27 page=0 chnl=0 35 | char id=33 x=110 y=159 width=15 height=47 xoffset=2 yoffset=15 xadvance=18 page=0 chnl=0 36 | char id=108 x=125 y=159 width=15 height=47 xoffset=2 yoffset=15 xadvance=17 page=0 chnl=0 37 | char id=100 x=140 y=159 width=37 height=47 xoffset=1 yoffset=15 xadvance=38 page=0 chnl=0 38 | char id=88 x=177 y=159 width=37 height=47 xoffset=2 yoffset=15 xadvance=39 page=0 chnl=0 39 | char id=85 x=214 y=159 width=39 height=47 xoffset=3 yoffset=15 xadvance=43 page=0 chnl=0 40 | char id=84 x=0 y=207 width=35 height=47 xoffset=0 yoffset=15 xadvance=34 page=0 chnl=0 41 | char id=80 x=35 y=207 width=39 height=47 xoffset=3 yoffset=15 xadvance=42 page=0 chnl=0 42 | char id=77 x=74 y=207 width=48 height=47 xoffset=3 yoffset=15 xadvance=52 page=0 chnl=0 43 | char id=76 x=122 y=207 width=33 height=47 xoffset=3 yoffset=15 xadvance=35 page=0 chnl=0 44 | char id=75 x=155 y=207 width=39 height=47 xoffset=3 yoffset=15 xadvance=42 page=0 chnl=0 45 | char id=72 x=194 y=207 width=44 height=47 xoffset=3 yoffset=15 xadvance=48 page=0 chnl=0 46 | char id=70 x=0 y=0 width=34 height=47 xoffset=2 yoffset=15 xadvance=36 page=1 chnl=0 47 | char id=69 x=34 y=0 width=34 height=47 xoffset=3 yoffset=15 xadvance=36 page=1 chnl=0 48 | char id=68 x=68 y=0 width=43 height=47 xoffset=3 yoffset=15 xadvance=46 page=1 chnl=0 49 | char id=66 x=111 y=0 width=39 height=47 xoffset=3 yoffset=15 xadvance=41 page=1 chnl=0 50 | char id=65 x=150 y=0 width=44 height=47 xoffset=0 yoffset=15 xadvance=44 page=1 chnl=0 51 | char id=105 x=194 y=0 width=15 height=46 xoffset=2 yoffset=15 xadvance=18 page=1 chnl=0 52 | char id=90 x=209 y=0 width=34 height=46 xoffset=2 yoffset=15 xadvance=35 page=1 chnl=0 53 | char id=89 x=0 y=47 width=38 height=46 xoffset=2 yoffset=15 xadvance=40 page=1 chnl=0 54 | char id=87 x=38 y=47 width=58 height=46 xoffset=2 yoffset=15 xadvance=60 page=1 chnl=0 55 | char id=86 x=96 y=47 width=39 height=46 xoffset=2 yoffset=15 xadvance=42 page=1 chnl=0 56 | char id=82 x=135 y=47 width=39 height=46 xoffset=3 yoffset=15 xadvance=41 page=1 chnl=0 57 | char id=73 x=174 y=47 width=16 height=46 xoffset=3 yoffset=15 xadvance=20 page=1 chnl=0 58 | char id=37 x=190 y=47 width=51 height=44 xoffset=1 yoffset=19 xadvance=51 page=1 chnl=0 59 | char id=116 x=0 y=93 width=24 height=44 xoffset=-1 yoffset=18 xadvance=24 page=1 chnl=0 60 | char id=113 x=24 y=93 width=37 height=43 xoffset=1 yoffset=28 xadvance=38 page=1 chnl=0 61 | char id=112 x=61 y=93 width=36 height=43 xoffset=2 yoffset=28 xadvance=39 page=1 chnl=0 62 | char id=48 x=97 y=93 width=38 height=42 xoffset=2 yoffset=20 xadvance=40 page=1 chnl=0 63 | char id=57 x=135 y=93 width=34 height=42 xoffset=2 yoffset=20 xadvance=36 page=1 chnl=0 64 | char id=56 x=169 y=93 width=31 height=42 xoffset=1 yoffset=20 xadvance=31 page=1 chnl=0 65 | char id=54 x=200 y=93 width=35 height=42 xoffset=2 yoffset=20 xadvance=36 page=1 chnl=0 66 | char id=51 x=0 y=137 width=31 height=42 xoffset=1 yoffset=20 xadvance=31 page=1 chnl=0 67 | char id=50 x=31 y=137 width=33 height=42 xoffset=1 yoffset=20 xadvance=33 page=1 chnl=0 68 | char id=121 x=64 y=137 width=33 height=42 xoffset=2 yoffset=29 xadvance=34 page=1 chnl=0 69 | char id=103 x=97 y=137 width=36 height=42 xoffset=1 yoffset=28 xadvance=37 page=1 chnl=0 70 | char id=55 x=133 y=137 width=32 height=41 xoffset=0 yoffset=20 xadvance=31 page=1 chnl=0 71 | char id=53 x=165 y=137 width=32 height=41 xoffset=1 yoffset=21 xadvance=32 page=1 chnl=0 72 | char id=52 x=197 y=137 width=35 height=41 xoffset=1 yoffset=20 xadvance=35 page=1 chnl=0 73 | char id=49 x=232 y=137 width=19 height=40 xoffset=0 yoffset=21 xadvance=21 page=1 chnl=0 74 | char id=59 x=0 y=179 width=19 height=38 xoffset=-1 yoffset=31 xadvance=18 page=1 chnl=0 75 | char id=115 x=19 y=179 width=20 height=36 xoffset=2 yoffset=26 xadvance=23 page=1 chnl=0 76 | char id=62 x=39 y=179 width=24 height=35 xoffset=2 yoffset=25 xadvance=26 page=1 chnl=0 77 | char id=60 x=63 y=179 width=24 height=35 xoffset=1 yoffset=24 xadvance=26 page=1 chnl=0 78 | char id=111 x=87 y=179 width=34 height=34 xoffset=1 yoffset=28 xadvance=34 page=1 chnl=0 79 | char id=109 x=121 y=179 width=53 height=34 xoffset=2 yoffset=28 xadvance=55 page=1 chnl=0 80 | char id=101 x=174 y=179 width=32 height=34 xoffset=1 yoffset=28 xadvance=32 page=1 chnl=0 81 | char id=99 x=206 y=179 width=27 height=34 xoffset=1 yoffset=28 xadvance=27 page=1 chnl=0 82 | char id=97 x=0 y=217 width=37 height=34 xoffset=1 yoffset=28 xadvance=38 page=1 chnl=0 83 | char id=122 x=37 y=217 width=28 height=33 xoffset=2 yoffset=29 xadvance=30 page=1 chnl=0 84 | char id=120 x=65 y=217 width=32 height=33 xoffset=0 yoffset=29 xadvance=31 page=1 chnl=0 85 | char id=119 x=97 y=217 width=49 height=33 xoffset=0 yoffset=29 xadvance=48 page=1 chnl=0 86 | char id=118 x=146 y=217 width=33 height=33 xoffset=2 yoffset=29 xadvance=34 page=1 chnl=0 87 | char id=117 x=179 y=217 width=34 height=33 xoffset=3 yoffset=29 xadvance=37 page=1 chnl=0 88 | char id=114 x=213 y=217 width=23 height=33 xoffset=2 yoffset=29 xadvance=24 page=1 chnl=0 89 | char id=110 x=0 y=0 width=33 height=32 xoffset=2 yoffset=29 xadvance=36 page=2 chnl=0 90 | char id=58 x=33 y=0 width=15 height=31 xoffset=2 yoffset=31 xadvance=16 page=2 chnl=0 91 | char id=43 x=48 y=0 width=29 height=30 xoffset=1 yoffset=26 xadvance=30 page=2 chnl=0 92 | char id=42 x=77 y=0 width=26 height=27 xoffset=1 yoffset=15 xadvance=27 page=2 chnl=0 93 | char id=94 x=103 y=0 width=35 height=25 xoffset=0 yoffset=18 xadvance=33 page=2 chnl=0 94 | char id=61 x=138 y=0 width=29 height=22 xoffset=2 yoffset=30 xadvance=31 page=2 chnl=0 95 | char id=44 x=167 y=0 width=18 height=21 xoffset=0 yoffset=48 xadvance=18 page=2 chnl=0 96 | char id=39 x=185 y=0 width=11 height=20 xoffset=2 yoffset=15 xadvance=15 page=2 chnl=0 97 | char id=126 x=196 y=0 width=37 height=18 xoffset=0 yoffset=31 xadvance=35 page=2 chnl=0 98 | char id=34 x=0 y=32 width=23 height=18 xoffset=2 yoffset=15 xadvance=25 page=2 chnl=0 99 | char id=46 x=23 y=32 width=17 height=17 xoffset=2 yoffset=45 xadvance=18 page=2 chnl=0 100 | char id=96 x=40 y=32 width=21 height=15 xoffset=2 yoffset=12 xadvance=24 page=2 chnl=0 101 | char id=45 x=61 y=32 width=24 height=13 xoffset=2 yoffset=36 xadvance=27 page=2 chnl=0 102 | char id=95 x=85 y=32 width=33 height=11 xoffset=-1 yoffset=64 xadvance=30 page=2 chnl=0 103 | -------------------------------------------------------------------------------- /Android/assets/berlin_641.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/berlin_641.png -------------------------------------------------------------------------------- /Android/assets/berlin_642.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/berlin_642.png -------------------------------------------------------------------------------- /Android/assets/berlin_643.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/berlin_643.png -------------------------------------------------------------------------------- /Android/assets/card-back-mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/card-back-mark.png -------------------------------------------------------------------------------- /Android/assets/card-back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/card-back.png -------------------------------------------------------------------------------- /Android/assets/card-front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/card-front.png -------------------------------------------------------------------------------- /Android/assets/ding.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/ding.ogg -------------------------------------------------------------------------------- /Android/assets/drums.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/drums.ogg -------------------------------------------------------------------------------- /Android/assets/fire.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/fire.png -------------------------------------------------------------------------------- /Android/assets/fireworks: -------------------------------------------------------------------------------- 1 | fireworks 2 | - Delay - 3 | active: false 4 | - Duration - 5 | lowMin: 3000.0 6 | lowMax: 3000.0 7 | - Count - 8 | min: 0 9 | max: 1024 10 | - Emission - 11 | lowMin: 0.0 12 | lowMax: 0.0 13 | highMin: 400.0 14 | highMax: 200.0 15 | relative: false 16 | scalingCount: 3 17 | scaling0: 0.0 18 | scaling1: 1.0 19 | scaling2: 0.0 20 | timelineCount: 3 21 | timeline0: 0.0 22 | timeline1: 0.05479452 23 | timeline2: 1.0 24 | - Life - 25 | lowMin: 750.0 26 | lowMax: 750.0 27 | highMin: 3000.0 28 | highMax: 3000.0 29 | relative: false 30 | scalingCount: 2 31 | scaling0: 1.0 32 | scaling1: 0.0 33 | timelineCount: 2 34 | timeline0: 0.0 35 | timeline1: 1.0 36 | - Life Offset - 37 | active: true 38 | lowMin: 0.0 39 | lowMax: 0.0 40 | highMin: 200.0 41 | highMax: 200.0 42 | relative: false 43 | scalingCount: 2 44 | scaling0: 1.0 45 | scaling1: 0.0 46 | timelineCount: 2 47 | timeline0: 0.0 48 | timeline1: 1.0 49 | - X Offset - 50 | active: false 51 | - Y Offset - 52 | active: false 53 | - Spawn Shape - 54 | shape: line 55 | - Spawn Width - 56 | lowMin: 0.0 57 | lowMax: 0.0 58 | highMin: 0.0 59 | highMax: 0.0 60 | relative: false 61 | scalingCount: 1 62 | scaling0: 1.0 63 | timelineCount: 1 64 | timeline0: 0.0 65 | - Spawn Height - 66 | lowMin: 0.0 67 | lowMax: 0.0 68 | highMin: 0.0 69 | highMax: 0.0 70 | relative: false 71 | scalingCount: 1 72 | scaling0: 1.0 73 | timelineCount: 1 74 | timeline0: 0.0 75 | - Scale - 76 | lowMin: 2.0 77 | lowMax: 2.0 78 | highMin: 4.0 79 | highMax: 4.0 80 | relative: false 81 | scalingCount: 3 82 | scaling0: 0.29411766 83 | scaling1: 0.9019608 84 | scaling2: 0.1764706 85 | timelineCount: 3 86 | timeline0: 0.0 87 | timeline1: 0.33561644 88 | timeline2: 0.8150685 89 | - Velocity - 90 | active: true 91 | lowMin: 0.0 92 | lowMax: 0.0 93 | highMin: 250.0 94 | highMax: 250.0 95 | relative: false 96 | scalingCount: 3 97 | scaling0: 0.11764706 98 | scaling1: 1.0 99 | scaling2: 0.74509805 100 | timelineCount: 3 101 | timeline0: 0.0 102 | timeline1: 0.30821916 103 | timeline2: 0.89726025 104 | - Angle - 105 | active: true 106 | lowMin: 50.0 107 | lowMax: 130.0 108 | highMin: 50.0 109 | highMax: 130.0 110 | relative: false 111 | scalingCount: 2 112 | scaling0: 0.4509804 113 | scaling1: 0.0 114 | timelineCount: 2 115 | timeline0: 0.0 116 | timeline1: 0.6232877 117 | - Rotation - 118 | active: true 119 | lowMin: 1.0 120 | lowMax: 360.0 121 | highMin: 180.0 122 | highMax: 180.0 123 | relative: true 124 | scalingCount: 2 125 | scaling0: 0.627451 126 | scaling1: 1.0 127 | timelineCount: 2 128 | timeline0: 0.0 129 | timeline1: 1.0 130 | - Wind - 131 | active: false 132 | - Gravity - 133 | active: true 134 | lowMin: 0.0 135 | lowMax: 0.0 136 | highMin: 2.0 137 | highMax: 2.0 138 | relative: true 139 | scalingCount: 3 140 | scaling0: 0.0 141 | scaling1: 1.0 142 | scaling2: 0.0 143 | timelineCount: 3 144 | timeline0: 0.0 145 | timeline1: 0.5 146 | timeline2: 1.0 147 | - Tint - 148 | colorsCount: 3 149 | colors0: 1.0 150 | colors1: 0.8666667 151 | colors2: 0.5176471 152 | timelineCount: 1 153 | timeline0: 0.0 154 | - Transparency - 155 | lowMin: 0.0 156 | lowMax: 0.0 157 | highMin: 1.0 158 | highMax: 1.0 159 | relative: false 160 | scalingCount: 4 161 | scaling0: 0.0 162 | scaling1: 1.0 163 | scaling2: 1.0 164 | scaling3: 0.0 165 | timelineCount: 4 166 | timeline0: 0.0 167 | timeline1: 0.2 168 | timeline2: 0.8 169 | timeline3: 1.0 170 | - Options - 171 | attached: false 172 | continuous: false 173 | aligned: false 174 | additive: true 175 | behind: false 176 | premultipliedAlpha: false 177 | - Image Path - 178 | fire.png 179 | -------------------------------------------------------------------------------- /Android/assets/flipcard.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/flipcard.ogg -------------------------------------------------------------------------------- /Android/assets/gradient_oben.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/gradient_oben.png -------------------------------------------------------------------------------- /Android/assets/gradient_unten.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/gradient_unten.png -------------------------------------------------------------------------------- /Android/assets/grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/grey.png -------------------------------------------------------------------------------- /Android/assets/vacation/surfboard_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/vacation/surfboard_256x256.png -------------------------------------------------------------------------------- /Android/assets/vacation/umbrella_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/vacation/umbrella_256x256.png -------------------------------------------------------------------------------- /Android/assets/vehicles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/assets/vehicles.png -------------------------------------------------------------------------------- /Android/build.gradle: -------------------------------------------------------------------------------- 1 | android { 2 | buildToolsVersion "23.0.2" 3 | compileSdkVersion 23 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 | defaultConfig { 18 | applicationId "at.juggle.games.memory" 19 | minSdkVersion 8 20 | targetSdkVersion 23 21 | } 22 | } 23 | 24 | 25 | // called every time gradle gets executed, takes the native dependencies of 26 | // the natives configuration, and extracts them to the proper libs/ folders 27 | // so they get packed with the APK. 28 | task copyAndroidNatives() { 29 | file("libs/armeabi/").mkdirs(); 30 | file("libs/armeabi-v7a/").mkdirs(); 31 | file("libs/arm64-v8a/").mkdirs(); 32 | file("libs/x86_64/").mkdirs(); 33 | file("libs/x86/").mkdirs(); 34 | 35 | configurations.natives.files.each { jar -> 36 | def outputDir = null 37 | if(jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a") 38 | if(jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a") 39 | if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi") 40 | if(jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64") 41 | if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86") 42 | if(outputDir != null) { 43 | copy { 44 | from zipTree(jar) 45 | into outputDir 46 | include "*.so" 47 | } 48 | } 49 | } 50 | } 51 | 52 | task run(type: Exec) { 53 | def path 54 | def localProperties = project.file("../local.properties") 55 | if (localProperties.exists()) { 56 | Properties properties = new Properties() 57 | localProperties.withInputStream { instr -> 58 | properties.load(instr) 59 | } 60 | def sdkDir = properties.getProperty('sdk.dir') 61 | if (sdkDir) { 62 | path = sdkDir 63 | } else { 64 | path = "$System.env.ANDROID_HOME" 65 | } 66 | } else { 67 | path = "$System.env.ANDROID_HOME" 68 | } 69 | 70 | def adb = path + "/platform-tools/adb" 71 | commandLine "$adb", 'shell', 'am', 'start', '-n', 'at.juggle.games.memory/at.juggle.games.memory.AndroidLauncher' 72 | } 73 | 74 | // sets up the Android Eclipse project, using the old Ant based build. 75 | eclipse { 76 | // need to specify Java source sets explicitly, SpringSource Gradle Eclipse plugin 77 | // ignores any nodes added in classpath.file.withXml 78 | sourceSets { 79 | main { 80 | java.srcDirs "src", 'gen' 81 | } 82 | } 83 | 84 | jdt { 85 | sourceCompatibility = 1.6 86 | targetCompatibility = 1.6 87 | } 88 | 89 | classpath { 90 | plusConfigurations += [ project.configurations.compile ] 91 | containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES' 92 | } 93 | 94 | project { 95 | name = appName + "-android" 96 | natures 'com.android.ide.eclipse.adt.AndroidNature' 97 | buildCommands.clear(); 98 | buildCommand "com.android.ide.eclipse.adt.ResourceManagerBuilder" 99 | buildCommand "com.android.ide.eclipse.adt.PreCompilerBuilder" 100 | buildCommand "org.eclipse.jdt.core.javabuilder" 101 | buildCommand "com.android.ide.eclipse.adt.ApkBuilder" 102 | } 103 | } 104 | 105 | // sets up the Android Idea project, using the old Ant based build. 106 | idea { 107 | module { 108 | sourceDirs += file("src"); 109 | scopes = [ COMPILE: [plus:[project.configurations.compile]]] 110 | 111 | iml { 112 | withXml { 113 | def node = it.asNode() 114 | def builder = NodeBuilder.newInstance(); 115 | builder.current = node; 116 | builder.component(name: "FacetManager") { 117 | facet(type: "android", name: "Android") { 118 | configuration { 119 | option(name: "UPDATE_PROPERTY_FILES", value:"true") 120 | } 121 | } 122 | } 123 | } 124 | } 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /Android/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/ic_launcher-web.png -------------------------------------------------------------------------------- /Android/libs/arm64-v8a/libgdx.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/libs/arm64-v8a/libgdx.so -------------------------------------------------------------------------------- /Android/libs/x86_64/libgdx.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/libs/x86_64/libgdx.so -------------------------------------------------------------------------------- /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 | -dontwarn com.badlogic.gdx.graphics.g2d.freetype.FreetypeBuild 30 | 31 | -keep class com.badlogic.gdx.controllers.android.AndroidControllers 32 | 33 | -keepclassmembers class com.badlogic.gdx.backends.android.AndroidInput* { 34 | (com.badlogic.gdx.Application, android.content.Context, java.lang.Object, com.badlogic.gdx.backends.android.AndroidApplicationConfiguration); 35 | } 36 | 37 | -keepclassmembers class com.badlogic.gdx.physics.box2d.World { 38 | boolean contactFilter(long, long); 39 | void beginContact(long); 40 | void endContact(long); 41 | void preSolve(long, long); 42 | void postSolve(long, long); 43 | boolean reportFixture(long); 44 | float reportRayFixture(long, float, float, float, float, float); 45 | } 46 | -------------------------------------------------------------------------------- /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/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /Android/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /Android/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /Android/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/Android/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Android/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /Android/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello World, MemoryGameActivity! 5 | Memory HD 6 | 7 | -------------------------------------------------------------------------------- /Android/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Android/src/at/juggle/games/memory/AndroidLauncher.java: -------------------------------------------------------------------------------- 1 | package at.juggle.games.memory; 2 | 3 | import android.os.Bundle; 4 | 5 | import com.badlogic.gdx.backends.android.AndroidApplication; 6 | import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; 7 | import at.juggle.games.memory.MemoryGame; 8 | 9 | public class AndroidLauncher extends AndroidApplication { 10 | @Override 11 | protected void onCreate (Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | AndroidApplicationConfiguration config = new AndroidApplicationConfiguration(); 14 | initialize(new MemoryGame(), config); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Desktop/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java" 2 | 3 | sourceCompatibility = 1.6 4 | sourceSets.main.java.srcDirs = [ "src/" ] 5 | 6 | project.ext.mainClassName = "at.juggle.games.memory.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/at/juggle/games/memory/desktop/DesktopLauncher.java: -------------------------------------------------------------------------------- 1 | package at.juggle.games.memory.desktop; 2 | 3 | import com.badlogic.gdx.backends.lwjgl.LwjglApplication; 4 | import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; 5 | import at.juggle.games.memory.MemoryGame; 6 | 7 | public class DesktopLauncher { 8 | public static void main (String[] arg) { 9 | LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); 10 | config.title = "Memory"; 11 | config.width = 1280; 12 | config.height = 720; 13 | new LwjglApplication(new MemoryGame(), config); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | memory-game-android 2 | =================== 3 | 4 | A simple memory game for Android based on libGDX 5 | 6 | Find it on Google Play here: 7 | https://play.google.com/store/apps/details?id=at.juggle.games.memory 8 | 9 | How to compile it 10 | ----------------- 11 | Either import the project in Android Studio, or use gradle to create 12 | releases for desktop, android or web: 13 | 14 | $> gradlew desktop:dist 15 | 16 | $> gradlew android:assembleRelease 17 | 18 | $> gradlew html:dist 19 | 20 | License 21 | ------- 22 | 23 | Copyright 2012-2016 Mathias Lux, mathias@juggle.at 24 | 25 | Licensed under the Apache License, Version 2.0 (the "License"); 26 | you may not use this file except in compliance with the License. 27 | You may obtain a copy of the License at 28 | 29 | http://www.apache.org/licenses/LICENSE-2.0 30 | 31 | Unless required by applicable law or agreed to in writing, software 32 | distributed under the License is distributed on an "AS IS" BASIS, 33 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 34 | See the License for the specific language governing permissions and 35 | limitations under the License. 36 | -------------------------------------------------------------------------------- /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.5.0' 10 | classpath 'org.robovm:robovm-gradle-plugin:1.12.0' 11 | } 12 | } 13 | 14 | allprojects { 15 | apply plugin: "eclipse" 16 | apply plugin: "idea" 17 | 18 | version = '1.0' 19 | ext { 20 | appName = "Memory" 21 | gdxVersion = '1.9.2' 22 | roboVMVersion = '1.12.0' 23 | box2DLightsVersion = '1.4' 24 | ashleyVersion = '1.7.0' 25 | aiVersion = '1.8.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-arm64-v8a" 57 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86" 58 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64" 59 | } 60 | } 61 | 62 | project(":ios") { 63 | apply plugin: "java" 64 | apply plugin: "robovm" 65 | 66 | 67 | dependencies { 68 | compile project(":core") 69 | compile "org.robovm:robovm-rt:$roboVMVersion" 70 | compile "org.robovm:robovm-cocoatouch:$roboVMVersion" 71 | compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion" 72 | compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios" 73 | } 74 | } 75 | 76 | project(":html") { 77 | apply plugin: "gwt" 78 | apply plugin: "war" 79 | 80 | 81 | dependencies { 82 | compile project(":core") 83 | compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion" 84 | compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources" 85 | compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources" 86 | } 87 | } 88 | 89 | project(":core") { 90 | apply plugin: "java" 91 | 92 | 93 | dependencies { 94 | compile "com.badlogicgames.gdx:gdx:$gdxVersion" 95 | } 96 | } 97 | 98 | tasks.eclipse.doLast { 99 | delete ".project" 100 | } -------------------------------------------------------------------------------- /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/src/MemoryGame.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /core/src/at/juggle/games/memory/AbstractScreen.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012-2014 Mathias Lux, mathias@juggle.at 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package at.juggle.games.memory; 17 | 18 | import com.badlogic.gdx.graphics.g2d.SpriteBatch; 19 | 20 | /** 21 | * @author Mathias Lux, mathias@juggle.at 22 | * Date: 13.02.12 23 | * Time: 10:12 24 | */ 25 | public abstract class AbstractScreen { 26 | protected AssetManager assets; 27 | 28 | public AbstractScreen(AssetManager assets) { 29 | this.assets = assets; 30 | } 31 | 32 | public abstract void render(SpriteBatch spriteBatch) ; 33 | } 34 | -------------------------------------------------------------------------------- /core/src/at/juggle/games/memory/AssetManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012-2014 Mathias Lux, mathias@juggle.at 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package at.juggle.games.memory; 17 | 18 | import com.badlogic.gdx.Gdx; 19 | import com.badlogic.gdx.Preferences; 20 | import com.badlogic.gdx.audio.Sound; 21 | import com.badlogic.gdx.files.FileHandle; 22 | import com.badlogic.gdx.graphics.Texture; 23 | import com.badlogic.gdx.graphics.g2d.BitmapFont; 24 | import com.badlogic.gdx.graphics.g2d.ParticleEffect; 25 | import com.badlogic.gdx.graphics.g2d.TextureRegion; 26 | 27 | import java.util.ArrayList; 28 | import java.util.Collections; 29 | 30 | /** 31 | * @author Mathias Lux, mathias@juggle.at 32 | * Date: 13.02.12 33 | * Time: 10:07 34 | */ 35 | public class AssetManager { 36 | private String prefix = "assets/"; 37 | 38 | protected GameOptions options; 39 | protected Texture card, cardBack, cardBackMark; 40 | protected Texture check, positive; 41 | protected BitmapFont font, smallFont; 42 | public TextureRegion[] icons; 43 | public Texture grey, background; 44 | public Texture gradientTop, gradientBottom; 45 | public Texture logo; 46 | public ParticleEffect fireworks; 47 | public Sound sndFlipCard, sndCheer, sndDing; 48 | 49 | 50 | public AssetManager(GameOptions options) { 51 | this.options = options; 52 | Preferences preferences = Gdx.app.getPreferences("memory_free_hd.prefs"); 53 | if (preferences.contains("soundOn")) { 54 | options.soundOn = preferences.getBoolean("soundOn"); 55 | } 56 | font = new BitmapFont(getFileHandle("berlin_64.fnt"), false); 57 | smallFont = new BitmapFont(getFileHandle("berlin_42.fnt"), false); 58 | card = new Texture(getFileHandle("card-front.png")); 59 | cardBack = new Texture(getFileHandle("card-back.png")); 60 | cardBackMark = new Texture(getFileHandle("card-back-mark.png")); 61 | check = new Texture(getFileHandle("Check_32x32.png")); 62 | positive = new Texture(getFileHandle("Positive_256x256.png")); 63 | grey = new Texture(getFileHandle("grey.png")); 64 | background = new Texture(getFileHandle("background.jpg")); 65 | gradientTop = new Texture(getFileHandle("gradient_oben.png")); 66 | gradientBottom = new Texture(getFileHandle("gradient_unten.png")); 67 | if (GameOptions.isFreeVersion) { 68 | logo = new Texture(getFileHandle("Logo.png")); 69 | } else { 70 | logo = new Texture(getFileHandle("Logo_donated.png")); 71 | } 72 | 73 | cardBack.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear); 74 | cardBackMark.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear); 75 | logo.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear); 76 | 77 | Texture vehiclesTexture = new Texture(getFileHandle("vehicles.png")); 78 | vehiclesTexture.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear); 79 | TextureRegion[][] veh = TextureRegion.split(vehiclesTexture, 256, 256); 80 | 81 | icons = new TextureRegion[24]; 82 | icons[0] = new TextureRegion(loadTexture("animals/Butterfly_128x128.png")); 83 | icons[1] = new TextureRegion(loadTexture("animals/Dolphin_128x128.png")); 84 | icons[2] = new TextureRegion(loadTexture("animals/Elephant_128x128.png")); 85 | icons[3] = new TextureRegion(loadTexture("animals/Hippopotamus_128x128.png")); 86 | icons[4] = new TextureRegion(loadTexture("animals/Panda_128x128.png")); 87 | icons[5] = new TextureRegion(loadTexture("animals/Turtle_128x128.png")); 88 | icons[6] = new TextureRegion(loadTexture("vacation/surfboard_256x256.png")); 89 | icons[7] = new TextureRegion(loadTexture("vacation/umbrella_256x256.png")); 90 | 91 | int count = 0; 92 | for (int i = 0; i < veh.length; i++) { 93 | TextureRegion[] textureRegions = veh[i]; 94 | for (int j = 0; j < textureRegions.length; j++) { 95 | icons[8 + count] = textureRegions[j]; 96 | count++; 97 | } 98 | } 99 | 100 | // Particle effects 101 | fireworks = new ParticleEffect(); 102 | fireworks.load(getFileHandle("fireworks"), getFileHandle("")); 103 | 104 | // sounds 105 | sndFlipCard = Gdx.audio.newSound(getFileHandle("flipcard.ogg")); 106 | sndCheer = Gdx.audio.newSound(getFileHandle("drums.ogg")); 107 | sndDing = Gdx.audio.newSound(getFileHandle("ding.ogg")); 108 | } 109 | 110 | /** 111 | * Little helper method for porting the asset manager to android 112 | * 113 | * @param file the file to load 114 | * @return a file handle 115 | */ 116 | private FileHandle getFileHandle(String file) { 117 | // if (Gdx.app.getType() == Application.ApplicationType.Desktop) 118 | // return Gdx.files.internal(prefix + file); // for desktop use 119 | // else 120 | return Gdx.files.internal(file); // for android use 121 | } 122 | 123 | private Texture loadTexture(String fileHandle) { 124 | Texture tmp; 125 | tmp = new Texture(getFileHandle(fileHandle)); 126 | tmp.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear); 127 | return tmp; 128 | } 129 | 130 | /** 131 | * Shuffle card icons to see something new every time. 132 | */ 133 | public void shuffleIcons() { 134 | TextureRegion tmp; 135 | int a, b; 136 | for (int k = 0; k < 25; k++) { 137 | a = (int) Math.floor(Math.random()*icons.length); 138 | b = (int) Math.floor(Math.random()*icons.length); 139 | if (a!=b) { 140 | tmp = icons[a]; 141 | icons[a] = icons[b]; 142 | icons[b] = tmp; 143 | } 144 | } 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /core/src/at/juggle/games/memory/CreditsScreen.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012-2014 Mathias Lux, mathias@juggle.at 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package at.juggle.games.memory; 17 | 18 | import com.badlogic.gdx.Gdx; 19 | import com.badlogic.gdx.Input; 20 | import com.badlogic.gdx.graphics.Color; 21 | import com.badlogic.gdx.graphics.g2d.BitmapFont; 22 | import com.badlogic.gdx.graphics.g2d.SpriteBatch; 23 | 24 | /** 25 | * @author Mathias Lux, mathias@juggle.at 26 | * Date: 13.02.12 27 | * Time: 10:09 28 | */ 29 | public class CreditsScreen extends AbstractScreen{ 30 | String credits = "Game Design & Dev\n" + 31 | "Mathias Lux\n" + 32 | "mathias@juggle.at\n" + 33 | "(c) 2012-2016\n" + 34 | "\n" + 35 | "Many thanks to the libGdx project\n" + 36 | "http://libgdx.badlogicgames.com/\n" + 37 | "\n" + 38 | "This game is licensed under \n" + 39 | "Apache License v2.0\n" + 40 | "Find it at at github:\n" + 41 | "dermotte/memory-game-android\n" + 42 | "\n" + 43 | "** Visuals:\n" + 44 | "\n" + 45 | "Animal, vacation, positive\n" + 46 | "& check icons by\n" + 47 | "www.visualpharm.com\n" + 48 | "\n" + 49 | "Vehicles by cemagraphics (cc)\n" + 50 | "http://cemagraphics.deviantart.com/\n" + 51 | "\n"; 52 | String[] creditsLines = credits.split("\\n"); 53 | BitmapFont font = assets.font; 54 | float offset = - (creditsLines.length) * font.getLineHeight(); 55 | float minTimeShown = 2f; 56 | 57 | public CreditsScreen(AssetManager assets) { 58 | super(assets); 59 | } 60 | 61 | @Override 62 | public void render(SpriteBatch spriteBatch) { 63 | float h = MemoryGame.HEIGHT; 64 | float l = font.getLineHeight(); 65 | 66 | minTimeShown -= Gdx.graphics.getDeltaTime(); 67 | if (Gdx.input.justTouched() & minTimeShown < 0) { 68 | assets.options.gameState = GameOptions.STATE_MENU; 69 | minTimeShown = 2f; 70 | } 71 | // key listener ... 72 | if (Gdx.input.isKeyPressed(Input.Keys.ESCAPE) || Gdx.input.isKeyPressed(Input.Keys.BACK)) { // get back to menu ... 73 | assets.options.gameState = GameOptions.STATE_MENU; 74 | } 75 | 76 | 77 | offset += Gdx.graphics.getDeltaTime()*35f; 78 | if (offset > MemoryGame.HEIGHT) offset = - (creditsLines.length) * font.getLineHeight(); 79 | spriteBatch.begin(); 80 | // draw background ... 81 | spriteBatch.draw(assets.background, 0, 0, MemoryGame.WIDTH, MemoryGame.HEIGHT); 82 | 83 | spriteBatch.setColor(Color.WHITE); 84 | for (int i = 0; i < creditsLines.length; i++) { 85 | String line = creditsLines[i]; 86 | font.draw(spriteBatch, line, 16, offset + (creditsLines.length-i)*font.getLineHeight()); 87 | } 88 | // draw gradients for the fx 89 | spriteBatch.draw(assets.gradientBottom, 0, 0, MemoryGame.WIDTH, assets.gradientBottom.getHeight()); 90 | spriteBatch.draw(assets.gradientTop, 0, MemoryGame.HEIGHT-assets.gradientTop.getHeight(), MemoryGame.WIDTH, assets.gradientTop.getHeight()); 91 | spriteBatch.end(); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /core/src/at/juggle/games/memory/GameOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012-2014 Mathias Lux, mathias@juggle.at 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package at.juggle.games.memory; 17 | 18 | import com.badlogic.gdx.Gdx; 19 | import com.badlogic.gdx.Preferences; 20 | 21 | /** 22 | * @author Mathias Lux, mathias@juggle.at 23 | * Date: 13.02.12 24 | * Time: 10:36 25 | */ 26 | public class GameOptions { 27 | public static final int STATE_MENU = 0; 28 | public static final int STATE_GAME = 1; 29 | public static final int STATE_CREDITS = 2; 30 | public static final int STATE_PAUSED = 4; 31 | public static final int STATE_OPTIONS = 8; 32 | 33 | public static final int MODE_CLASSICAL = 0; 34 | public static final int MODE_FLASH = 1; 35 | 36 | public float buttonPressTimeout = 0f; 37 | 38 | public static boolean isFreeVersion = true; 39 | 40 | // configure like this: { number of cards, rows, cols } 41 | private int[][] numberOfCardsOptions; 42 | protected int numberOfCardsIndex = 2; 43 | 44 | protected int gameState = STATE_MENU; 45 | 46 | protected int gameMode = MODE_CLASSICAL; 47 | 48 | protected boolean soundOn = true; 49 | 50 | public GameOptions() { 51 | // configure like this: { number of cards, rows, cols } 52 | if (Gdx.graphics.getWidth()>800) { 53 | numberOfCardsOptions = new int[][]{ 54 | // new int[] {4, 2, 2}, 55 | new int[] {6, 2, 3}, 56 | new int[] {12, 3, 4}, 57 | new int[] {18, 3, 6}, 58 | new int[] {20, 4, 5}, 59 | new int[] {24, 4, 6}, 60 | new int[] {28, 4, 7}, 61 | new int[] {32, 4, 8} 62 | }; 63 | } else { 64 | numberOfCardsOptions = new int[][]{ 65 | new int[] {4, 2, 2}, 66 | new int[] {6, 2, 3}, 67 | new int[] {12, 3, 4}, 68 | new int[] {18, 3, 6}, 69 | new int[] {20, 4, 5} 70 | }; 71 | } 72 | } 73 | 74 | public void nextNumberOfCards() { 75 | numberOfCardsIndex++; 76 | numberOfCardsIndex = numberOfCardsIndex % numberOfCardsOptions.length; 77 | } 78 | 79 | public int getNumberOfRows() { 80 | return numberOfCardsOptions[numberOfCardsIndex][1]; 81 | } 82 | 83 | public int getNumberOfCols() { 84 | return numberOfCardsOptions[numberOfCardsIndex][2]; 85 | } 86 | 87 | public int getNumberOfCards() { 88 | return numberOfCardsOptions[numberOfCardsIndex][0]; 89 | } 90 | 91 | public String getGameModeString() { 92 | return ((gameMode==0)?"Classic":"Flash"); 93 | } 94 | 95 | public void toggleGameMode() { 96 | if (gameMode==0) gameMode=1; 97 | else gameMode =0; 98 | } 99 | 100 | public void toggleSoundOn() { 101 | soundOn = !soundOn; 102 | Preferences preferences = Gdx.app.getPreferences("memory_free_hd.prefs"); 103 | preferences.putBoolean("soundOn", soundOn); 104 | preferences.flush(); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /core/src/at/juggle/games/memory/GameScreen.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012-2014 Mathias Lux, mathias@juggle.at 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package at.juggle.games.memory; 17 | 18 | import com.badlogic.gdx.Gdx; 19 | import com.badlogic.gdx.Input; 20 | import com.badlogic.gdx.graphics.g2d.BitmapFont; 21 | import com.badlogic.gdx.graphics.g2d.GlyphLayout; 22 | import com.badlogic.gdx.graphics.g2d.ParticleEffect; 23 | import com.badlogic.gdx.graphics.g2d.SpriteBatch; 24 | import com.badlogic.gdx.math.Vector2; 25 | 26 | import java.util.LinkedList; 27 | 28 | /** 29 | * @author Mathias Lux, mathias@juggle.at 30 | * Date: 13.02.12 31 | * Time: 10:53 32 | */ 33 | public class GameScreen extends AbstractScreen { 34 | private GameModel model = null; 35 | private int numRows; 36 | private int numCols; 37 | private float offset = 16; 38 | // temp vars ... 39 | private float h; 40 | private float cardX, cardY; 41 | private float cardHeight; 42 | 43 | private ParticleEffect fireworksLeft, fireworksRight; 44 | 45 | GlyphLayout fontLayout = new GlyphLayout(); 46 | 47 | public GameScreen(AssetManager assets) { 48 | super(assets); 49 | } 50 | 51 | public void startGame() { 52 | model = new GameModel(assets.options.getNumberOfCards()); 53 | numRows = assets.options.getNumberOfRows(); 54 | numCols = assets.options.getNumberOfCols(); 55 | assets.shuffleIcons(); 56 | fireworksLeft = new ParticleEffect(assets.fireworks); 57 | fireworksRight = new ParticleEffect(assets.fireworks); 58 | } 59 | 60 | @Override 61 | public void render(SpriteBatch spriteBatch) { 62 | if (model == null) { 63 | startGame(); 64 | } 65 | // key listener ... 66 | if (Gdx.input.isKeyPressed(Input.Keys.ESCAPE) || Gdx.input.isKeyPressed(Input.Keys.BACK)) { // get back to menu ... 67 | assets.options.buttonPressTimeout = 1f; 68 | assets.options.gameState = GameOptions.STATE_MENU; 69 | } 70 | 71 | h = MemoryGame.HEIGHT; 72 | 73 | cardHeight = (h - (numRows + 1) * offset) / numRows; 74 | 75 | // determine which card has been clicked and react in the model ... 76 | // but only if the intro animation is over ... 77 | if (model.introAnimation < 0) { 78 | compute(offset, cardHeight); 79 | // one time covering action after the animation. 80 | if (model.needsToBeCovered) { 81 | model.coverCards(); 82 | model.needsToBeCovered = false; 83 | } 84 | } 85 | else model.introAnimation -= Gdx.graphics.getDeltaTime(); 86 | // game time; 87 | if (!model.finished) model.time += Gdx.graphics.getDeltaTime(); 88 | 89 | // the drawing 90 | 91 | spriteBatch.begin(); 92 | // draw background ... 93 | spriteBatch.draw(assets.background, 0, 0, MemoryGame.WIDTH, MemoryGame.HEIGHT); 94 | 95 | for (int r = 0; r < numRows; r++) { 96 | for (int c = 0; c < numCols; c++) { 97 | cardX = c * (cardHeight - cardHeight / 5.5f); 98 | cardY = offset + r * (cardHeight + offset); 99 | float cardTime = model.introAnimationLength / ((float) model.numCards); 100 | if (cardTime * (c + numCols * r) < model.introAnimationLength - model.introAnimation) { // if is for the start animation ... also compensates the first click :) 101 | // draw the card ... 102 | if (model.getState((c + numCols * r)) == 0) { 103 | spriteBatch.draw(assets.cardBackMark, cardX, cardY, cardHeight, cardHeight); 104 | } else if (model.getState((c + numCols * r)) == 1) { 105 | spriteBatch.draw(assets.cardBack, cardX, cardY, cardHeight, cardHeight); 106 | } else if (model.getState((c + numCols * r)) >= 2) { 107 | spriteBatch.draw(assets.card, cardX, cardY, cardHeight, cardHeight); 108 | 109 | if (assets.icons == null) { 110 | String str = "" + model.icon[(c + numCols * r)]; 111 | assets.font.draw(spriteBatch, str, 112 | cardX + cardHeight / 2 - getStringWidth(assets.font, str) / 2, 113 | cardY + cardHeight / 2 + getStringHeight(assets.font, str) / 2); 114 | } else { 115 | float iconSize = cardHeight / 2; 116 | spriteBatch.draw(assets.icons[model.icon[(c + numCols * r)]], 117 | cardX + cardHeight / 2 - iconSize / 2, 118 | cardY + cardHeight / 2 - iconSize / 2, 119 | iconSize, iconSize); 120 | 121 | } 122 | 123 | if (model.getState((c + numCols * r)) == 3 && !model.finished) { 124 | spriteBatch.draw(assets.check, cardX + cardHeight - 2f * cardHeight / 5.5f, cardY + cardHeight / 16f, 32, 32); 125 | } 126 | } 127 | // draw the icon ... 128 | } 129 | } 130 | } 131 | 132 | // draw time and moves ... 133 | if (model.introAnimation < 0 & !model.finished) { 134 | String moves = model.numberOfMoves + " tries"; 135 | int secs = ((int) Math.floor(model.time)) % 60; 136 | int min = ((int) Math.floor(model.time)) / 60; 137 | String timeString = min + ":" + (secs < 10 ? "0" : "") + secs; 138 | assets.font.draw(spriteBatch, moves, MemoryGame.WIDTH - getStringWidth(assets.font, moves) - 10, offset + assets.font.getLineHeight()); 139 | assets.font.draw(spriteBatch, timeString, MemoryGame.WIDTH - getStringWidth(assets.font, timeString) - 10, offset + assets.font.getLineHeight() * 2); 140 | } 141 | 142 | // spriteBatch.draw(assets.undo, MemoryGame.WIDTH - assets.undo.getWidth() - 10, MemoryGame.HEIGHT - assets.undo.getHeight() - 10); 143 | 144 | if (model.finished) { 145 | 146 | spriteBatch.draw(assets.grey, 0, 0, MemoryGame.WIDTH, MemoryGame.HEIGHT); 147 | 148 | fireworksLeft.findEmitter("fireworks").setPosition(MemoryGame.WIDTH /4, 0); 149 | fireworksLeft.findEmitter("fireworks").draw(spriteBatch, Gdx.graphics.getDeltaTime()); 150 | fireworksRight.findEmitter("fireworks").setPosition(3*MemoryGame.WIDTH /4, 0); 151 | fireworksRight.findEmitter("fireworks").draw(spriteBatch, Gdx.graphics.getDeltaTime()); 152 | 153 | spriteBatch.draw(assets.positive, MemoryGame.WIDTH / 2 - assets.positive.getWidth() / 2, MemoryGame.HEIGHT / 2 - assets.positive.getHeight() / 2); 154 | // assets.font.getData().scale(2f); 155 | assets.font.draw(spriteBatch, "Congratulations!", 156 | MemoryGame.WIDTH / 2 - getStringWidth(assets.font, "Congratulations!") / 2, 157 | MemoryGame.HEIGHT - assets.font.getLineHeight() * 2); 158 | // assets.font.getData().scale(1f); 159 | int secs = ((int) Math.floor(model.time)) % 60; 160 | int min = ((int) Math.floor(model.time)) / 60; 161 | String timeString = "Solved in " + min + ":" + (secs < 10 ? "0" : "") + secs + " with " + model.numberOfMoves + " tries"; 162 | assets.smallFont.draw(spriteBatch, timeString, 163 | MemoryGame.WIDTH / 2 - getStringWidth(assets.smallFont, timeString) / 2, 164 | assets.smallFont.getLineHeight() * 2); 165 | 166 | } 167 | 168 | spriteBatch.end(); 169 | } 170 | 171 | private void compute(float offset, float cardHeight) { 172 | if (Gdx.input.justTouched()) { 173 | // go to menu if game is finished. 174 | if (model.finished) assets.options.gameState = GameOptions.STATE_MENU; 175 | 176 | 177 | // (x,y) from top left corner 178 | float x = Gdx.input.getX()/ ((float) Gdx.graphics.getWidth())* ((float) MemoryGame.WIDTH); 179 | float y = Gdx.input.getY()/ ((float) Gdx.graphics.getHeight())* ((float) MemoryGame.HEIGHT); 180 | 181 | // row might be easier: 182 | int hitRow = -1; 183 | for (int r = 0; r < numRows; r++) { 184 | if (y > offset + r * (offset + cardHeight) && y < offset + (r + 1) * (offset + cardHeight)) { 185 | hitRow = numRows - 1 - r; 186 | } 187 | } 188 | // now for the cols: 189 | int hitCol = -1; 190 | for (int c = 0; c < numCols; c++) { 191 | if (x > c * (cardHeight - cardHeight / 5.5f) && x < (c + 1) * (cardHeight - cardHeight / 5.5f)) { 192 | hitCol = c; 193 | } 194 | } 195 | // adapt model .. 196 | if (hitCol > -1 && hitRow > -1) { 197 | model.turnCard(hitCol + numCols * hitRow); 198 | } 199 | } 200 | } 201 | 202 | public void resetGame() { 203 | model = null; 204 | } 205 | 206 | private float getStringWidth(BitmapFont font, String str) { 207 | fontLayout.setText(font, str); 208 | return fontLayout.width; 209 | } 210 | 211 | private float getStringHeight(BitmapFont font, String str) { 212 | fontLayout.setText(font, str); 213 | return fontLayout.height; 214 | } 215 | 216 | 217 | class GameModel { 218 | int[] state; 219 | int[] icon; 220 | int numCards; 221 | float introAnimation; 222 | float introAnimationLength = 1; // intro animation in seconds ... 223 | int numberOfMoves; 224 | float time; 225 | boolean finished, needsToBeCovered; 226 | 227 | GameModel(int numCards) { 228 | time = -introAnimationLength; 229 | this.numCards = numCards; 230 | state = new int[numCards]; 231 | icon = new int[numCards]; 232 | // checks if flash mode is enabled. If so we need to cover the cards after the initial animation and set "needsToBeCovered" to false 233 | if (assets.options.gameMode==GameOptions.MODE_CLASSICAL) needsToBeCovered = false; 234 | else needsToBeCovered = true; 235 | for (int i = 0; i < state.length; i++) { 236 | if (assets.options.gameMode==GameOptions.MODE_CLASSICAL) state[i] = 0; 237 | else state[i] = 2; 238 | } 239 | 240 | // randomize the icons on the cards. 241 | LinkedList icons = new LinkedList(); 242 | for (int i = 0; i < numCards / 2; i++) { 243 | icons.add(i); 244 | icons.add(i); 245 | } 246 | for (int i = 0; i < icon.length; i++) { 247 | icon[i] = icons.remove((int) Math.floor(Math.random() * icons.size())); 248 | } 249 | introAnimation = introAnimationLength; 250 | numberOfMoves = 0; 251 | finished = false; 252 | } 253 | 254 | public void coverCards() { 255 | for (int i = 0; i < state.length; i++) { 256 | state[i] = 0; 257 | } 258 | } 259 | 260 | public int getState(int card) { 261 | // 0 ... new and face down 262 | // 1 ... visited but face down 263 | // 2 ... turned but not found in a pair 264 | // 3 ... found as part of a pair 265 | return state[card]; 266 | } 267 | 268 | public void turnCard(int card) { 269 | // check if there are already two cards turned ... 270 | int countTurned = 0; 271 | boolean found = false; 272 | for (int i = 0; i < state.length; i++) { 273 | if (state[i] == 2) { 274 | countTurned++; 275 | } 276 | } 277 | if (countTurned == 0) { 278 | if (state[card] < 2) { 279 | state[card] = 2; 280 | // numberOfMoves++; 281 | if (assets.options.soundOn) assets.sndFlipCard.play(); 282 | } 283 | } else if (countTurned == 1) { 284 | int iconTurned = icon[card], lastTurned = card; 285 | for (int i = 0; i < state.length; i++) { 286 | if (state[i] == 2 && i != card) { 287 | if (iconTurned == icon[i]) { 288 | // Player has found a pair of cards ... 289 | // ------------------------------------ 290 | state[i] = 3; 291 | state[lastTurned] = 3; 292 | found = true; 293 | numberOfMoves++; 294 | if (assets.options.soundOn) assets.sndFlipCard.play(); 295 | if (assets.options.soundOn) assets.sndDing.play(); 296 | } 297 | } 298 | } 299 | if (!found & state[card] < 2) { 300 | state[card] = 2; 301 | numberOfMoves++; 302 | if (assets.options.soundOn) assets.sndFlipCard.play(); 303 | } 304 | } else { 305 | for (int i = 0; i < state.length; i++) { 306 | if (state[i] == 2) { 307 | state[i] = 1; 308 | } 309 | } 310 | } 311 | finished = true; 312 | for (int i = 0; i < state.length; i++) { 313 | finished = finished & state[i] == 3; 314 | } 315 | if (finished) { 316 | fireworksLeft.start(); 317 | fireworksRight.start(); 318 | if (assets.options.soundOn) assets.sndCheer.play(); 319 | } 320 | } 321 | } 322 | } 323 | -------------------------------------------------------------------------------- /core/src/at/juggle/games/memory/MemoryGame.java: -------------------------------------------------------------------------------- 1 | package at.juggle.games.memory; 2 | 3 | import com.badlogic.gdx.ApplicationAdapter; 4 | import com.badlogic.gdx.Gdx; 5 | import com.badlogic.gdx.graphics.GL20; 6 | import com.badlogic.gdx.graphics.OrthographicCamera; 7 | import com.badlogic.gdx.graphics.Texture; 8 | import com.badlogic.gdx.graphics.g2d.SpriteBatch; 9 | 10 | public class MemoryGame extends ApplicationAdapter { 11 | public final static int WIDTH = 1280; 12 | public final static int HEIGHT = 720; 13 | private OrthographicCamera camera; 14 | 15 | private AssetManager manager; 16 | 17 | private GameOptions options; 18 | 19 | private CreditsScreen creditsScreen; 20 | private MenuScreen menuScreen; 21 | private GameScreen gameScreen; 22 | 23 | 24 | SpriteBatch batch; 25 | Texture img; 26 | 27 | @Override 28 | public void create() { 29 | // management ... 30 | options = new GameOptions(); 31 | manager = new AssetManager(options); 32 | // screens ... 33 | creditsScreen = new CreditsScreen(manager); 34 | menuScreen = new MenuScreen(manager); 35 | gameScreen = new GameScreen(manager); 36 | 37 | // handle back button 38 | Gdx.input.setCatchBackKey(true); 39 | 40 | batch = new SpriteBatch(); 41 | camera = new OrthographicCamera(WIDTH, HEIGHT); 42 | camera.position.set(WIDTH / 2, HEIGHT / 2, 0); 43 | } 44 | 45 | 46 | @Override 47 | public void render () { 48 | Gdx.gl.glClearColor(0.065f, 0.105f, 0.225f, 1); 49 | Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); 50 | camera.update(); 51 | batch.setProjectionMatrix(camera.combined); 52 | if (options.gameState != GameOptions.STATE_GAME && options.gameState != GameOptions.STATE_PAUSED) gameScreen.resetGame(); 53 | if (options.gameState == GameOptions.STATE_MENU) menuScreen.render(batch); 54 | if (options.gameState == GameOptions.STATE_GAME) gameScreen.render(batch); 55 | if (options.gameState == GameOptions.STATE_CREDITS) creditsScreen.render(batch); 56 | 57 | } 58 | } 59 | 60 | 61 | -------------------------------------------------------------------------------- /core/src/at/juggle/games/memory/MenuScreen.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012-2014 Mathias Lux, mathias@juggle.at 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package at.juggle.games.memory; 17 | 18 | import com.badlogic.gdx.Gdx; 19 | import com.badlogic.gdx.Input; 20 | import com.badlogic.gdx.graphics.Color; 21 | import com.badlogic.gdx.graphics.Texture; 22 | import com.badlogic.gdx.graphics.g2d.BitmapFont; 23 | import com.badlogic.gdx.graphics.g2d.GlyphLayout; 24 | import com.badlogic.gdx.graphics.g2d.SpriteBatch; 25 | 26 | /** 27 | * @author Mathias Lux, mathias@juggle.at 28 | * Date: 13.02.12 29 | * Time: 10:09 30 | */ 31 | public class MenuScreen extends AbstractScreen { 32 | private float l, h; 33 | private Texture logoTexture; 34 | private float scaleFont = 1f; 35 | GlyphLayout fontLayout = new GlyphLayout(); 36 | 37 | public MenuScreen(AssetManager assets) { 38 | super(assets); 39 | // adapt menu font to smaller screens: 40 | if (MemoryGame.HEIGHT < 479) scaleFont = 0.8f; 41 | } 42 | 43 | @Override 44 | public void render(SpriteBatch spriteBatch) { 45 | assets.font.getData().setScale(scaleFont, scaleFont); 46 | assets.font.getRegion().getTexture().setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear); 47 | h = MemoryGame.HEIGHT; 48 | l = assets.font.getLineHeight() * scaleFont + 18; 49 | 50 | if (Gdx.input.justTouched()) { 51 | // (x,y) from top left corner 52 | float x = Gdx.input.getX()/ ((float) Gdx.graphics.getWidth())* ((float) MemoryGame.WIDTH); 53 | float y = Gdx.input.getY()/ ((float) Gdx.graphics.getHeight())* ((float) MemoryGame.HEIGHT); 54 | if (x > l && x < 2 * MemoryGame.WIDTH / 3) { 55 | if (y > l + 5 && y < 2 * l - 10) { // new Game 56 | assets.options.gameState = GameOptions.STATE_GAME; 57 | } else if (y > 2 * l + 5 && y < 3 * l - 10) { // number of cards changed 58 | assets.options.nextNumberOfCards(); 59 | } else if (y > 3 * l + 5 && y < 4 * l - 10) { // Mode 60 | assets.options.toggleGameMode(); 61 | } else if (y > 4 * l + 5 && y < 5 * l - 10) { // Sound 62 | assets.options.toggleSoundOn(); 63 | } else if (y > 5 * l + 5 && y < 6 * l - 10) { // credits 64 | assets.options.gameState = GameOptions.STATE_CREDITS; 65 | } 66 | } 67 | } 68 | 69 | // key listener ... 70 | if (assets.options.buttonPressTimeout < 0) { 71 | if (Gdx.input.isKeyPressed(Input.Keys.ESCAPE) || Gdx.input.isKeyPressed(Input.Keys.BACK)) { // use the back button 72 | Gdx.app.exit(); 73 | } 74 | } else assets.options.buttonPressTimeout -= Gdx.graphics.getDeltaTime(); 75 | 76 | // do the drawing ... 77 | spriteBatch.begin(); 78 | // draw background ... 79 | spriteBatch.draw(assets.background, 0, 0, MemoryGame.WIDTH, MemoryGame.HEIGHT); 80 | 81 | spriteBatch.setColor(Color.WHITE); 82 | if (MemoryGame.WIDTH / 3 - 20 < assets.logo.getWidth()) { // draw logo scaled 83 | float logoWidth = (int) (MemoryGame.WIDTH / 3f - 20f); 84 | spriteBatch.draw(assets.logo, MemoryGame.WIDTH - logoWidth - logoWidth/4, logoWidth/4, logoWidth, logoWidth); 85 | } else { 86 | spriteBatch.draw(assets.logo, MemoryGame.WIDTH - assets.logo.getWidth() - assets.logo.getWidth()/4, assets.logo.getWidth()/4); 87 | } 88 | 89 | 90 | assets.font.draw(spriteBatch, "> New Game", l, h - l); 91 | assets.font.draw(spriteBatch, "> Cards: ", l, h - 2 * l); 92 | assets.font.draw(spriteBatch, assets.options.getNumberOfCards() + "", 2 * MemoryGame.WIDTH / 3 - getStringWidth(assets.font, assets.options.getNumberOfCards() + ""), h - 2 * l); 93 | assets.font.draw(spriteBatch, "> Mode: ", l, h - 3 * l); 94 | assets.font.draw(spriteBatch, assets.options.getGameModeString(), 2 * MemoryGame.WIDTH / 3 - getStringWidth(assets.font, assets.options.getGameModeString()), h - 3 * l); 95 | assets.font.draw(spriteBatch, "> Sound: ", l, h - 4 * l); 96 | assets.font.draw(spriteBatch, (assets.options.soundOn)?"On":"Off", 2 * MemoryGame.WIDTH / 3 - getStringWidth(assets.font, (assets.options.soundOn)?"On":"Off"), h - 4 * l); 97 | assets.font.draw(spriteBatch, "> Credits", l, h - 5 * l); 98 | 99 | spriteBatch.end(); 100 | } 101 | 102 | private float getStringWidth(BitmapFont font, String str) { 103 | fontLayout.setText(font, str); 104 | return fontLayout.width; 105 | } 106 | 107 | private float getStringHeight(BitmapFont font, String str) { 108 | fontLayout.setText(font, str); 109 | return fontLayout.height; 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /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/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/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.10-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 'at.juggle.games.memory.GdxDefinition' 11 | devModules 'at.juggle.games.memory.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/at/juggle/games/memory/GdxDefinition.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /html/src/at/juggle/games/memory/GdxDefinitionSuperdev.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /html/src/at/juggle/games/memory/client/HtmlLauncher.java: -------------------------------------------------------------------------------- 1 | package at.juggle.games.memory.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 at.juggle.games.memory.MemoryGame; 7 | 8 | public class HtmlLauncher extends GwtApplication { 9 | 10 | @Override 11 | public GwtApplicationConfiguration getConfig () { 12 | return new GwtApplicationConfiguration(1280, 720); 13 | } 14 | 15 | @Override 16 | public ApplicationListener createApplicationListener () { 17 | return new MemoryGame(); 18 | } 19 | } -------------------------------------------------------------------------------- /html/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /html/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Memory 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 32 | 33 | -------------------------------------------------------------------------------- /html/webapp/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/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 = "at.juggle.games.memory.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/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/ios/data/Default-375w-667h@2x.png -------------------------------------------------------------------------------- /ios/data/Default-414w-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/ios/data/Default-414w-736h@3x.png -------------------------------------------------------------------------------- /ios/data/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/ios/data/Default-568h@2x.png -------------------------------------------------------------------------------- /ios/data/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/ios/data/Default.png -------------------------------------------------------------------------------- /ios/data/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/ios/data/Default@2x.png -------------------------------------------------------------------------------- /ios/data/Default@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/ios/data/Default@2x~ipad.png -------------------------------------------------------------------------------- /ios/data/Default~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/ios/data/Default~ipad.png -------------------------------------------------------------------------------- /ios/data/Icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/ios/data/Icon-72.png -------------------------------------------------------------------------------- /ios/data/Icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/ios/data/Icon-72@2x.png -------------------------------------------------------------------------------- /ios/data/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/ios/data/Icon.png -------------------------------------------------------------------------------- /ios/data/Icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/ios/data/Icon@2x.png -------------------------------------------------------------------------------- /ios/robovm.properties: -------------------------------------------------------------------------------- 1 | app.version=1.0 2 | app.id=at.juggle.games.memory.IOSLauncher 3 | app.mainclass=at.juggle.games.memory.IOSLauncher 4 | app.executable=IOSLauncher 5 | app.build=1 6 | app.name=Memory 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.graphics.g3d.particles.** 23 | com.android.okhttp.HttpHandler 24 | com.android.okhttp.HttpsHandler 25 | com.android.org.conscrypt.** 26 | com.android.org.bouncycastle.jce.provider.BouncyCastleProvider 27 | com.android.org.bouncycastle.jcajce.provider.keystore.BC$Mappings 28 | com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi 29 | com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi$Std 30 | com.android.org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi 31 | com.android.org.bouncycastle.crypto.digests.AndroidDigestFactoryOpenSSL 32 | org.apache.harmony.security.provider.cert.DRLCertFactory 33 | org.apache.harmony.security.provider.crypto.CryptoProvider 34 | 35 | 36 | z 37 | 38 | 39 | UIKit 40 | OpenGLES 41 | QuartzCore 42 | CoreGraphics 43 | OpenAL 44 | AudioToolbox 45 | AVFoundation 46 | 47 | 48 | -------------------------------------------------------------------------------- /ios/src/at/juggle/games/memory/IOSLauncher.java: -------------------------------------------------------------------------------- 1 | package at.juggle.games.memory; 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 at.juggle.games.memory.MemoryGame; 9 | 10 | public class IOSLauncher extends IOSApplication.Delegate { 11 | @Override 12 | protected IOSApplication createApplication() { 13 | IOSApplicationConfiguration config = new IOSApplicationConfiguration(); 14 | return new IOSApplication(new MemoryGame(), 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 | } -------------------------------------------------------------------------------- /media/Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/media/Logo.png -------------------------------------------------------------------------------- /media/Logo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/media/Logo.psd -------------------------------------------------------------------------------- /media/Logo_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/media/Logo_512.png -------------------------------------------------------------------------------- /media/card.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/media/card.psd -------------------------------------------------------------------------------- /media/new-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/media/new-logo.png -------------------------------------------------------------------------------- /media/new-logo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dermotte/memory-game-android/3d1e3dfc925df667911d547a62f911e471f83cd4/media/new-logo.psd -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include 'desktop', 'android', 'ios', 'html', 'core' --------------------------------------------------------------------------------