├── .gitignore ├── LICENSE ├── README.md ├── android ├── AndroidManifest.xml ├── atlasGenerator.sh ├── default.properties ├── libs │ ├── armeabi-v7a │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ └── libgdx.so │ ├── armeabi │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ └── libgdx.so │ ├── desktop │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ ├── gdx.dll │ │ ├── gdx64.dll │ │ ├── libgdx.dylib │ │ ├── libgdx.so │ │ ├── libgdx64.dylib │ │ └── libgdx64.so │ └── x86 │ │ ├── META-INF │ │ └── MANIFEST.MF │ │ └── libgdx.so ├── pom.xml ├── proguard.cfg ├── res │ ├── drawable-hdpi │ │ └── icon.png │ ├── drawable-ldpi │ │ └── icon.png │ ├── drawable-mdpi │ │ └── icon.png │ └── values │ │ └── strings.xml ├── src │ └── main │ │ └── java │ │ └── net │ │ └── javaci │ │ └── mobile │ │ └── bomberman │ │ └── android │ │ └── BomberManActivity.java └── tools │ ├── gdx-tools.jar │ └── gdx.jar ├── assets └── libgdx-logo.png ├── bomberman-desktop-1.0-SNAPSHOT-jar-with-dependencies.jar ├── bomberman-iosrobovm ├── Info.plist.xml ├── libs │ ├── App42MultiPlayerGamingSDK-1.5.jar │ ├── gdx-1.0-20140109.jar │ ├── gdx-backend-robovm.jar │ ├── ios │ │ ├── libObjectAL.a │ │ └── libgdx.a │ └── stagebuilder-core-1.0-20140117.152927-136.jar ├── robovm.properties ├── robovm.xml └── src │ └── net │ └── javaci │ └── mobile │ └── bomberman │ └── ios │ └── RobovmLauncher.java ├── core ├── pom.xml └── src │ ├── main │ └── java │ │ └── net │ │ └── javaci │ │ └── mobile │ │ └── bomberman │ │ └── core │ │ ├── BomberManGame.java │ │ ├── Constants.java │ │ ├── GameFactory.java │ │ ├── Synchronizer.java │ │ ├── Test.java │ │ ├── World.java │ │ ├── mediator │ │ ├── BomberManMediator.java │ │ ├── GameScreenMediator.java │ │ └── LobbyScreenMediator.java │ │ ├── models │ │ ├── BombModel.java │ │ ├── GameObjectModel.java │ │ ├── GhostModel.java │ │ ├── GhostMovement.java │ │ ├── LabyrinthModel.java │ │ └── PlayerModel.java │ │ ├── net │ │ ├── NetworkInterface.java │ │ ├── NetworkListenerAdapter.java │ │ ├── appwarp │ │ │ ├── AppWarpClient.java │ │ │ ├── NotifyListenerAdapter.java │ │ │ ├── RoomRequestListenerAdapter.java │ │ │ └── ZoneRequestListenerAdapter.java │ │ ├── models │ │ │ └── RoomModel.java │ │ └── protocol │ │ │ ├── ClockSyncReqCommand.java │ │ │ ├── ClockSyncResCommand.java │ │ │ ├── Command.java │ │ │ ├── CommandFactory.java │ │ │ ├── CreateGameCommand.java │ │ │ ├── DropBombCommand.java │ │ │ ├── ExplodeBombCommand.java │ │ │ ├── GameEndCommand.java │ │ │ ├── GhostCaughtCommand.java │ │ │ ├── MoveCommand.java │ │ │ ├── MoveEndCommand.java │ │ │ ├── MoveGhostCommand.java │ │ │ ├── StartGameCommand.java │ │ │ └── UndefinedCommand.java │ │ ├── server │ │ └── GameServer.java │ │ ├── session │ │ └── UserSession.java │ │ ├── util │ │ ├── AudioManager.java │ │ └── Log.java │ │ └── view │ │ ├── BomberManScreen.java │ │ ├── GameScreen.java │ │ ├── LobbyScreen.java │ │ ├── SplashScreen.java │ │ └── widget │ │ ├── BombWidget.java │ │ ├── BombermanWidget.java │ │ ├── DeadGhostWidget.java │ │ ├── ExplosionWidget.java │ │ ├── GameListWidget.java │ │ ├── GameListWidgetConfig.java │ │ ├── GameWidget.java │ │ ├── GhostWidget.java │ │ └── LabyrinthWidget.java │ └── test │ └── java │ └── net │ └── javaci │ └── mobile │ └── bomberman │ └── core │ └── net │ └── appwarp │ ├── AppWarpClientTest.java │ └── TestClient.java ├── desktop ├── assets │ ├── images │ │ └── 1280x800 │ │ │ ├── 26pt.fnt │ │ │ ├── 26pt.png │ │ │ ├── 40pt_title.fnt │ │ │ ├── 40pt_title.png │ │ │ ├── Common.atlas │ │ │ ├── Common.png │ │ │ ├── LoadingBar.atlas │ │ │ ├── LoadingBar.png │ │ │ ├── large.fnt │ │ │ ├── large.png │ │ │ ├── normal.fnt │ │ │ ├── normal.png │ │ │ ├── pixelfont_26.fnt │ │ │ ├── pixelfont_26.png │ │ │ ├── small.fnt │ │ │ ├── small.png │ │ │ ├── splash_logo.png │ │ │ ├── uiskin.atlas │ │ │ ├── uiskin.json │ │ │ └── uiskin.png │ ├── layout │ │ ├── GameListItem.xml │ │ ├── GameScreen.xml │ │ ├── LobbyScreen.xml │ │ └── Popup.xml │ └── sound │ │ ├── boom.ogg │ │ ├── dropBomb.ogg │ │ ├── dying.ogg │ │ ├── justDied.mp3 │ │ ├── levelStart.mp3 │ │ └── mainTheme.ogg ├── content │ └── 1280x800 │ │ └── Common │ │ ├── background.png │ │ ├── blueButton.png │ │ ├── blueButtonH.png │ │ ├── bomb1.png │ │ ├── bomb2.png │ │ ├── bomb3.png │ │ ├── bomb4.png │ │ ├── bomb5.png │ │ ├── bomb6.png │ │ ├── bombButton.png │ │ ├── bomberman_lost.png │ │ ├── bomberman_win.png │ │ ├── brick.png │ │ ├── btnEmpty.png │ │ ├── btnEmpty_H.png │ │ ├── buttonJoin.png │ │ ├── explosion1.png │ │ ├── explosion2.png │ │ ├── explosion3.png │ │ ├── explosion4.png │ │ ├── explosion5.png │ │ ├── explosion6.png │ │ ├── explosion7.png │ │ ├── explosion8.png │ │ ├── explosion9.png │ │ ├── gamePadDown.png │ │ ├── gamePadDownH.png │ │ ├── gamePadLeft.png │ │ ├── gamePadLeftH.png │ │ ├── gamePadRight.png │ │ ├── gamePadRightH.png │ │ ├── gamePadUp.png │ │ ├── gamePadUpH.png │ │ ├── ghost1dead1.png │ │ ├── ghost1dead2.png │ │ ├── ghost1dead3.png │ │ ├── ghost1move1.png │ │ ├── ghost1move2.png │ │ ├── ghost1move3.png │ │ ├── ghost2dead1.png │ │ ├── ghost2dead2.png │ │ ├── ghost2dead3.png │ │ ├── ghost2move1.png │ │ ├── ghost2move2.png │ │ ├── ghost2move3.png │ │ ├── girl1down1.png │ │ ├── girl1down2.png │ │ ├── girl1down3.png │ │ ├── girl1left1.png │ │ ├── girl1left2.png │ │ ├── girl1left3.png │ │ ├── girl1right1.png │ │ ├── girl1right2.png │ │ ├── girl1right3.png │ │ ├── girl1up1.png │ │ ├── girl1up2.png │ │ ├── girl1up3.png │ │ ├── girl2down1.png │ │ ├── girl2down2.png │ │ ├── girl2down3.png │ │ ├── girl2left1.png │ │ ├── girl2left2.png │ │ ├── girl2left3.png │ │ ├── girl2right1.png │ │ ├── girl2right2.png │ │ ├── girl2right3.png │ │ ├── girl2up1.png │ │ ├── girl2up2.png │ │ ├── girl2up3.png │ │ ├── girl3down1.png │ │ ├── girl3down2.png │ │ ├── girl3down3.png │ │ ├── girl3left1.png │ │ ├── girl3left2.png │ │ ├── girl3left3.png │ │ ├── girl3right1.png │ │ ├── girl3right2.png │ │ ├── girl3right3.png │ │ ├── girl3up1.png │ │ ├── girl3up2.png │ │ ├── girl3up3.png │ │ ├── girl4down1.png │ │ ├── girl4down2.png │ │ ├── girl4down3.png │ │ ├── girl4left1.png │ │ ├── girl4left2.png │ │ ├── girl4left3.png │ │ ├── girl4right1.png │ │ ├── girl4right2.png │ │ ├── girl4right3.png │ │ ├── girl4up1.png │ │ ├── girl4up2.png │ │ ├── girl4up3.png │ │ ├── greenButton.png │ │ ├── greenButtonH.png │ │ ├── join.png │ │ ├── panelBackground.png │ │ ├── popupSmallBg.png │ │ ├── powerUp_bomb.png │ │ ├── rip.png │ │ ├── settingIcon.png │ │ ├── settingIconH.png │ │ ├── starSmall.png │ │ ├── sunshine.png │ │ └── wall.png ├── pom.xml └── src │ └── main │ └── java │ └── net │ └── javaci │ └── mobile │ └── bomberman │ └── java │ └── BombermanDesktop.java ├── html ├── pom.xml └── src │ └── main │ ├── java │ └── net │ │ └── javaci │ │ └── mobile │ │ └── bomberman │ │ ├── Test.gwt.xml │ │ └── html │ │ └── TestHtml.java │ └── webapp │ ├── WEB-INF │ └── web.xml │ ├── favicon.ico │ └── index.html ├── ios ├── Info.plist ├── Main.cs ├── bomberman.csproj ├── bomberman.sln ├── pom.xml └── touch-icon-57x57.png └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | # built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # files for the dex VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # generated files 12 | bin/ 13 | gen/ 14 | 15 | # Local configuration file (sdk path, etc) 16 | local.properties 17 | 18 | # Eclipse project files 19 | .classpath 20 | .project 21 | .settings 22 | # Proguard folder generated by Eclipse 23 | proguard/ 24 | 25 | # Intellij project files 26 | *.iml 27 | *.ipr 28 | *.iws 29 | .idea/ 30 | 31 | android/target 32 | core/target 33 | desktop/target 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Multiplayer Bomberman 2 | ========= 3 | 4 | This project is coded in 4 days for company internal competition. 5 | 6 | We used [libGDX](http://libgdx.badlogicgames.com) for OpenGL ES on Android, [libgdx stagebuilder](https://github.com/peakgames/libgdx-stagebuilder) which is opensource project, and AppWarp (appwarp.shephertz.com) for multiplayer server 7 | 8 | Running Project 9 | ------ 10 | 11 | Download App Warp Java SDK from http://www.shephertz.com/downloads/appwarp-downloads.php and extract files. 12 | 13 | Add App Warp Client dependency to your local maven repository by running below command 14 | 15 | ```java 16 | mvn install:install-file -Dfile=App42MultiPlayerGamingSDK.jar -DgroupId=com.shephertz.app42.gaming -DartifactId=multiplayer-client -Dversion=1.5.2 -Dpackaging=jar 17 | ``` 18 | 19 | Then, clone https://github.com/peakgames/libgdx-stagebuilder project and run below command 20 | 21 | ```java 22 | mvn install -Dmaven.test.skip 23 | ``` 24 | 25 | After then, you can open the project by IntelliJ or Eclipse and run BombermanDesktop 26 | If you want to run on device, connect your device and run below command 27 | ```java 28 | mvn clean install -Pandroid 29 | ``` 30 | 31 | ![Lobby Screen](https://raw.githubusercontent.com/firstthumb/Bomberman/mvn_repo/screenshots/1.png "Lobby Screen") 32 | ![Waiting Game Start](https://raw.githubusercontent.com/firstthumb/Bomberman/mvn_repo/screenshots/2.png "Waiting Game Start") 33 | ![Game Screen](https://raw.githubusercontent.com/firstthumb/Bomberman/mvn_repo/screenshots/3.png "Game Screen") 34 | ![Game Controller Selection](https://raw.githubusercontent.com/firstthumb/Bomberman/mvn_repo/screenshots/4.png "Game Controller Selection") 35 | -------------------------------------------------------------------------------- /android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /android/atlasGenerator.sh: -------------------------------------------------------------------------------- 1 | java -cp tools/gdx.jar:tools/gdx-tools.jar com.badlogic.gdx.tools.imagepacker.TexturePacker2 ../desktop/content/1280x800/Common ../desktop/assets/images/1280x800/ Common 2 | 3 | -------------------------------------------------------------------------------- /android/default.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 use, 7 | # "build.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-11 12 | -------------------------------------------------------------------------------- /android/libs/armeabi-v7a/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Created-By: 24.60-b09 (Oracle Corporation) 3 | Archiver-Version: Plexus Archiver 4 | 5 | -------------------------------------------------------------------------------- /android/libs/armeabi-v7a/libgdx.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/android/libs/armeabi-v7a/libgdx.so -------------------------------------------------------------------------------- /android/libs/armeabi/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Created-By: 24.60-b09 (Oracle Corporation) 3 | Archiver-Version: Plexus Archiver 4 | 5 | -------------------------------------------------------------------------------- /android/libs/armeabi/libgdx.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/android/libs/armeabi/libgdx.so -------------------------------------------------------------------------------- /android/libs/desktop/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Created-By: 24.60-b09 (Oracle Corporation) 3 | Archiver-Version: Plexus Archiver 4 | 5 | -------------------------------------------------------------------------------- /android/libs/desktop/gdx.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/android/libs/desktop/gdx.dll -------------------------------------------------------------------------------- /android/libs/desktop/gdx64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/android/libs/desktop/gdx64.dll -------------------------------------------------------------------------------- /android/libs/desktop/libgdx.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/android/libs/desktop/libgdx.dylib -------------------------------------------------------------------------------- /android/libs/desktop/libgdx.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/android/libs/desktop/libgdx.so -------------------------------------------------------------------------------- /android/libs/desktop/libgdx64.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/android/libs/desktop/libgdx64.dylib -------------------------------------------------------------------------------- /android/libs/desktop/libgdx64.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/android/libs/desktop/libgdx64.so -------------------------------------------------------------------------------- /android/libs/x86/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Created-By: 24.60-b09 (Oracle Corporation) 3 | Archiver-Version: Plexus Archiver 4 | 5 | -------------------------------------------------------------------------------- /android/libs/x86/libgdx.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/android/libs/x86/libgdx.so -------------------------------------------------------------------------------- /android/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class com.android.vending.licensing.ILicensingService 14 | 15 | -keepclasseswithmembernames class * { 16 | native ; 17 | } 18 | 19 | -keepclasseswithmembernames class * { 20 | public (android.content.Context, android.util.AttributeSet); 21 | } 22 | 23 | -keepclasseswithmembernames class * { 24 | public (android.content.Context, android.util.AttributeSet, int); 25 | } 26 | 27 | -keepclassmembers enum * { 28 | public static **[] values(); 29 | public static ** valueOf(java.lang.String); 30 | } 31 | 32 | -keep class * implements android.os.Parcelable { 33 | public static final android.os.Parcelable$Creator *; 34 | } 35 | -------------------------------------------------------------------------------- /android/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/android/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /android/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/android/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /android/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/android/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /android/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | BomberMan 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/java/net/javaci/mobile/bomberman/android/BomberManActivity.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.android; 2 | 3 | import android.os.Bundle; 4 | import android.util.DisplayMetrics; 5 | import com.badlogic.gdx.backends.android.AndroidApplication; 6 | import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; 7 | import net.javaci.mobile.bomberman.core.BomberManGame; 8 | 9 | public class BomberManActivity extends AndroidApplication { 10 | 11 | @Override 12 | public void onCreate(Bundle savedInstanceState) { 13 | super.onCreate(savedInstanceState); 14 | AndroidApplicationConfiguration config = new AndroidApplicationConfiguration(); 15 | 16 | DisplayMetrics metrics = new DisplayMetrics(); 17 | getWindowManager().getDefaultDisplay().getMetrics(metrics); 18 | 19 | BomberManGame game = new BomberManGame(); 20 | game.initialize(metrics.widthPixels, metrics.heightPixels); 21 | 22 | initialize(game, config); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /android/tools/gdx-tools.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/android/tools/gdx-tools.jar -------------------------------------------------------------------------------- /android/tools/gdx.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/android/tools/gdx.jar -------------------------------------------------------------------------------- /assets/libgdx-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/assets/libgdx-logo.png -------------------------------------------------------------------------------- /bomberman-desktop-1.0-SNAPSHOT-jar-with-dependencies.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/bomberman-desktop-1.0-SNAPSHOT-jar-with-dependencies.jar -------------------------------------------------------------------------------- /bomberman-iosrobovm/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 | UIDeviceFamily 28 | 29 | 1 30 | 2 31 | 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /bomberman-iosrobovm/libs/App42MultiPlayerGamingSDK-1.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/bomberman-iosrobovm/libs/App42MultiPlayerGamingSDK-1.5.jar -------------------------------------------------------------------------------- /bomberman-iosrobovm/libs/gdx-1.0-20140109.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/bomberman-iosrobovm/libs/gdx-1.0-20140109.jar -------------------------------------------------------------------------------- /bomberman-iosrobovm/libs/gdx-backend-robovm.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/bomberman-iosrobovm/libs/gdx-backend-robovm.jar -------------------------------------------------------------------------------- /bomberman-iosrobovm/libs/ios/libObjectAL.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/bomberman-iosrobovm/libs/ios/libObjectAL.a -------------------------------------------------------------------------------- /bomberman-iosrobovm/libs/ios/libgdx.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/bomberman-iosrobovm/libs/ios/libgdx.a -------------------------------------------------------------------------------- /bomberman-iosrobovm/libs/stagebuilder-core-1.0-20140117.152927-136.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/bomberman-iosrobovm/libs/stagebuilder-core-1.0-20140117.152927-136.jar -------------------------------------------------------------------------------- /bomberman-iosrobovm/robovm.properties: -------------------------------------------------------------------------------- 1 | # 2 | #Mon Jan 20 11:57:12 EET 2014 3 | app.version=1.0 4 | app.id=net.javaci.mobile.bomberman 5 | app.mainclass=net.javaci.mobile.bomberman.ios.RobovmLauncher 6 | app.executable=RobovmLauncher 7 | app.build=1 8 | app.name=BomberMan 9 | -------------------------------------------------------------------------------- /bomberman-iosrobovm/robovm.xml: -------------------------------------------------------------------------------- 1 | 2 | ${app.executable} 3 | ${app.mainclass} 4 | ios 5 | thumbv7 6 | 7 | 8 | ../desktop/assets 9 | 10 | ** 11 | 12 | true 13 | 14 | 15 | resources 16 | 17 | 18 | 19 | com.badlogic.gdx.scenes.scene2d.ui.* 20 | net.peakgames.mobile.core.ui.widget.* 21 | org.kxml2.io.KXmlSerializer 22 | org.apache.harmony.**.* 23 | com.android.org.bouncycastle.jce.provider.BouncyCastleProvider 24 | com.android.org.bouncycastle.jce.provider.JCEMac$SHA1 25 | 26 | 27 | libs/ios/libgdx.a 28 | libs/ios/libObjectAL.a 29 | 30 | ios 31 | Info.plist.xml 32 | 33 | UIKit 34 | OpenGLES 35 | QuartzCore 36 | CoreGraphics 37 | OpenAL 38 | AudioToolbox 39 | AVFoundation 40 | 41 | -------------------------------------------------------------------------------- /bomberman-iosrobovm/src/net/javaci/mobile/bomberman/ios/RobovmLauncher.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.ios; 2 | 3 | import net.javaci.mobile.bomberman.core.BomberManGame; 4 | 5 | import org.robovm.cocoatouch.foundation.NSAutoreleasePool; 6 | import org.robovm.cocoatouch.uikit.UIApplication; 7 | 8 | import com.badlogic.gdx.backends.iosrobovm.IOSApplication; 9 | import com.badlogic.gdx.backends.iosrobovm.IOSApplicationConfiguration; 10 | 11 | 12 | public class RobovmLauncher extends IOSApplication.Delegate { 13 | 14 | @Override 15 | protected IOSApplication createApplication() { 16 | IOSApplicationConfiguration config = new IOSApplicationConfiguration(); 17 | config.orientationLandscape = true; 18 | config.orientationPortrait = false; 19 | 20 | BomberManGame game = new BomberManGame(); 21 | //game.initialize(960, 640); //iphone 3gs 22 | game.initialize(1136, 640); //iphone 5 23 | //game.initialize(2048, 1536); //ipad retina 24 | 25 | return new IOSApplication(game, config); 26 | } 27 | 28 | public static void main(String[] argv) { 29 | NSAutoreleasePool pool = new NSAutoreleasePool(); 30 | UIApplication.main(argv, null, RobovmLauncher.class); 31 | pool.drain(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /core/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | net.javaci.mobile.bomberman 7 | bomberman 8 | 1.0-SNAPSHOT 9 | 10 | 11 | bomberman-core 12 | jar 13 | Core 14 | 15 | 16 | 17 | com.badlogicgames.gdx 18 | gdx 19 | ${gdx.version} 20 | 21 | 22 | 23 | com.shephertz.app42.gaming 24 | multiplayer-client 25 | 1.5.2 26 | 27 | 28 | 29 | net.peakgames.libgdx 30 | stagebuilder-core 31 | 2.3.3 32 | 33 | 34 | 35 | com.google.android 36 | android 37 | 2.1.2 38 | provided 39 | 40 | 41 | com.badlogicgames.gdx 42 | gdx-backend-lwjgl 43 | ${gdx.version} 44 | test 45 | 46 | 47 | 48 | org.json 49 | json 50 | 20090211 51 | 52 | 53 | 54 | junit 55 | junit 56 | 4.10 57 | test 58 | 59 | 60 | 61 | 62 | 63 | 64 | org.apache.maven.plugins 65 | maven-source-plugin 66 | 67 | 68 | attach-sources 69 | generate-resources 70 | 71 | jar-no-fork 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/BomberManGame.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core; 2 | 3 | 4 | import com.badlogic.gdx.Gdx; 5 | import com.badlogic.gdx.Screen; 6 | import com.badlogic.gdx.math.Vector2; 7 | import net.javaci.mobile.bomberman.core.mediator.GameScreenMediator; 8 | import net.javaci.mobile.bomberman.core.net.NetworkInterface; 9 | import net.javaci.mobile.bomberman.core.net.appwarp.AppWarpClient; 10 | import net.javaci.mobile.bomberman.core.session.UserSession; 11 | import net.javaci.mobile.bomberman.core.util.AudioManager; 12 | import net.javaci.mobile.bomberman.core.view.SplashScreen; 13 | import net.peakgames.libgdx.stagebuilder.core.AbstractGame; 14 | import net.peakgames.libgdx.stagebuilder.core.assets.AssetsInterface; 15 | import net.peakgames.libgdx.stagebuilder.core.services.LocalizationService; 16 | 17 | import java.util.LinkedList; 18 | import java.util.List; 19 | import java.util.Map; 20 | 21 | public class BomberManGame extends AbstractGame { 22 | 23 | public NetworkInterface client = new AppWarpClient(UserSession.getInstance().getUsername()); 24 | private AudioManager audioManager = new AudioManager(); 25 | 26 | public static enum ScreenType { 27 | SPLASH, PLAY, LOBBY 28 | } 29 | 30 | @Override 31 | public List getSupportedResolutions() { 32 | List supportedScreenResolutions = new LinkedList(); 33 | supportedScreenResolutions.add(new Vector2(1280, 800)); 34 | return supportedScreenResolutions; 35 | } 36 | 37 | @Override 38 | public LocalizationService getLocalizationService() { 39 | return new LocalizationService() { 40 | @Override 41 | public String getString(String s) { 42 | // return localizationManager.getString(s); 43 | return ""; 44 | } 45 | 46 | @Override 47 | public String getString(String s, Object... args) { 48 | // return localizationManager.getString(s, args); 49 | return ""; 50 | } 51 | }; 52 | } 53 | 54 | @Override 55 | public void create() { 56 | Screen splashScreen = new SplashScreen(this); 57 | setScreen(splashScreen); 58 | Gdx.input.setCatchBackKey(true); 59 | configureAssetLoader(); 60 | audioManager.initialize(); 61 | } 62 | 63 | 64 | private void configureAssetLoader() { 65 | AssetsInterface assets = getAssetsInterface(); 66 | // assets.addAssetConfiguration(LobbyScreen.class.getSimpleName(), Constants.LOBBY_ATLAS, TextureAtlas.class); 67 | } 68 | 69 | public void switchScreen(final ScreenType screenType, final Map parameters) { 70 | Gdx.app.postRunnable(new Runnable() { 71 | @Override 72 | public void run() { 73 | displayLoadingWidget(); 74 | switch (screenType) { 75 | case PLAY: 76 | GameScreenMediator mediator = new GameScreenMediator(BomberManGame.this, client); 77 | addScreen(mediator.createScreen()); 78 | break; 79 | 80 | default: 81 | break; 82 | } 83 | } 84 | }); 85 | } 86 | 87 | private void displayLoadingWidget() { 88 | Screen screen = getScreen(); 89 | if (screen instanceof BomberManGame) { 90 | ((BomberManGame)screen).displayLoadingWidget(); 91 | } 92 | } 93 | 94 | private void removeLoadingWidget() { 95 | Screen screen = getScreen(); 96 | if (screen instanceof BomberManGame) { 97 | ((BomberManGame)screen).removeLoadingWidget(); 98 | } 99 | } 100 | 101 | private String getScreenResolution() { 102 | return Gdx.graphics.getWidth() + "x" + Gdx.graphics.getHeight(); 103 | } 104 | 105 | public NetworkInterface getClient() { 106 | return client; 107 | } 108 | 109 | public AudioManager getAudioManager() { 110 | return this.audioManager; 111 | } 112 | 113 | } 114 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/Constants.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core; 2 | 3 | 4 | public class Constants { 5 | public static final String COMMON_ATLAS = "Common.atlas"; 6 | public static final String LOADING_BAR_ATLAS = "LoadingBar.atlas"; 7 | public static final String SKIN_ATLAS = "uiskin.atlas"; 8 | public static final String FONT_26 = "26pt.fnt"; 9 | 10 | public static final String LOADING_WIDGET_BACKGROUND = "loading_back"; 11 | public static final String LOADING_WIDGET_BAR = "loading_bar"; 12 | public static final long LOADING_WIDGET_TIMEOUT = 15000; 13 | } 14 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/GameFactory.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class GameFactory { 7 | public static class GameModel { 8 | public int numGhosts; 9 | public int numBricks; 10 | public int numBomb; 11 | } 12 | 13 | private static Map gameModels = new HashMap(); 14 | 15 | static { 16 | GameModel level1 = new GameModel(); 17 | level1.numGhosts = 10; 18 | level1.numBricks = 10; 19 | level1.numBomb = 2; 20 | gameModels.put(1, level1); 21 | } 22 | 23 | public static GameModel getGameModel(int level) { 24 | return gameModels.get(level); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/Synchronizer.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core; 2 | 3 | import net.javaci.mobile.bomberman.core.net.NetworkListenerAdapter; 4 | import net.javaci.mobile.bomberman.core.net.appwarp.AppWarpClient; 5 | import net.javaci.mobile.bomberman.core.net.models.RoomModel; 6 | import net.javaci.mobile.bomberman.core.net.protocol.ClockSyncReqCommand; 7 | import net.javaci.mobile.bomberman.core.net.protocol.ClockSyncResCommand; 8 | import net.javaci.mobile.bomberman.core.net.protocol.Command; 9 | import net.javaci.mobile.bomberman.core.net.protocol.CommandFactory; 10 | 11 | import java.util.*; 12 | 13 | public class Synchronizer { 14 | public static final int MAX_NUMBER_OF_SYNC_MESSAGES = 21; 15 | private AppWarpClient appWarpClient; 16 | private CommandFactory commandFactory; 17 | private Map clockDiffs = Collections.synchronizedMap(new HashMap()); 18 | private Map syncMessageCountPerUser = Collections.synchronizedMap(new HashMap()); 19 | private Map> collectedClockDiffsPerUser = Collections.synchronizedMap(new HashMap>()); 20 | private Map waitingSyncRequests = Collections.synchronizedMap(new HashMap()); 21 | 22 | public Synchronizer(AppWarpClient appWarpClient, final CommandFactory commandFactory) { 23 | this.appWarpClient = appWarpClient; 24 | this.commandFactory = commandFactory; 25 | 26 | this.appWarpClient.addNetworkListener(new NetworkListenerAdapter() { 27 | 28 | @Override 29 | public void onPlayerJoinedRoom(RoomModel room, String playerName) { 30 | startSyncClocksWithPlayer(playerName); 31 | } 32 | 33 | @Override 34 | public void onMessageReceived(String from, String message) { 35 | Command command = commandFactory.createCommand(message); 36 | switch (command.getCommand()) { 37 | case Command.CLOCK_SYNC_REQ: 38 | handleClockSyncRequest((ClockSyncReqCommand) command); 39 | break; 40 | case Command.CLOCK_SYNC_RES: 41 | handleClockSyncResponse((ClockSyncResCommand) command); 42 | break; 43 | default: 44 | //log 45 | 46 | } 47 | } 48 | }); 49 | } 50 | 51 | private void handleClockSyncRequest(ClockSyncReqCommand command) { 52 | log("Clock sync req. received : " + command); 53 | ClockSyncResCommand clockSyncResCommand = new ClockSyncResCommand(); 54 | clockSyncResCommand.setFromUser(appWarpClient.getUsername()); 55 | clockSyncResCommand.setInitialTimestamp(command.getTimestamp()); 56 | appWarpClient.sendMessageTo(command.getFromUser(), clockSyncResCommand.serialize()); 57 | } 58 | 59 | private void handleClockSyncResponse(ClockSyncResCommand command) { 60 | log("Clock sync res. received : " + command); 61 | String targetUser = command.getFromUser(); 62 | long now = System.currentTimeMillis(); 63 | long roundTripTime = now - command.getInitialTimestamp(); 64 | System.out.println("Round Trip Time : " + roundTripTime); 65 | long peerClock = command.getTimestamp() + roundTripTime / 2; 66 | int diff = (int)(now - peerClock); 67 | List list = this.collectedClockDiffsPerUser.get(targetUser); 68 | if (list == null) { 69 | list = new ArrayList(); 70 | this.collectedClockDiffsPerUser.put(targetUser, list); 71 | } 72 | list.add(diff); 73 | 74 | int count = 0; 75 | if (this.syncMessageCountPerUser.containsKey(targetUser)) { 76 | count = this.syncMessageCountPerUser.get(targetUser); 77 | } 78 | count = count + 1; 79 | this.syncMessageCountPerUser.put(targetUser, count); 80 | if (count < MAX_NUMBER_OF_SYNC_MESSAGES) { 81 | startSyncClocksWithPlayer(targetUser); 82 | } else { 83 | calculateAverageClockDiff(targetUser); 84 | } 85 | } 86 | 87 | private void calculateAverageClockDiff(String targetUser) { 88 | //calculate average diff 89 | List list = this.collectedClockDiffsPerUser.get(targetUser); 90 | Collections.sort(list); 91 | Integer clockDiff = list.get((list.size() / 2 + 1)); 92 | log("Average clock diff for user " + targetUser + " is " + clockDiff); 93 | this.clockDiffs.put(targetUser, clockDiff); 94 | } 95 | 96 | private void startSyncClocksWithPlayer(String playerName) { 97 | ClockSyncReqCommand clockSyncCommand = new ClockSyncReqCommand(); 98 | clockSyncCommand.setFromUser(this.appWarpClient.getUsername()); 99 | waitingSyncRequests.put(playerName, clockSyncCommand); 100 | appWarpClient.sendMessageTo(playerName, clockSyncCommand.serialize()); 101 | } 102 | 103 | private void log(String message) { 104 | System.out.println(System.currentTimeMillis() + " - " + message); 105 | } 106 | 107 | public long getClockDiff(String username) { 108 | if (clockDiffs.containsKey(username)) { 109 | return clockDiffs.get(username); 110 | } 111 | return 0; 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/Test.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core; 2 | 3 | import com.badlogic.gdx.ApplicationListener; 4 | import com.badlogic.gdx.Gdx; 5 | import com.badlogic.gdx.graphics.GL20; 6 | import com.badlogic.gdx.graphics.Texture; 7 | import com.badlogic.gdx.graphics.g2d.SpriteBatch; 8 | 9 | public class Test implements ApplicationListener { 10 | Texture texture; 11 | SpriteBatch batch; 12 | float elapsed; 13 | 14 | @Override 15 | public void create () { 16 | texture = new Texture(Gdx.files.internal("libgdx-logo.png")); 17 | batch = new SpriteBatch(); 18 | } 19 | 20 | @Override 21 | public void resize (int width, int height) { 22 | } 23 | 24 | @Override 25 | public void render () { 26 | elapsed += Gdx.graphics.getDeltaTime(); 27 | Gdx.gl.glClearColor(0, 0, 0, 0); 28 | Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); 29 | batch.begin(); 30 | batch.draw(texture, 100+100*(float)Math.cos(elapsed), 100+25*(float)Math.sin(elapsed)); 31 | batch.end(); 32 | } 33 | 34 | @Override 35 | public void pause () { 36 | } 37 | 38 | @Override 39 | public void resume () { 40 | } 41 | 42 | @Override 43 | public void dispose () { 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/mediator/BomberManMediator.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.mediator; 2 | 3 | import net.javaci.mobile.bomberman.core.BomberManGame; 4 | import net.javaci.mobile.bomberman.core.view.BomberManScreen; 5 | 6 | public abstract class BomberManMediator { 7 | 8 | protected BomberManGame game; 9 | protected BomberManScreen screen; 10 | 11 | public BomberManMediator(BomberManGame game) { 12 | this.game = game; 13 | } 14 | 15 | public abstract BomberManScreen createScreen(); 16 | 17 | public final void onScreenShowInternal() { 18 | onScreenShow(); 19 | } 20 | 21 | /** 22 | * Override this method if you want to be notified when the screen is shown. 23 | */ 24 | protected void onScreenShow() {} 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/mediator/LobbyScreenMediator.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.mediator; 2 | 3 | import net.javaci.mobile.bomberman.core.BomberManGame; 4 | import net.javaci.mobile.bomberman.core.view.BomberManScreen; 5 | import net.javaci.mobile.bomberman.core.view.LobbyScreen; 6 | 7 | public class LobbyScreenMediator extends BomberManMediator { 8 | 9 | private LobbyScreen lobbyScreen; 10 | 11 | public LobbyScreenMediator(BomberManGame game) { 12 | super(game); 13 | } 14 | 15 | @Override 16 | public BomberManScreen createScreen() { 17 | this.screen = new LobbyScreen(this.game, this); 18 | this.lobbyScreen = (LobbyScreen) this.screen; 19 | return screen; 20 | } 21 | 22 | @Override 23 | protected void onScreenShow() { 24 | super.onScreenShow(); 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/models/BombModel.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.models; 2 | 3 | import java.util.HashSet; 4 | import java.util.Iterator; 5 | import java.util.Set; 6 | 7 | public class BombModel extends GameObjectModel { 8 | 9 | public static interface BombListener { 10 | public void onBombExploded(BombModel bombModel); 11 | } 12 | 13 | public static enum State { 14 | COUNT_DOWN, EXPLODE 15 | } 16 | 17 | private float remainingSeconds = 5; 18 | private String owner; 19 | private State state = State.COUNT_DOWN; 20 | private Set bombListeners = new HashSet(); 21 | private int id; 22 | private int gridX; 23 | private int gridY; 24 | private boolean activated; 25 | private float activationTime; 26 | 27 | public BombModel(int id) { 28 | this.id = id; 29 | } 30 | 31 | public void addBombListener(BombListener listener) { 32 | this.bombListeners.add(listener); 33 | } 34 | 35 | public void update(float deltaTime) { 36 | this.remainingSeconds -= deltaTime; 37 | if (remainingSeconds <= 0) { 38 | this.state = State.EXPLODE; 39 | for (Iterator iterator = bombListeners.iterator(); iterator.hasNext(); ) { 40 | BombListener bombListener = iterator.next(); 41 | bombListener.onBombExploded(this); 42 | } 43 | this.bombListeners.clear(); 44 | } 45 | } 46 | 47 | public State getState() { 48 | return this.state; 49 | } 50 | 51 | public String getOwner() { 52 | return owner; 53 | } 54 | 55 | public void setOwner(String owner) { 56 | this.owner = owner; 57 | } 58 | 59 | public float getRemainingSeconds() { 60 | return remainingSeconds; 61 | } 62 | 63 | public void setRemainingSeconds(float remainingSeconds) { 64 | this.remainingSeconds = remainingSeconds; 65 | } 66 | 67 | public int getGridX() { 68 | return gridX; 69 | } 70 | 71 | public void setGridX(int gridX) { 72 | this.gridX = gridX; 73 | } 74 | 75 | public int getGridY() { 76 | return gridY; 77 | } 78 | 79 | public void setGridY(int gridY) { 80 | this.gridY = gridY; 81 | } 82 | 83 | public int getId() { 84 | return id; 85 | } 86 | 87 | public boolean isActivated() { 88 | return activated; 89 | } 90 | 91 | public void setActivated(boolean activated) { 92 | this.activated = activated; 93 | } 94 | 95 | public float getActivationTime() { 96 | return activationTime; 97 | } 98 | 99 | public void setActivationTime(float activationTime) { 100 | this.activationTime = activationTime; 101 | } 102 | 103 | @Override 104 | public float getOriginX() { 105 | return x + (width * 0.5f); 106 | } 107 | 108 | @Override 109 | public float getOriginY() { 110 | return y + (height * 0.5f); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/models/GameObjectModel.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.models; 2 | 3 | public abstract class GameObjectModel { 4 | protected float x; 5 | protected float y; 6 | protected float width; 7 | protected float height; 8 | 9 | public abstract float getOriginX(); 10 | 11 | public abstract float getOriginY(); 12 | 13 | public float getX() { 14 | return x; 15 | } 16 | 17 | public void setX(float x) { 18 | this.x = x; 19 | } 20 | 21 | public float getY() { 22 | return y; 23 | } 24 | 25 | public void setY(float y) { 26 | this.y = y; 27 | } 28 | 29 | public float getWidth() { 30 | return width; 31 | } 32 | 33 | public void setWidth(float width) { 34 | this.width = width; 35 | } 36 | 37 | public float getHeight() { 38 | return height; 39 | } 40 | 41 | public void setHeight(float height) { 42 | this.height = height; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/models/GhostModel.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.models; 2 | 3 | import java.util.List; 4 | 5 | public class GhostModel extends GameObjectModel { 6 | public interface GhostListener { 7 | public void onStop(); 8 | public void onCaught(List players); 9 | } 10 | 11 | private GhostListener listener; 12 | 13 | private static int ID = 1; 14 | 15 | // http://strategywiki.org/wiki/Bomberman/How_to_play 16 | public static enum Type { 17 | BALLOOM(1, 100), MINVO(2, 60); 18 | 19 | int value; 20 | int speed; 21 | Type(int value, int speed) { 22 | this.value = value; 23 | this.speed = speed; 24 | } 25 | 26 | public int getValue() { 27 | return value; 28 | } 29 | 30 | public int getSpeed() { 31 | return speed; 32 | } 33 | } 34 | 35 | public static enum State { 36 | STANDING_UP, STANDING_DOWN, STANDING_RIGHT, STANDING_LEFT, WALKING_UP, WALKING_DOWN, WALKING_RIGHT, WALKING_LEFT, DEAD 37 | } 38 | 39 | public static GhostModel createGhostModel(Type type) { 40 | GhostModel ghostModel = new GhostModel(ID++); 41 | ghostModel.setType(type); 42 | return ghostModel; 43 | } 44 | 45 | private int id; 46 | private float speed = 100f; 47 | private int targetGridX = -1; 48 | private int targetGridY = -1; 49 | private int gridX; 50 | private int gridY; 51 | private Type type = Type.BALLOOM; 52 | private State state = State.STANDING_DOWN; 53 | 54 | public GhostModel(int id) { 55 | this.id = id; 56 | } 57 | 58 | public int getId() { 59 | return id; 60 | } 61 | 62 | public void setId(int id) { 63 | this.id = id; 64 | } 65 | 66 | public float getSpeed() { 67 | return speed; 68 | } 69 | 70 | public void setSpeed(float speed) { 71 | this.speed = speed; 72 | } 73 | 74 | public Type getType() { 75 | return type; 76 | } 77 | 78 | public void setType(Type type) { 79 | this.type = type; 80 | this.speed = type.getSpeed(); 81 | } 82 | 83 | public State getState() { 84 | return state; 85 | } 86 | 87 | public void setState(State state) { 88 | this.state = state; 89 | } 90 | 91 | public float getOriginX() { 92 | return this.x + this.width * 0.5f; 93 | } 94 | 95 | public float getOriginY() { 96 | return this.y + this.height * 0.5f; 97 | } 98 | 99 | public int getTargetGridX() { 100 | return targetGridX; 101 | } 102 | 103 | public void setTargetGridX(int targetGridX) { 104 | this.targetGridX = targetGridX; 105 | } 106 | 107 | public int getTargetGridY() { 108 | return targetGridY; 109 | } 110 | 111 | public void setTargetGridY(int targetGridY) { 112 | this.targetGridY = targetGridY; 113 | } 114 | 115 | public int getGridX() { 116 | return gridX; 117 | } 118 | 119 | public void setGridX(int gridX) { 120 | this.gridX = gridX; 121 | } 122 | 123 | public int getGridY() { 124 | return gridY; 125 | } 126 | 127 | public void setGridY(int gridY) { 128 | this.gridY = gridY; 129 | } 130 | 131 | public void setListener(GhostListener listener) { 132 | this.listener = listener; 133 | } 134 | 135 | public GhostListener getListener() { 136 | return listener; 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/models/GhostMovement.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.models; 2 | 3 | import net.javaci.mobile.bomberman.core.view.GameScreen; 4 | 5 | public class GhostMovement { 6 | 7 | private GameScreen.Direction direction; 8 | private int distance; 9 | 10 | public GhostMovement(GameScreen.Direction direction, int distance) { 11 | this.direction = direction; 12 | this.distance = distance; 13 | } 14 | 15 | public GameScreen.Direction getDirection() { 16 | return direction; 17 | } 18 | 19 | public void setDirection(GameScreen.Direction direction) { 20 | this.direction = direction; 21 | } 22 | 23 | public int getDistance() { 24 | return distance; 25 | } 26 | 27 | public void setDistance(int distance) { 28 | this.distance = distance; 29 | } 30 | 31 | public boolean movable(GhostModel ghostModel, byte[][] grid) { 32 | switch (direction) { 33 | case UP: 34 | return grid[ghostModel.getGridX()][ghostModel.getGridY() + 1] == LabyrinthModel.EMPTY; 35 | case DOWN: 36 | return grid[ghostModel.getGridX()][ghostModel.getGridY() - 1] == LabyrinthModel.EMPTY; 37 | case RIGHT: 38 | return grid[ghostModel.getGridX() + 1][ghostModel.getGridY()] == LabyrinthModel.EMPTY; 39 | case LEFT: 40 | return grid[ghostModel.getGridX() - 1][ghostModel.getGridY()] == LabyrinthModel.EMPTY; 41 | } 42 | 43 | return false; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/models/LabyrinthModel.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.models; 2 | 3 | import java.util.Random; 4 | 5 | public class LabyrinthModel { 6 | public static final int NUM_COLS = 21; 7 | public static final int NUM_ROWS = 13; 8 | public static byte EMPTY = 0; 9 | public static byte WALL = 1; 10 | public static byte BRICK = 2; 11 | private byte[][] grid = new byte[NUM_COLS][NUM_ROWS]; 12 | 13 | public LabyrinthModel() { 14 | for (int i = 0; i < NUM_COLS; i++) { 15 | for (int j = 0; j < NUM_ROWS; j++) { 16 | if (i == 0 || (i == NUM_COLS - 1) || j == 0 || j == (NUM_ROWS - 1)) { 17 | grid[i][j] = WALL; 18 | } else if (i % 2 == 0 && j % 2 == 0) { 19 | grid[i][j] = WALL; 20 | } 21 | } 22 | } 23 | // generateBricks(); 24 | } 25 | 26 | public void generateBricks(int totalBrick) { 27 | int numBricks = 0; 28 | Random random = new Random(System.currentTimeMillis()); 29 | while (numBricks < totalBrick) { 30 | int x = random.nextInt(NUM_COLS - 1) + 1; 31 | int y = random.nextInt(NUM_ROWS - 1) + 1; 32 | if (grid[x][y] == EMPTY) { 33 | if ( ! ((x == 1 && y == 1) || (x == 1 && y == 2) || (x == 2 && y == 1)) && 34 | ! ((x == 19 && y == 1) || (x == 19 && y == 2) || (x == 18 && y == 1)) && 35 | ! ((x == 1 && y == 10) || (x == 1 && y == 11) || (x == 2 && y == 11)) && 36 | ! ((x == 19 && y == 10) || (x == 19 && y == 11) || (x == 18 && y == 11))) { 37 | grid[x][y] = BRICK; 38 | numBricks++; 39 | } 40 | } 41 | } 42 | } 43 | 44 | public byte[][] getGrid() { 45 | return grid; 46 | } 47 | 48 | public void setGrid(byte[][] grid) { 49 | this.grid = grid; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/models/PlayerModel.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.models; 2 | 3 | import com.badlogic.gdx.math.Vector2; 4 | 5 | public class PlayerModel extends GameObjectModel { 6 | private float speed = 150f; 7 | private String playerName; 8 | private State state = State.STANDING_DOWN; 9 | private int targetGridX = -1; 10 | private int targetGridY = -1; 11 | //oyunu kuran 1, oyuna ilk katilan oyuncu 2, ikinci katilan 3, son katilan 4 degerini alir. 12 | private int gameIndex; 13 | private boolean caught; 14 | private int lifeCount = 3; 15 | private StateChangeListener stateChangeListener; 16 | private float immortalDuration = 5; 17 | 18 | public void setStateChangeListener(StateChangeListener stateChangeListener) { 19 | this.stateChangeListener = stateChangeListener; 20 | } 21 | 22 | public int getGameIndex() { 23 | return gameIndex; 24 | } 25 | 26 | public void setGameIndex(int gameIndex) { 27 | this.gameIndex = gameIndex; 28 | } 29 | 30 | public int getTargetGridY() { 31 | return targetGridY; 32 | } 33 | 34 | public void setTargetGridY(int targetGridY) { 35 | this.targetGridY = targetGridY; 36 | } 37 | 38 | public int getTargetGridX() { 39 | return targetGridX; 40 | } 41 | 42 | public void setTargetGridX(int targetGridX) { 43 | this.targetGridX = targetGridX; 44 | } 45 | 46 | public float getSpeed() { 47 | return speed; 48 | } 49 | 50 | public void setSpeed(float speed) { 51 | this.speed = speed; 52 | } 53 | 54 | public State getState() { 55 | return state; 56 | } 57 | 58 | public void setState(State state) { 59 | this.state = state; 60 | if (this.stateChangeListener != null) { 61 | this.stateChangeListener.onStateChange(this.state); 62 | } 63 | } 64 | 65 | public String getPlayerName() { 66 | return playerName; 67 | } 68 | 69 | public void setPlayerName(String playerName) { 70 | this.playerName = playerName; 71 | } 72 | 73 | public void setPosition(Vector2 position) { 74 | this.x = position.x; 75 | this.y = position.y; 76 | } 77 | 78 | public float getOriginX() { 79 | return this.x + this.width * 0.5f; 80 | } 81 | 82 | public float getOriginY() { 83 | return this.y + this.height * 0.5f; 84 | } 85 | 86 | public boolean isCaught() { 87 | return caught; 88 | } 89 | 90 | public void setCaught(boolean caught) { 91 | this.caught = caught; 92 | } 93 | 94 | public void decrementLifeCount() { 95 | this.lifeCount = this.lifeCount - 1; 96 | } 97 | 98 | public void setLifeCount(int x) { 99 | this.lifeCount = x; 100 | } 101 | 102 | public int getLifeCount() { 103 | return this.lifeCount; 104 | } 105 | 106 | public static enum State { 107 | STANDING_UP, STANDING_DOWN, STANDING_RIGHT, STANDING_LEFT, 108 | WALKING_UP, WALKING_DOWN, WALKING_RIGHT, WALKING_LEFT, 109 | STOPPING_UP, STOPPING_DOWN, STOPPING_RIGHT, STOPPING_LEFT, DEAD 110 | } 111 | 112 | @Override 113 | public String toString() { 114 | return "PlayerModel{" + 115 | "playerName='" + playerName + '\'' + 116 | ", state=" + state + 117 | ", lifeCount=" + lifeCount + 118 | ", gameIndex=" + gameIndex + 119 | '}'; 120 | } 121 | 122 | public static interface StateChangeListener { 123 | public void onStateChange(State newState); 124 | } 125 | 126 | public void decrementImmortalDuration(float d) { 127 | this.immortalDuration -= d; 128 | } 129 | 130 | public void resetImmortalDuration() { 131 | this.immortalDuration = 5; 132 | } 133 | 134 | public boolean isImmortal() { 135 | return this.immortalDuration > 0; 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/net/NetworkInterface.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net; 2 | 3 | import net.javaci.mobile.bomberman.core.net.models.RoomModel; 4 | 5 | import java.util.List; 6 | 7 | public interface NetworkInterface { 8 | 9 | public static final int MAX_USERS = 4; 10 | 11 | public static interface NetworkListener { 12 | public void onConnected(); 13 | 14 | public void onDisconnected(); 15 | 16 | public void onConnectionFailure(Exception e); 17 | 18 | public void onRoomListReceived(List rooms); 19 | 20 | public void onRoomListRequestFailed(); 21 | 22 | public void onRoomCreated(RoomModel room); 23 | 24 | public void onCreateRoomFailed(); 25 | 26 | public void onRoomDeleted(String roomId); 27 | 28 | public void onDeleteRoomFailed(); 29 | 30 | public void onJoinRoomSuccess(String roomId); 31 | 32 | public void onJoinRoomFailed(); 33 | 34 | public void onMessageReceived(String from, String message); 35 | 36 | public void onPlayerJoinedRoom(RoomModel room, String playerName); 37 | 38 | public void onPlayerLeftRoom(RoomModel room, String playerName); 39 | 40 | public void onRoomInfoReceived(String [] players, String data); 41 | } 42 | 43 | public void addNetworkListener(NetworkListener listener); 44 | 45 | public void removeNetworkListener(NetworkListener listener); 46 | 47 | public void clearNetworkListeners(); 48 | 49 | public void connect(); 50 | 51 | public void disconnect(); 52 | 53 | public void listRooms(); 54 | 55 | public void createRoom(String roomName); 56 | 57 | public void deleteRoom(String roomId); 58 | 59 | public void joinRoom(String roomId); 60 | 61 | public void leaveRoom(String roomId); 62 | 63 | public void sendMessage(String message); 64 | 65 | public void sendMessageTo(String destination, String message); 66 | 67 | public void startGame(String roomId); 68 | 69 | public void getRoomInfo(String roomId); 70 | 71 | public boolean isConnected(); 72 | 73 | } 74 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/net/NetworkListenerAdapter.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net; 2 | 3 | import net.javaci.mobile.bomberman.core.net.models.RoomModel; 4 | 5 | import java.util.List; 6 | 7 | public class NetworkListenerAdapter implements NetworkInterface.NetworkListener { 8 | @Override 9 | public void onConnected() { 10 | 11 | } 12 | 13 | @Override 14 | public void onDisconnected() { 15 | 16 | } 17 | 18 | @Override 19 | public void onConnectionFailure(Exception e) { 20 | 21 | } 22 | 23 | @Override 24 | public void onRoomListReceived(List rooms) { 25 | 26 | } 27 | 28 | @Override 29 | public void onRoomListRequestFailed() { 30 | 31 | } 32 | 33 | @Override 34 | public void onRoomCreated(RoomModel room) { 35 | 36 | } 37 | 38 | @Override 39 | public void onCreateRoomFailed() { 40 | 41 | } 42 | 43 | @Override 44 | public void onRoomDeleted(String roomId) { 45 | 46 | } 47 | 48 | @Override 49 | public void onDeleteRoomFailed() { 50 | 51 | } 52 | 53 | @Override 54 | public void onJoinRoomSuccess(String roomId) { 55 | 56 | } 57 | 58 | @Override 59 | public void onJoinRoomFailed() { 60 | 61 | } 62 | 63 | @Override 64 | public void onMessageReceived(String from, String message) { 65 | 66 | } 67 | 68 | @Override 69 | public void onPlayerJoinedRoom(RoomModel room, String playerName) { 70 | 71 | } 72 | 73 | @Override 74 | public void onPlayerLeftRoom(RoomModel room, String playerName) { 75 | 76 | } 77 | 78 | @Override 79 | public void onRoomInfoReceived(String[] players, String data) { 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/net/appwarp/NotifyListenerAdapter.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net.appwarp; 2 | 3 | 4 | import com.shephertz.app42.gaming.multiplayer.client.events.*; 5 | import com.shephertz.app42.gaming.multiplayer.client.listener.NotifyListener; 6 | 7 | import java.util.HashMap; 8 | 9 | public class NotifyListenerAdapter implements NotifyListener { 10 | @Override 11 | public void onRoomCreated(RoomData roomData) { 12 | 13 | } 14 | 15 | @Override 16 | public void onRoomDestroyed(RoomData roomData) { 17 | 18 | } 19 | 20 | @Override 21 | public void onUserLeftRoom(RoomData roomData, String s) { 22 | 23 | } 24 | 25 | @Override 26 | public void onUserJoinedRoom(RoomData roomData, String s) { 27 | 28 | } 29 | 30 | @Override 31 | public void onUserLeftLobby(LobbyData lobbyData, String s) { 32 | 33 | } 34 | 35 | @Override 36 | public void onUserJoinedLobby(LobbyData lobbyData, String s) { 37 | 38 | } 39 | 40 | @Override 41 | public void onChatReceived(ChatEvent chatEvent) { 42 | 43 | } 44 | 45 | @Override 46 | public void onPrivateChatReceived(String s, String s2) { 47 | 48 | } 49 | 50 | @Override 51 | public void onPrivateUpdateReceived(String s, byte[] bytes, boolean b) { 52 | 53 | } 54 | 55 | @Override 56 | public void onUpdatePeersReceived(UpdateEvent updateEvent) { 57 | 58 | } 59 | 60 | @Override 61 | public void onUserChangeRoomProperty(RoomData roomData, String s, HashMap stringObjectHashMap, HashMap stringStringHashMap) { 62 | 63 | } 64 | 65 | @Override 66 | public void onMoveCompleted(MoveEvent moveEvent) { 67 | 68 | } 69 | 70 | @Override 71 | public void onGameStarted(String s, String s2, String s3) { 72 | 73 | } 74 | 75 | @Override 76 | public void onGameStopped(String s, String s2) { 77 | 78 | } 79 | 80 | @Override 81 | public void onUserPaused(String s, boolean b, String s2) { 82 | 83 | } 84 | 85 | @Override 86 | public void onUserResumed(String s, boolean b, String s2) { 87 | 88 | } 89 | 90 | @Override 91 | public void onNextTurnRequest(String s) { 92 | 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/net/appwarp/RoomRequestListenerAdapter.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net.appwarp; 2 | 3 | import com.shephertz.app42.gaming.multiplayer.client.events.LiveRoomInfoEvent; 4 | import com.shephertz.app42.gaming.multiplayer.client.events.RoomEvent; 5 | import com.shephertz.app42.gaming.multiplayer.client.listener.RoomRequestListener; 6 | 7 | public class RoomRequestListenerAdapter implements RoomRequestListener { 8 | @Override 9 | public void onSubscribeRoomDone(RoomEvent roomEvent) { 10 | 11 | } 12 | 13 | @Override 14 | public void onUnSubscribeRoomDone(RoomEvent roomEvent) { 15 | 16 | } 17 | 18 | @Override 19 | public void onJoinRoomDone(RoomEvent roomEvent) { 20 | 21 | } 22 | 23 | @Override 24 | public void onLeaveRoomDone(RoomEvent roomEvent) { 25 | 26 | } 27 | 28 | @Override 29 | public void onGetLiveRoomInfoDone(LiveRoomInfoEvent liveRoomInfoEvent) { 30 | 31 | } 32 | 33 | @Override 34 | public void onSetCustomRoomDataDone(LiveRoomInfoEvent liveRoomInfoEvent) { 35 | 36 | } 37 | 38 | @Override 39 | public void onUpdatePropertyDone(LiveRoomInfoEvent liveRoomInfoEvent) { 40 | 41 | } 42 | 43 | @Override 44 | public void onLockPropertiesDone(byte b) { 45 | 46 | } 47 | 48 | @Override 49 | public void onUnlockPropertiesDone(byte b) { 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/net/appwarp/ZoneRequestListenerAdapter.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net.appwarp; 2 | 3 | import com.shephertz.app42.gaming.multiplayer.client.events.*; 4 | import com.shephertz.app42.gaming.multiplayer.client.listener.ZoneRequestListener; 5 | 6 | public class ZoneRequestListenerAdapter implements ZoneRequestListener { 7 | @Override 8 | public void onDeleteRoomDone(RoomEvent roomEvent) { 9 | 10 | } 11 | 12 | @Override 13 | public void onGetAllRoomsDone(AllRoomsEvent allRoomsEvent) { 14 | 15 | } 16 | 17 | @Override 18 | public void onCreateRoomDone(RoomEvent roomEvent) { 19 | 20 | } 21 | 22 | @Override 23 | public void onGetOnlineUsersDone(AllUsersEvent allUsersEvent) { 24 | 25 | } 26 | 27 | @Override 28 | public void onGetLiveUserInfoDone(LiveUserInfoEvent liveUserInfoEvent) { 29 | 30 | } 31 | 32 | @Override 33 | public void onSetCustomUserDataDone(LiveUserInfoEvent liveUserInfoEvent) { 34 | 35 | } 36 | 37 | @Override 38 | public void onGetMatchedRoomsDone(MatchedRoomsEvent matchedRoomsEvent) { 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/net/models/RoomModel.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net.models; 2 | 3 | public class RoomModel { 4 | private String id; 5 | private String name; 6 | private String owner; 7 | 8 | public String getOwner() { 9 | return owner; 10 | } 11 | 12 | public void setOwner(String owner) { 13 | this.owner = owner; 14 | } 15 | 16 | public String getId() { 17 | return id; 18 | } 19 | 20 | public void setId(String id) { 21 | this.id = id; 22 | } 23 | 24 | public String getName() { 25 | return name; 26 | } 27 | 28 | public void setName(String name) { 29 | this.name = name; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "RoomModel{" + 35 | "id='" + id + '\'' + 36 | ", name='" + name + '\'' + 37 | ", owner='" + owner + '\'' + 38 | '}'; 39 | } 40 | 41 | @Override 42 | public boolean equals(Object o) { 43 | if (this == o) return true; 44 | if (o == null || getClass() != o.getClass()) return false; 45 | 46 | RoomModel roomModel = (RoomModel) o; 47 | 48 | if (id != null ? !id.equals(roomModel.id) : roomModel.id != null) return false; 49 | 50 | return true; 51 | } 52 | 53 | @Override 54 | public int hashCode() { 55 | return id != null ? id.hashCode() : 0; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/net/protocol/ClockSyncReqCommand.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net.protocol; 2 | 3 | import org.json.JSONException; 4 | import org.json.JSONObject; 5 | 6 | public class ClockSyncReqCommand extends Command { 7 | 8 | public static Command build(JSONObject json) { 9 | ClockSyncReqCommand command = new ClockSyncReqCommand(); 10 | try { 11 | command.parseCommonFields(json); 12 | } catch (JSONException e) { 13 | e.printStackTrace(); 14 | return new UndefinedCommand(json.toString()); 15 | } 16 | return command; 17 | } 18 | 19 | @Override 20 | protected void serializeCustomFields(JSONObject json) throws JSONException { 21 | } 22 | 23 | @Override 24 | public int getCommand() { 25 | return CLOCK_SYNC_REQ; 26 | } 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/net/protocol/ClockSyncResCommand.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net.protocol; 2 | 3 | import org.json.JSONException; 4 | import org.json.JSONObject; 5 | 6 | public class ClockSyncResCommand extends Command { 7 | private long initialTimestamp; 8 | 9 | public static Command build(JSONObject json) { 10 | ClockSyncResCommand command = new ClockSyncResCommand(); 11 | try { 12 | command.parseCommonFields(json); 13 | command.initialTimestamp = json.getLong("initialTimestamp"); 14 | } catch (JSONException e) { 15 | e.printStackTrace(); 16 | return new UndefinedCommand(json.toString()); 17 | } 18 | return command; 19 | } 20 | 21 | public long getInitialTimestamp() { 22 | return initialTimestamp; 23 | } 24 | 25 | public void setInitialTimestamp(long initialTimestamp) { 26 | this.initialTimestamp = initialTimestamp; 27 | } 28 | 29 | @Override 30 | protected void serializeCustomFields(JSONObject json) throws JSONException { 31 | json.put("initialTimestamp", initialTimestamp); 32 | } 33 | 34 | @Override 35 | public int getCommand() { 36 | return CLOCK_SYNC_RES; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/net/protocol/Command.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net.protocol; 2 | 3 | 4 | import org.json.JSONException; 5 | import org.json.JSONObject; 6 | 7 | public abstract class Command { 8 | public static final int CLOCK_SYNC_REQ = 1; 9 | public static final int CLOCK_SYNC_RES = 2; 10 | public static final int MOVE_START = 3; 11 | public static final int MOVE_END = 4; 12 | public static final int START_GAME = 5; 13 | public static final int CREATE_GAME = 6; 14 | public static final int MOVE_GHOST = 7; 15 | public static final int GAME_END = 8; 16 | public static final int DROP_BOMB = 9; 17 | public static final int EXPLODE_BOMB = 10; 18 | public static final int CAUGHT_GHOST= 11; 19 | protected long timestamp; 20 | protected String fromUser; 21 | protected int command; 22 | 23 | public static final int MAX_MESSAGE_LENGTH = 200; 24 | 25 | protected void parseCommonFields(JSONObject json) throws JSONException { 26 | this.timestamp = json.getLong("t"); 27 | this.command = json.getInt("command"); 28 | this.fromUser = json.getString("fromUser"); 29 | } 30 | 31 | public String serialize() { 32 | JSONObject json = new JSONObject(); 33 | try { 34 | this.timestamp = System.currentTimeMillis(); 35 | json.put("t", this.timestamp); 36 | json.put("command", this.getCommand()); 37 | json.put("fromUser", this.fromUser); 38 | serializeCustomFields(json); 39 | } catch (JSONException e) { 40 | e.printStackTrace(); 41 | } 42 | return json.toString(); 43 | } 44 | 45 | public String[] splitMessage(String message) { 46 | if (message.length() > MAX_MESSAGE_LENGTH) { 47 | int id = (int)(Math.random()*1000); 48 | String[] messages = new String[(int)Math.ceil((double)message.length()/MAX_MESSAGE_LENGTH)]; 49 | for (int i=0; i map = messsages.get(messageId); 32 | if (map == null) { 33 | map = new HashMap(); 34 | messsages.put(messageId, map); 35 | } 36 | 37 | map.put(messageIndex, message); 38 | 39 | if (map.size() != messageLength) { 40 | return null; 41 | } 42 | 43 | jsonString = ""; 44 | for (int i=0; i<=messageLength; i++) { 45 | jsonString += map.get(i); 46 | } 47 | 48 | messsages.remove(messageId); 49 | } 50 | 51 | try { 52 | JSONObject json = new JSONObject(jsonString); 53 | int command = json.getInt("command"); 54 | switch (command) { 55 | case Command.CLOCK_SYNC_REQ: 56 | return ClockSyncReqCommand.build(json); 57 | case Command.CLOCK_SYNC_RES: 58 | return ClockSyncResCommand.build(json); 59 | case Command.MOVE_START: 60 | return MoveCommand.build(json); 61 | case Command.MOVE_END: 62 | return MoveEndCommand.build(json); 63 | case Command.CREATE_GAME: 64 | return CreateGameCommand.build(json); 65 | case Command.MOVE_GHOST: 66 | return MoveGhostCommand.build(json); 67 | case Command.GAME_END: 68 | return GameEndCommand.build(json); 69 | case Command.DROP_BOMB: 70 | return DropBombCommand.build(json); 71 | case Command.EXPLODE_BOMB: 72 | return ExplodeBombCommand.build(json); 73 | case Command.CAUGHT_GHOST: 74 | return GhostCaughtCommand.build(json); 75 | case Command.START_GAME: 76 | return StartGameCommand.build(json); 77 | } 78 | } catch (JSONException e) { 79 | e.printStackTrace(); 80 | } 81 | 82 | return new UndefinedCommand(jsonString); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/net/protocol/CreateGameCommand.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net.protocol; 2 | 3 | import net.javaci.mobile.bomberman.core.models.GhostModel; 4 | import org.json.JSONArray; 5 | import org.json.JSONException; 6 | import org.json.JSONObject; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | public class CreateGameCommand extends Command { 12 | 13 | private List ghostModels = new ArrayList(); 14 | private byte [][] grid; 15 | 16 | public static Command build(JSONObject json) { 17 | CreateGameCommand command = new CreateGameCommand(); 18 | try { 19 | command.parseCommonFields(json); 20 | JSONArray jsonArray = json.getJSONArray("ghosts"); 21 | for (int i=0; i ghostModels) { 73 | this.ghostModels = ghostModels; 74 | } 75 | 76 | public List getGhostModels() { 77 | return ghostModels; 78 | } 79 | 80 | public byte[][] getGrid() { 81 | return grid; 82 | } 83 | 84 | @Override 85 | public int getCommand() { 86 | return CREATE_GAME; 87 | } 88 | 89 | public void setGrid(byte[][] grid) { 90 | this.grid = grid; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/net/protocol/DropBombCommand.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net.protocol; 2 | 3 | import org.json.JSONException; 4 | import org.json.JSONObject; 5 | 6 | public class DropBombCommand extends Command { 7 | private int gridX; 8 | private int gridY; 9 | private int id; 10 | 11 | public static Command build(JSONObject json) { 12 | DropBombCommand command = new DropBombCommand(); 13 | try { 14 | command.parseCommonFields(json); 15 | command.gridX = json.getInt("gridX"); 16 | command.gridY = json.getInt("gridY"); 17 | command.id = json.getInt("id"); 18 | } catch (JSONException e) { 19 | e.printStackTrace(); 20 | return new UndefinedCommand(json.toString()); 21 | 22 | } 23 | return command; 24 | } 25 | 26 | public int getGridX() { 27 | return gridX; 28 | } 29 | 30 | public void setGridX(int gridX) { 31 | this.gridX = gridX; 32 | } 33 | 34 | public int getGridY() { 35 | return gridY; 36 | } 37 | 38 | public void setGridY(int gridY) { 39 | this.gridY = gridY; 40 | } 41 | 42 | public int getId() { 43 | return id; 44 | } 45 | 46 | public void setId(int id) { 47 | this.id = id; 48 | } 49 | 50 | @Override 51 | protected void serializeCustomFields(JSONObject json) throws JSONException { 52 | json.put("gridX", gridX); 53 | json.put("gridY", gridY); 54 | json.put("id", id); 55 | } 56 | 57 | @Override 58 | public int getCommand() { 59 | return DROP_BOMB; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/net/protocol/ExplodeBombCommand.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net.protocol; 2 | 3 | import org.json.JSONArray; 4 | import org.json.JSONException; 5 | import org.json.JSONObject; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | public class ExplodeBombCommand extends Command { 11 | private int gridX; 12 | private int gridY; 13 | private int id; 14 | private List explodedPlayers = new ArrayList(); 15 | private List explodedGhosts = new ArrayList(); 16 | 17 | public static Command build(JSONObject json) { 18 | ExplodeBombCommand command = new ExplodeBombCommand(); 19 | try { 20 | command.parseCommonFields(json); 21 | command.gridX = json.getInt("gridX"); 22 | command.gridY = json.getInt("gridY"); 23 | command.id = json.getInt("id"); 24 | { 25 | JSONArray jsonArray = json.getJSONArray("explodedPlayers"); 26 | if (jsonArray != null) { 27 | int length = jsonArray.length(); 28 | for (int i=0; i getExplodedPlayers() { 103 | return explodedPlayers; 104 | } 105 | 106 | public void setExplodedPlayers(List explodedPlayers) { 107 | this.explodedPlayers = explodedPlayers; 108 | } 109 | 110 | public List getExplodedGhosts() { 111 | return explodedGhosts; 112 | } 113 | 114 | public void setExplodedGhosts(List explodedGhosts) { 115 | this.explodedGhosts = explodedGhosts; 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/net/protocol/GameEndCommand.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net.protocol; 2 | 3 | import org.json.JSONException; 4 | import org.json.JSONObject; 5 | 6 | public class GameEndCommand extends Command { 7 | public static enum GameEndReason { 8 | GAME_END, OWNER_LEFT 9 | } 10 | 11 | private GameEndReason reason; 12 | 13 | public String getWinner() { 14 | return winner; 15 | } 16 | 17 | private String winner; 18 | 19 | public static Command build(JSONObject json) { 20 | GameEndCommand command = new GameEndCommand(); 21 | try { 22 | command.parseCommonFields(json); 23 | command.reason = GameEndReason.valueOf(json.getString("reason")); 24 | if (json.has("winner")) { 25 | command.winner = json.getString("winner"); 26 | } 27 | } catch (JSONException e) { 28 | e.printStackTrace(); 29 | return new UndefinedCommand(json.toString()); 30 | 31 | } 32 | return command; 33 | } 34 | 35 | public GameEndReason getReason() { 36 | return reason; 37 | } 38 | 39 | public void setReason(GameEndReason reason) { 40 | this.reason = reason; 41 | } 42 | 43 | @Override 44 | protected void serializeCustomFields(JSONObject json) throws JSONException { 45 | json.put("reason", reason); 46 | if (this.winner != null) { 47 | json.put("winner", this.winner); 48 | } 49 | } 50 | 51 | public void setWinner(String winner) { 52 | this.winner = winner; 53 | } 54 | 55 | @Override 56 | public int getCommand() { 57 | return Command.GAME_END; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/net/protocol/GhostCaughtCommand.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net.protocol; 2 | 3 | import org.json.JSONArray; 4 | import org.json.JSONException; 5 | import org.json.JSONObject; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | public class GhostCaughtCommand extends Command { 11 | private int id; 12 | private List caughtPlayers = new ArrayList(); 13 | 14 | public static Command build(JSONObject json) { 15 | GhostCaughtCommand command = new GhostCaughtCommand(); 16 | try { 17 | command.parseCommonFields(json); 18 | command.id = json.getInt("id"); 19 | { 20 | JSONArray jsonArray = json.getJSONArray("caughtPlayers"); 21 | if (jsonArray != null) { 22 | int length = jsonArray.length(); 23 | for (int i = 0; i < length; i++) { 24 | command.caughtPlayers.add(jsonArray.getString(i)); 25 | } 26 | } 27 | } 28 | } catch (JSONException e) { 29 | e.printStackTrace(); 30 | return new UndefinedCommand(json.toString()); 31 | 32 | } 33 | return command; 34 | } 35 | 36 | public int getId() { 37 | return id; 38 | } 39 | 40 | public void setId(int id) { 41 | this.id = id; 42 | } 43 | 44 | public List getCaughtPlayers() { 45 | return caughtPlayers; 46 | } 47 | 48 | public void setCaughtPlayers(List caughtPlayers) { 49 | this.caughtPlayers = caughtPlayers; 50 | } 51 | 52 | @Override 53 | protected void serializeCustomFields(JSONObject json) throws JSONException { 54 | json.put("id", id); 55 | JSONArray jsonArray = new JSONArray(); 56 | for (String playerName : caughtPlayers) { 57 | jsonArray.put(playerName); 58 | } 59 | json.put("caughtPlayers", jsonArray); 60 | 61 | } 62 | 63 | @Override 64 | public int getCommand() { 65 | return CAUGHT_GHOST; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/net/protocol/MoveCommand.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net.protocol; 2 | 3 | import org.json.JSONException; 4 | import org.json.JSONObject; 5 | 6 | public class MoveCommand extends Command { 7 | private String direction; 8 | private int gridX; 9 | private int gridY; 10 | 11 | public static Command build(JSONObject json) { 12 | MoveCommand command = new MoveCommand(); 13 | try { 14 | command.parseCommonFields(json); 15 | command.direction = json.getString("direction"); 16 | command.gridX = json.getInt("gridX"); 17 | command.gridY = json.getInt("gridY"); 18 | } catch (JSONException e) { 19 | e.printStackTrace(); 20 | return new UndefinedCommand(json.toString()); 21 | 22 | } 23 | return command; 24 | } 25 | 26 | public String getDirection() { 27 | return direction; 28 | } 29 | 30 | public void setDirection(String direction) { 31 | this.direction = direction; 32 | } 33 | 34 | public int getGridX() { 35 | return gridX; 36 | } 37 | 38 | public void setGridX(int gridX) { 39 | this.gridX = gridX; 40 | } 41 | 42 | public int getGridY() { 43 | return gridY; 44 | } 45 | 46 | public void setGridY(int gridY) { 47 | this.gridY = gridY; 48 | } 49 | 50 | @Override 51 | protected void serializeCustomFields(JSONObject json) throws JSONException { 52 | json.put("gridX", gridX); 53 | json.put("gridY", gridY); 54 | json.put("direction", direction); 55 | } 56 | 57 | @Override 58 | public int getCommand() { 59 | return MOVE_START; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/net/protocol/MoveEndCommand.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net.protocol; 2 | 3 | import org.json.JSONException; 4 | import org.json.JSONObject; 5 | 6 | public class MoveEndCommand extends Command { 7 | private String direction; 8 | private int gridX; 9 | private int gridY; 10 | 11 | public static Command build(JSONObject json) { 12 | MoveEndCommand command = new MoveEndCommand(); 13 | try { 14 | command.parseCommonFields(json); 15 | command.direction = json.getString("direction"); 16 | command.gridX = json.getInt("gridX"); 17 | command.gridY = json.getInt("gridY"); 18 | } catch (JSONException e) { 19 | e.printStackTrace(); 20 | return new UndefinedCommand(json.toString()); 21 | 22 | } 23 | return command; 24 | } 25 | 26 | public String getDirection() { 27 | return direction; 28 | } 29 | 30 | public int getGridX() { 31 | return gridX; 32 | } 33 | 34 | public void setGridX(int gridX) { 35 | this.gridX = gridX; 36 | } 37 | 38 | public int getGridY() { 39 | return gridY; 40 | } 41 | 42 | public void setGridY(int gridY) { 43 | this.gridY = gridY; 44 | } 45 | 46 | @Override 47 | protected void serializeCustomFields(JSONObject json) throws JSONException { 48 | json.put("gridX", gridX); 49 | json.put("gridY", gridY); 50 | json.put("direction", direction); 51 | } 52 | 53 | @Override 54 | public int getCommand() { 55 | return MOVE_END; 56 | } 57 | 58 | public void setDirection(String direction) { 59 | this.direction = direction; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/net/protocol/MoveGhostCommand.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net.protocol; 2 | 3 | import org.json.JSONException; 4 | import org.json.JSONObject; 5 | 6 | public class MoveGhostCommand extends Command { 7 | private String direction; 8 | private int id; 9 | private int startGridX; 10 | private int startGridY; 11 | private int gridX; 12 | private int gridY; 13 | private int distance; 14 | 15 | public static Command build(JSONObject json) { 16 | MoveGhostCommand command = new MoveGhostCommand(); 17 | try { 18 | command.parseCommonFields(json); 19 | command.direction = json.getString("direction"); 20 | command.gridX = json.getInt("gridX"); 21 | command.gridY = json.getInt("gridY"); 22 | command.startGridX = json.getInt("startGridX"); 23 | command.startGridY = json.getInt("startGridY"); 24 | command.distance = json.getInt("distance"); 25 | command.id = json.getInt("id"); 26 | } catch (JSONException e) { 27 | e.printStackTrace(); 28 | return new UndefinedCommand(json.toString()); 29 | 30 | } 31 | return command; 32 | } 33 | 34 | public String getDirection() { 35 | return direction; 36 | } 37 | 38 | public void setDirection(String direction) { 39 | this.direction = direction; 40 | } 41 | 42 | public int getGridX() { 43 | return gridX; 44 | } 45 | 46 | public void setGridX(int gridX) { 47 | this.gridX = gridX; 48 | } 49 | 50 | public int getGridY() { 51 | return gridY; 52 | } 53 | 54 | public void setGridY(int gridY) { 55 | this.gridY = gridY; 56 | } 57 | 58 | public int getDistance() { 59 | return distance; 60 | } 61 | 62 | public void setDistance(int distance) { 63 | this.distance = distance; 64 | } 65 | 66 | public int getId() { 67 | return id; 68 | } 69 | 70 | public void setId(int id) { 71 | this.id = id; 72 | } 73 | 74 | public int getStartGridX() { 75 | return startGridX; 76 | } 77 | 78 | public void setStartGridX(int startGridX) { 79 | this.startGridX = startGridX; 80 | } 81 | 82 | public int getStartGridY() { 83 | return startGridY; 84 | } 85 | 86 | public void setStartGridY(int startGridY) { 87 | this.startGridY = startGridY; 88 | } 89 | 90 | @Override 91 | protected void serializeCustomFields(JSONObject json) throws JSONException { 92 | json.put("id", id); 93 | json.put("gridX", gridX); 94 | json.put("gridY", gridY); 95 | json.put("startGridX", startGridX); 96 | json.put("startGridY", startGridY); 97 | json.put("direction", direction); 98 | json.put("distance", distance); 99 | } 100 | 101 | @Override 102 | public int getCommand() { 103 | return MOVE_GHOST; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/net/protocol/StartGameCommand.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net.protocol; 2 | 3 | import org.json.JSONException; 4 | import org.json.JSONObject; 5 | 6 | public class StartGameCommand extends Command { 7 | 8 | public static Command build(JSONObject json) { 9 | StartGameCommand command = new StartGameCommand(); 10 | try { 11 | command.parseCommonFields(json); 12 | } catch (JSONException e) { 13 | e.printStackTrace(); 14 | return new UndefinedCommand(json.toString()); 15 | } 16 | return command; 17 | } 18 | 19 | @Override 20 | protected void serializeCustomFields(JSONObject json) throws JSONException { 21 | } 22 | 23 | @Override 24 | public int getCommand() { 25 | return START_GAME; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/net/protocol/UndefinedCommand.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net.protocol; 2 | 3 | import org.json.JSONException; 4 | import org.json.JSONObject; 5 | 6 | public class UndefinedCommand extends Command { 7 | private String message; 8 | 9 | public UndefinedCommand(String message) { 10 | this.message = message; 11 | } 12 | 13 | public String getMessage() { 14 | return message; 15 | } 16 | 17 | @Override 18 | protected void serializeCustomFields(JSONObject json) throws JSONException { 19 | 20 | } 21 | 22 | @Override 23 | public int getCommand() { 24 | return 0; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/session/UserSession.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.session; 2 | 3 | import net.javaci.mobile.bomberman.core.net.models.RoomModel; 4 | 5 | public class UserSession { 6 | private long userId; 7 | private String username; 8 | private RoomModel room; 9 | 10 | public static final UserSession INSTANCE = new UserSession(); 11 | 12 | public static UserSession getInstance() { 13 | return INSTANCE; 14 | } 15 | 16 | private UserSession() { 17 | this.userId = generateUserId(); 18 | this.username = generateUsername(); 19 | } 20 | 21 | private String generateUsername() { 22 | return "Player_" + generateUserId(); 23 | } 24 | 25 | private long generateUserId() { 26 | return (long)(Math.random() * 1000000); 27 | } 28 | 29 | public String getUsername() { 30 | return username; 31 | } 32 | 33 | public void setUsername(String username) { 34 | this.username = username; 35 | } 36 | 37 | public long getUserId() { 38 | return userId; 39 | } 40 | 41 | public void setUserId(long userId) { 42 | this.userId = userId; 43 | } 44 | 45 | public RoomModel getRoom() { 46 | return room; 47 | } 48 | 49 | public void setRoom(RoomModel room) { 50 | this.room = room; 51 | } 52 | 53 | public boolean isOwnerRoom() { 54 | if (room != null) { 55 | return username.equals(room.getOwner()); 56 | } 57 | 58 | return false; 59 | } 60 | 61 | public boolean isServer() { 62 | return isOwnerRoom(); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/util/AudioManager.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.util; 2 | 3 | import com.badlogic.gdx.Application; 4 | import com.badlogic.gdx.Gdx; 5 | import com.badlogic.gdx.assets.AssetManager; 6 | import com.badlogic.gdx.audio.Music; 7 | import com.badlogic.gdx.audio.Sound; 8 | import com.badlogic.gdx.files.FileHandle; 9 | 10 | public class AudioManager { 11 | 12 | private static final String SOUND_PATH ="sound/"; 13 | 14 | private static final String DROP_BOMB= SOUND_PATH + "dropBomb.ogg"; 15 | private static final String MAIN_THEME = SOUND_PATH + "mainTheme.ogg"; 16 | private static final String BOOM = SOUND_PATH + "boom.ogg"; 17 | private static final String OPPONENT_DIED= SOUND_PATH + "dying.ogg"; 18 | private static final String JUST_DIED= SOUND_PATH + "justDied.mp3"; 19 | private static final String START_GAME= SOUND_PATH + "levelStart.mp3"; 20 | 21 | 22 | private AssetManager assetManager; 23 | 24 | //music instances are heavy, we better have only one instance at a time. 25 | private Music activeMusic; 26 | 27 | 28 | public void initialize(){ 29 | this.assetManager = new AssetManager(); 30 | activeMusic = null; 31 | 32 | if ( Gdx.app.getType() == Application.ApplicationType.Android){ 33 | FileHandle directoryHandle = Gdx.files.internal( SOUND_PATH); 34 | 35 | for ( FileHandle file: directoryHandle.list()){ 36 | assetManager.load( file.path(), Sound.class); 37 | } 38 | } 39 | else{ //list() doesn't work for Desktop 40 | assetManager.load( DROP_BOMB, Sound.class); 41 | assetManager.load( BOOM, Sound.class); 42 | assetManager.load( OPPONENT_DIED, Sound.class); 43 | assetManager.load( JUST_DIED, Sound.class); 44 | assetManager.load( START_GAME, Sound.class); 45 | assetManager.load( MAIN_THEME, Sound.class); 46 | } 47 | assetManager.finishLoading(); 48 | } 49 | 50 | public void unload(){ 51 | assetManager.clear(); 52 | } 53 | 54 | private boolean playSound( String name){ 55 | return playSound( name, false); 56 | } 57 | 58 | private boolean playSound(final String name, final boolean isLoop){ 59 | try { 60 | Gdx.app.postRunnable(new Runnable() { 61 | 62 | @Override 63 | public void run() { 64 | Sound sound = assetManager.get( name, Sound.class); 65 | if ( isLoop){ 66 | sound.loop(); 67 | } 68 | else{ 69 | sound.play(); 70 | } 71 | } 72 | }); 73 | 74 | } catch (Throwable ex) { 75 | ex.printStackTrace(); 76 | } 77 | return true; 78 | } 79 | 80 | private boolean playMusic( String name, boolean isLoop){ 81 | try { 82 | Music music = Gdx.app.getAudio().newMusic( Gdx.files.internal(name)); 83 | music.setLooping(isLoop); 84 | music.play(); 85 | stopMusic(); 86 | activeMusic = music; 87 | } catch (Throwable ex) { 88 | ex.printStackTrace(); 89 | } 90 | return true; 91 | } 92 | 93 | private void stopMusic(){ 94 | if ( activeMusic != null){ 95 | activeMusic.stop(); 96 | activeMusic.dispose(); 97 | } 98 | activeMusic = null; 99 | } 100 | 101 | public void playMainTheme() { 102 | playMusic(MAIN_THEME, true); 103 | } 104 | 105 | public void stopMainTheme() { 106 | stopMusic(); 107 | } 108 | 109 | public void dropBomb() { 110 | playSound(DROP_BOMB); 111 | } 112 | 113 | public void boom() { 114 | playSound(BOOM); 115 | } 116 | 117 | public void playOpponentDying() { 118 | playSound(OPPONENT_DIED); 119 | } 120 | 121 | public void playJustDied() { 122 | playMusic(JUST_DIED, false); 123 | } 124 | 125 | public void playStartGame() { 126 | playMusic(START_GAME, false); 127 | } 128 | 129 | } 130 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/util/Log.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.util; 2 | 3 | public class Log { 4 | 5 | public static void e(String message) { 6 | System.err.println(message); 7 | } 8 | 9 | public static void d(String message) { 10 | System.out.println(message); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/view/BomberManScreen.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.view; 2 | 3 | 4 | import com.badlogic.gdx.Gdx; 5 | import com.badlogic.gdx.Input; 6 | import com.badlogic.gdx.scenes.scene2d.Group; 7 | import com.badlogic.gdx.scenes.scene2d.InputEvent; 8 | import com.badlogic.gdx.scenes.scene2d.InputListener; 9 | import com.badlogic.gdx.scenes.scene2d.ui.Label; 10 | import net.javaci.mobile.bomberman.core.BomberManGame; 11 | import net.javaci.mobile.bomberman.core.Constants; 12 | import net.javaci.mobile.bomberman.core.mediator.BomberManMediator; 13 | import net.peakgames.libgdx.stagebuilder.core.AbstractGame; 14 | import net.peakgames.libgdx.stagebuilder.core.AbstractScreen; 15 | import net.peakgames.libgdx.stagebuilder.core.widgets.LoadingWidget; 16 | 17 | public class BomberManScreen extends AbstractScreen { 18 | private static final String NULL_STRING = "null"; 19 | protected BomberManGame game; 20 | protected BomberManMediator mediator; 21 | private LoadingWidget loadingWidget; 22 | private Group infoPopup; 23 | 24 | 25 | public BomberManScreen(AbstractGame game, BomberManMediator mediator) { 26 | super(game); 27 | this.game = (BomberManGame) game; 28 | this.mediator = mediator; 29 | 30 | setBackKeyListener(); 31 | } 32 | 33 | @Override 34 | public void render(float delta) { 35 | super.render(delta); 36 | 37 | } 38 | 39 | @Override 40 | public void unloadAssets() { 41 | game.getAssetsInterface().unloadAssets(this.getClass().getSimpleName()); 42 | } 43 | 44 | @Override 45 | public void onStageReloaded() { 46 | } 47 | 48 | @Override 49 | public void show() { 50 | super.show(); 51 | mediator.onScreenShowInternal(); 52 | } 53 | 54 | @Override 55 | public void hide() { 56 | super.hide(); 57 | } 58 | 59 | private void setBackKeyListener() { 60 | stage.addListener(new InputListener() { 61 | @Override 62 | public boolean keyDown(InputEvent event, int keycode) { 63 | if (keycode == Input.Keys.BACK || keycode == Input.Keys.ESCAPE) { 64 | //TODO play sound 65 | boolean backButtonHandled = handleBackButton(); 66 | if (!backButtonHandled) { 67 | Gdx.app.postRunnable(new Runnable() { 68 | @Override 69 | public void run() { 70 | if (game.getNumberScreens() > 1) { 71 | game.backToPreviousScreen(); 72 | } 73 | } 74 | }); 75 | } 76 | } 77 | return true; 78 | } 79 | }); 80 | } 81 | 82 | /** 83 | * Screen'ler back button'u kendisi handle etmek isterse bu metodu override etmeleri gerekir. 84 | * 85 | * @return true donerse back button handle islemi screen'e birakilir. 86 | */ 87 | public boolean handleBackButton() { 88 | return false; 89 | } 90 | 91 | public void removeLoadingWidget() { 92 | Gdx.app.postRunnable(new Runnable() { 93 | @Override 94 | public void run() { 95 | if (loadingWidget != null) { 96 | loadingWidget.hide(); 97 | loadingWidget.remove(); 98 | } 99 | } 100 | }); 101 | 102 | } 103 | 104 | public void displayLoadingWidget(long timeout) { 105 | if (loadingWidget != null) { 106 | loadingWidget.hide(); 107 | loadingWidget.remove(); 108 | } 109 | loadingWidget = new LoadingWidget(game.getAssetsInterface(), 110 | game.getResolutionHelper(), 111 | 0.5f, 112 | true, 113 | "loading", 114 | Constants.FONT_26, 115 | Constants.LOADING_WIDGET_BACKGROUND, 116 | Constants.LOADING_WIDGET_BAR, 117 | Constants.LOADING_BAR_ATLAS); 118 | if (timeout > 0) { 119 | loadingWidget.setTimeoutDuration(timeout); 120 | } 121 | loadingWidget.show(); 122 | stage.addActor(loadingWidget); 123 | } 124 | 125 | public void displayInfoPopup(String message) { 126 | try { 127 | if (infoPopup != null) { 128 | infoPopup.setVisible(false); 129 | infoPopup.remove(); 130 | infoPopup = null; 131 | } 132 | 133 | infoPopup = getStageBuilder().buildGroup("Popup.xml"); 134 | ((Label)infoPopup.findActor("infoLabel")).setText(message); 135 | stage.addActor(infoPopup); 136 | } catch (Exception e) { 137 | e.printStackTrace(); 138 | } 139 | } 140 | 141 | public void displayLoadingWidget() { 142 | displayLoadingWidget(Constants.LOADING_WIDGET_TIMEOUT); 143 | } 144 | 145 | @Override 146 | public boolean isResizable() { 147 | //TODO Screen orientation destegi eklerken portrait olabilecek ekranlarda bu metodu override edip true donmemiz gerekecek. 148 | return false; 149 | } 150 | 151 | protected void log(String message) { 152 | System.out.println(getClass() + " : " + message); 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/view/SplashScreen.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.view; 2 | 3 | import com.badlogic.gdx.Gdx; 4 | import com.badlogic.gdx.Screen; 5 | import com.badlogic.gdx.assets.AssetManager; 6 | import com.badlogic.gdx.graphics.Color; 7 | import com.badlogic.gdx.graphics.GL20; 8 | import com.badlogic.gdx.graphics.Texture; 9 | import com.badlogic.gdx.graphics.g2d.BitmapFont; 10 | import com.badlogic.gdx.graphics.g2d.SpriteBatch; 11 | import com.badlogic.gdx.graphics.g2d.TextureAtlas; 12 | import com.badlogic.gdx.graphics.glutils.ShapeRenderer; 13 | import com.badlogic.gdx.math.Interpolation; 14 | import com.badlogic.gdx.math.Vector2; 15 | import net.javaci.mobile.bomberman.core.BomberManGame; 16 | import net.javaci.mobile.bomberman.core.Constants; 17 | import net.javaci.mobile.bomberman.core.mediator.LobbyScreenMediator; 18 | import net.peakgames.libgdx.stagebuilder.core.AbstractGame; 19 | import net.peakgames.libgdx.stagebuilder.core.assets.AssetLoaderListener; 20 | import net.peakgames.libgdx.stagebuilder.core.assets.AssetsInterface; 21 | 22 | public class SplashScreen implements Screen { 23 | 24 | private static final float ANIMATION_DURATION = 1.5f;// seconds 25 | private static final float SPLASH_LOGO_MIN_SEEN_DURATION = 2000; //miliseconds 26 | private BomberManGame game; 27 | private SpriteBatch spriteBatch; 28 | private Texture logo; 29 | private float logoX; 30 | private float logoY; 31 | private AssetManager assetManager; 32 | private boolean hideSplashScreen = false; 33 | private float elapsedTime; 34 | private float logoMoveAnimationDistance; 35 | private float originalLogoX; 36 | private long startTime; 37 | private ShapeRenderer shapeRenderer; 38 | private float screenWidth; 39 | private float screenHeight; 40 | private Color progressBarColor; 41 | 42 | public SplashScreen(AbstractGame game) { 43 | this.game = (BomberManGame) game; 44 | this.assetManager = game.getAssetsInterface().getAssetMAnager(); 45 | this.shapeRenderer = new ShapeRenderer(); 46 | this.screenHeight = Gdx.graphics.getHeight(); 47 | this.screenWidth = Gdx.graphics.getWidth(); 48 | this.progressBarColor = Color.valueOf("B02B2C"); 49 | } 50 | 51 | @Override 52 | public void render(float delta) { 53 | Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); 54 | spriteBatch.begin(); 55 | spriteBatch.draw(logo, logoX, logoY); 56 | spriteBatch.end(); 57 | this.assetManager.update(); 58 | if (hideSplashScreen && splashLogoSeenEnough()) { 59 | elapsedTime = elapsedTime + delta; 60 | float percentage = elapsedTime / ANIMATION_DURATION; 61 | percentage = Interpolation.swing.apply(percentage); 62 | 63 | if (elapsedTime > ANIMATION_DURATION) { 64 | LobbyScreenMediator mediator = new LobbyScreenMediator(this.game); 65 | game.setScreen(mediator.createScreen()); 66 | percentage = 1; 67 | } 68 | logoX = originalLogoX + logoMoveAnimationDistance * percentage; 69 | } 70 | 71 | renderAssetManagerProgress(); 72 | } 73 | 74 | private void renderAssetManagerProgress() { 75 | float progress = assetManager.getProgress(); 76 | if(progress < 1) { 77 | float width = this.screenWidth * progress; 78 | shapeRenderer.begin(ShapeRenderer.ShapeType.Filled); 79 | shapeRenderer.setColor(this.progressBarColor); 80 | shapeRenderer.rect((this.screenWidth- width) * 0.5f, 0, width , this.screenHeight * 0.01f); 81 | shapeRenderer.end(); 82 | } 83 | 84 | } 85 | 86 | private boolean splashLogoSeenEnough() { 87 | return (System.currentTimeMillis() - startTime) > SPLASH_LOGO_MIN_SEEN_DURATION; 88 | } 89 | 90 | @Override 91 | public void show() { 92 | AssetsInterface assets = game.getAssetsInterface(); 93 | spriteBatch = new SpriteBatch(); 94 | loadLogo(); 95 | String assetsKey = "SplashScreen"; 96 | loadFonts(assets, assetsKey); 97 | assets.addAssetConfiguration(assetsKey, Constants.COMMON_ATLAS, TextureAtlas.class); 98 | assets.addAssetConfiguration(assetsKey, Constants.SKIN_ATLAS, TextureAtlas.class); 99 | assets.addAssetConfiguration(assetsKey, Constants.LOADING_BAR_ATLAS, TextureAtlas.class); 100 | assets.loadAssetsAsync(assetsKey, new AssetLoaderListener() { 101 | @Override 102 | public void onAssetsLoaded() { 103 | hideSplashScreen = true; 104 | } 105 | }); 106 | startTime = System.currentTimeMillis(); 107 | } 108 | 109 | private void loadFonts(AssetsInterface assets, String assetsKey) { 110 | assets.addAssetConfiguration(assetsKey, "26pt.fnt", BitmapFont.class); 111 | assets.addAssetConfiguration(assetsKey, "40pt_title.fnt", BitmapFont.class); 112 | assets.addAssetConfiguration(assetsKey, "large.fnt", BitmapFont.class); 113 | assets.addAssetConfiguration(assetsKey, "normal.fnt", BitmapFont.class); 114 | assets.addAssetConfiguration(assetsKey, "small.fnt", BitmapFont.class); 115 | assets.addAssetConfiguration(assetsKey, "pixelfont_26.fnt", BitmapFont.class); 116 | } 117 | 118 | private void loadLogo() { 119 | String path = getImagesPath(); 120 | logo = new Texture(Gdx.files.internal(path + "/splash_logo.png")); 121 | logoX = (Gdx.graphics.getWidth() - logo.getWidth()) * 0.5f; 122 | logoY = (Gdx.graphics.getHeight() - logo.getHeight()) * 0.5f; 123 | logoMoveAnimationDistance = Gdx.graphics.getWidth() - logoX; 124 | originalLogoX = logoX; 125 | } 126 | 127 | private String getImagesPath() { 128 | Vector2 res = game.getBestResolution(); 129 | return "images/" + (int) res.x + "x" + (int) res.y + "/"; 130 | } 131 | 132 | @Override 133 | public void resize(int width, int height) { 134 | } 135 | 136 | @Override 137 | public void hide() { 138 | } 139 | 140 | @Override 141 | public void pause() { 142 | } 143 | 144 | @Override 145 | public void resume() { 146 | } 147 | 148 | @Override 149 | public void dispose() { 150 | logo.dispose(); 151 | shapeRenderer.dispose(); 152 | Gdx.app.log("HeartsPlus", "SplashScreen disposed."); 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/view/widget/BombWidget.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.view.widget; 2 | 3 | import com.badlogic.gdx.Gdx; 4 | import com.badlogic.gdx.graphics.g2d.Animation; 5 | import com.badlogic.gdx.graphics.g2d.Batch; 6 | import com.badlogic.gdx.graphics.g2d.TextureAtlas; 7 | import com.badlogic.gdx.graphics.g2d.TextureRegion; 8 | import com.badlogic.gdx.scenes.scene2d.Actor; 9 | import net.javaci.mobile.bomberman.core.models.BombModel; 10 | 11 | public class BombWidget extends Actor { 12 | 13 | private final TextureAtlas atlas; 14 | private BombModel bombModel; 15 | private Animation bombAnimationBeforeExplosion; 16 | private float elapsedTime; 17 | 18 | public BombWidget(TextureAtlas atlas, BombModel bombModel) { 19 | this.atlas = atlas; 20 | this.bombModel = bombModel; 21 | prepareBombAnimationBeforeExplosion(); 22 | } 23 | 24 | private void prepareBombAnimationBeforeExplosion() { 25 | TextureRegion frames[] = new TextureRegion[6]; 26 | frames[0] = atlas.findRegion("bomb1"); 27 | frames[1] = atlas.findRegion("bomb2"); 28 | frames[2] = atlas.findRegion("bomb3"); 29 | frames[3] = atlas.findRegion("bomb4"); 30 | frames[4] = atlas.findRegion("bomb5"); 31 | frames[5] = atlas.findRegion("bomb6"); 32 | this.bombAnimationBeforeExplosion = new Animation(0.50f, frames); 33 | } 34 | 35 | @Override 36 | public void draw(Batch batch, float parentAlpha) { 37 | super.draw(batch, parentAlpha); 38 | if (bombModel.getState() == BombModel.State.EXPLODE) { 39 | this.remove(); 40 | } else { 41 | float deltaTime = Gdx.graphics.getDeltaTime(); 42 | elapsedTime += deltaTime; 43 | TextureRegion currentFrame = bombAnimationBeforeExplosion.getKeyFrame(elapsedTime, true); 44 | 45 | batch.draw( 46 | currentFrame, 47 | bombModel.getX() + (bombModel.getWidth() - currentFrame.getRegionWidth()) * 0.5f, 48 | bombModel.getY() + (bombModel.getHeight() - currentFrame.getRegionHeight()) * 0.5f); 49 | 50 | } 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/view/widget/BombermanWidget.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.view.widget; 2 | 3 | import com.badlogic.gdx.Gdx; 4 | import com.badlogic.gdx.graphics.g2d.Animation; 5 | import com.badlogic.gdx.graphics.g2d.Batch; 6 | import com.badlogic.gdx.graphics.g2d.TextureAtlas; 7 | import com.badlogic.gdx.graphics.g2d.TextureRegion; 8 | import com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup; 9 | import net.javaci.mobile.bomberman.core.models.PlayerModel; 10 | 11 | public class BombermanWidget extends WidgetGroup { 12 | private PlayerModel playerModel; 13 | private Animation walkUpAnimation; 14 | private Animation walkDownAnimation; 15 | private Animation walkLeftAnimation; 16 | private Animation walkRightAnimation; 17 | private TextureRegion upStand; 18 | private TextureRegion downStand; 19 | private TextureRegion leftStand; 20 | private TextureRegion rightStand; 21 | private TextureRegion currentFrame; 22 | private float elapsedTime; 23 | private int bombermanIndex; 24 | 25 | public BombermanWidget(TextureAtlas atlas, int bombermanIndex, PlayerModel playerModel) { 26 | this.bombermanIndex = bombermanIndex; 27 | this.playerModel = playerModel; 28 | prepareStandingTextures(atlas); 29 | prepareWalkUpAnimation(atlas); 30 | prepareWalkDownAnimation(atlas); 31 | prepareWalkRightAnimation(atlas); 32 | prepareWalkLeftAnimation(atlas); 33 | } 34 | 35 | private String generateUpImageName(int bombermanIndex, int frameIndex) { 36 | return "girl" + bombermanIndex + "up" + frameIndex; 37 | } 38 | 39 | private String generateDownImageName(int bombermanIndex, int frameIndex) { 40 | return "girl" + bombermanIndex + "down" + frameIndex; 41 | } 42 | 43 | private String generateRightImageName(int bombermanIndex, int frameIndex) { 44 | return "girl" + bombermanIndex + "right" + frameIndex; 45 | } 46 | 47 | private String generateLeftImageName(int bombermanIndex, int frameIndex) { 48 | return "girl" + bombermanIndex + "left" + frameIndex; 49 | } 50 | 51 | private void prepareStandingTextures(TextureAtlas atlas) { 52 | upStand = atlas.findRegion(generateUpImageName(this.bombermanIndex, 1)); 53 | downStand = atlas.findRegion(generateDownImageName(this.bombermanIndex, 1)); 54 | rightStand = atlas.findRegion(generateRightImageName(this.bombermanIndex, 1)); 55 | leftStand = atlas.findRegion(generateLeftImageName(this.bombermanIndex, 1)); 56 | } 57 | 58 | private void prepareWalkRightAnimation(TextureAtlas atlas) { 59 | TextureRegion frames[] = new TextureRegion[3]; 60 | frames[0] = atlas.findRegion(generateRightImageName(this.bombermanIndex, 1)); 61 | frames[1] = atlas.findRegion(generateRightImageName(this.bombermanIndex, 2)); 62 | frames[2] = atlas.findRegion(generateRightImageName(this.bombermanIndex, 3)); 63 | walkRightAnimation = new Animation(0.15f, frames); 64 | } 65 | 66 | private void prepareWalkLeftAnimation(TextureAtlas atlas) { 67 | TextureRegion frames[] = new TextureRegion[3]; 68 | frames[0] = atlas.findRegion(generateLeftImageName(this.bombermanIndex, 1)); 69 | frames[1] = atlas.findRegion(generateLeftImageName(this.bombermanIndex, 2)); 70 | frames[2] = atlas.findRegion(generateLeftImageName(this.bombermanIndex, 3)); 71 | walkLeftAnimation = new Animation(0.15f, frames); 72 | } 73 | 74 | private void prepareWalkUpAnimation(TextureAtlas atlas) { 75 | TextureRegion frames[] = new TextureRegion[3]; 76 | frames[0] = atlas.findRegion(generateUpImageName(this.bombermanIndex, 1)); 77 | frames[1] = atlas.findRegion(generateUpImageName(this.bombermanIndex, 2)); 78 | frames[2] = atlas.findRegion(generateUpImageName(this.bombermanIndex, 3)); 79 | walkUpAnimation = new Animation(0.15f, frames); 80 | } 81 | 82 | private void prepareWalkDownAnimation(TextureAtlas atlas) { 83 | TextureRegion frames[] = new TextureRegion[3]; 84 | frames[0] = atlas.findRegion(generateDownImageName(this.bombermanIndex, 1)); 85 | frames[1] = atlas.findRegion(generateDownImageName(this.bombermanIndex, 2)); 86 | frames[2] = atlas.findRegion(generateDownImageName(this.bombermanIndex, 3)); 87 | walkDownAnimation = new Animation(0.15f, frames); 88 | } 89 | 90 | @Override 91 | public void draw(Batch batch, float parentAlpha) { 92 | super.draw(batch, parentAlpha); 93 | float deltaTime = Gdx.graphics.getDeltaTime(); 94 | elapsedTime += deltaTime; 95 | 96 | switch (playerModel.getState()) { 97 | case WALKING_UP: 98 | case STOPPING_UP: 99 | currentFrame = walkUpAnimation.getKeyFrame(elapsedTime, true); 100 | break; 101 | case WALKING_DOWN: 102 | case STOPPING_DOWN: 103 | currentFrame = walkDownAnimation.getKeyFrame(elapsedTime, true); 104 | break; 105 | case WALKING_RIGHT: 106 | case STOPPING_RIGHT: 107 | currentFrame = walkRightAnimation.getKeyFrame(elapsedTime, true); 108 | break; 109 | case WALKING_LEFT: 110 | case STOPPING_LEFT: 111 | currentFrame = walkLeftAnimation.getKeyFrame(elapsedTime, true); 112 | break; 113 | case STANDING_UP: 114 | currentFrame = upStand; 115 | break; 116 | case STANDING_DOWN: 117 | currentFrame = downStand; 118 | break; 119 | case STANDING_RIGHT: 120 | currentFrame = rightStand; 121 | break; 122 | case STANDING_LEFT: 123 | currentFrame = leftStand; 124 | break; 125 | case DEAD: 126 | this.remove(); 127 | break; 128 | default: 129 | break; 130 | } 131 | /* 132 | batch.draw( 133 | currentFrame, 134 | playerModel.getX() + (playerModel.getWidth() - currentFrame.getRegionWidth()) * 0.5f, 135 | playerModel.getY() + (playerModel.getHeight() - currentFrame.getRegionHeight()) * 0.5f); 136 | */ 137 | batch.draw( 138 | currentFrame, 139 | playerModel.getX(), 140 | playerModel.getY(), 141 | playerModel.getWidth(), 142 | playerModel.getHeight()); 143 | 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/view/widget/DeadGhostWidget.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.view.widget; 2 | 3 | import com.badlogic.gdx.Gdx; 4 | import com.badlogic.gdx.graphics.g2d.Animation; 5 | import com.badlogic.gdx.graphics.g2d.Batch; 6 | import com.badlogic.gdx.graphics.g2d.TextureAtlas; 7 | import com.badlogic.gdx.graphics.g2d.TextureRegion; 8 | import com.badlogic.gdx.scenes.scene2d.Actor; 9 | 10 | public class DeadGhostWidget extends Actor { 11 | 12 | private Animation deadAnimation; 13 | 14 | private float elapsedTime; 15 | private TextureRegion currentFrame; 16 | private float x; 17 | private float y; 18 | private int type; 19 | 20 | public DeadGhostWidget(TextureAtlas atlas, float x, float y, int type) { 21 | this.x = x; 22 | this.y = y; 23 | this.type = type; 24 | prepareDeadAnimation(atlas); 25 | } 26 | 27 | private void prepareDeadAnimation(TextureAtlas atlas) { 28 | TextureRegion frames[] = new TextureRegion[3]; 29 | frames[0] = atlas.findRegion(generateDeadImageName(type, 1)); 30 | frames[1] = atlas.findRegion(generateDeadImageName(type, 2)); 31 | frames[2] = atlas.findRegion(generateDeadImageName(type, 3)); 32 | deadAnimation = new Animation(0.35f, frames); 33 | } 34 | 35 | private String generateDeadImageName(int type, int frameIndex) { 36 | return "ghost" + type + "dead" + frameIndex; 37 | } 38 | 39 | @Override 40 | public void draw(Batch batch, float parentAlpha) { 41 | super.draw(batch, parentAlpha); 42 | 43 | float deltaTime = Gdx.graphics.getDeltaTime(); 44 | elapsedTime += deltaTime; 45 | 46 | currentFrame = deadAnimation.getKeyFrame(elapsedTime, false); 47 | if (deadAnimation.isAnimationFinished(elapsedTime)) { 48 | this.remove(); 49 | } 50 | 51 | batch.draw( 52 | currentFrame, 53 | x, 54 | y); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/view/widget/ExplosionWidget.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.view.widget; 2 | 3 | import com.badlogic.gdx.Gdx; 4 | import com.badlogic.gdx.graphics.g2d.Animation; 5 | import com.badlogic.gdx.graphics.g2d.Batch; 6 | import com.badlogic.gdx.graphics.g2d.TextureAtlas; 7 | import com.badlogic.gdx.graphics.g2d.TextureRegion; 8 | import com.badlogic.gdx.scenes.scene2d.Actor; 9 | 10 | public class ExplosionWidget extends Actor { 11 | 12 | private final TextureAtlas atlas; 13 | private Animation explosionAnimation; 14 | private float elapsedTime; 15 | 16 | public ExplosionWidget(TextureAtlas atlas) { 17 | this.atlas = atlas; 18 | prepareAnimation(); 19 | } 20 | 21 | private void prepareAnimation() { 22 | int numFrames = 9; 23 | TextureRegion frames[] = new TextureRegion[numFrames]; 24 | for (int i=0; i attributes; 14 | private ResolutionHelper resolutionHelper; 15 | 16 | @Override 17 | public void build(Map attributes, AssetsInterface assetsInterface, ResolutionHelper resolutionHelper, LocalizationService localizationService) { 18 | this.attributes = attributes; 19 | this.resolutionHelper = resolutionHelper; 20 | setVisible(false); 21 | setTouchable(Touchable.disabled); 22 | } 23 | 24 | public String getString(String key) { 25 | return attributes.get(key); 26 | } 27 | 28 | public int getInt(String key) { 29 | return Integer.valueOf(attributes.get(key)); 30 | } 31 | 32 | public float getSizeMultFloat(String key) { 33 | return Integer.valueOf(attributes.get(key)) * resolutionHelper.getSizeMultiplier(); 34 | } 35 | 36 | 37 | public float getPositionMultFloat(String key) { 38 | return Integer.valueOf(attributes.get(key)) * resolutionHelper.getPositionMultiplier(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/view/widget/GameWidget.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.view.widget; 2 | 3 | 4 | import com.badlogic.gdx.scenes.scene2d.ui.Label; 5 | import com.badlogic.gdx.scenes.scene2d.ui.Skin; 6 | import com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup; 7 | import com.badlogic.gdx.scenes.scene2d.utils.Align; 8 | 9 | public class GameWidget extends WidgetGroup { 10 | 11 | public GameWidget(Skin skin) { 12 | super(); 13 | 14 | Label roomName = new Label("Room", skin); 15 | roomName.setPosition(40, 21.5f); 16 | roomName.setAlignment(Align.left); 17 | this.addActor(roomName); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/view/widget/GhostWidget.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.view.widget; 2 | 3 | import com.badlogic.gdx.Gdx; 4 | import com.badlogic.gdx.graphics.g2d.Animation; 5 | import com.badlogic.gdx.graphics.g2d.Batch; 6 | import com.badlogic.gdx.graphics.g2d.TextureAtlas; 7 | import com.badlogic.gdx.graphics.g2d.TextureRegion; 8 | import com.badlogic.gdx.scenes.scene2d.Actor; 9 | import net.javaci.mobile.bomberman.core.models.GhostModel; 10 | 11 | public class GhostWidget extends Actor { 12 | 13 | private GhostModel ghostModel; 14 | private Animation walkAnimation; 15 | private Animation deadAnimation; 16 | 17 | private float elapsedTime; 18 | private TextureRegion currentFrame; 19 | 20 | public GhostWidget(TextureAtlas atlas, GhostModel model) { 21 | this.ghostModel = model; 22 | prepareWalkAnimation(atlas); 23 | prepareDeadAnimation(atlas); 24 | } 25 | 26 | private void prepareDeadAnimation(TextureAtlas atlas) { 27 | TextureRegion frames[] = new TextureRegion[3]; 28 | frames[0] = atlas.findRegion(generateDeadImageName(ghostModel.getType().getValue(), 1)); 29 | frames[1] = atlas.findRegion(generateDeadImageName(ghostModel.getType().getValue(), 2)); 30 | frames[2] = atlas.findRegion(generateDeadImageName(ghostModel.getType().getValue(), 3)); 31 | deadAnimation = new Animation(0.65f, frames); 32 | } 33 | 34 | private void prepareWalkAnimation(TextureAtlas atlas) { 35 | TextureRegion frames[] = new TextureRegion[3]; 36 | frames[0] = atlas.findRegion(generateMoveImageName(ghostModel.getType().getValue(), 1)); 37 | frames[1] = atlas.findRegion(generateMoveImageName(ghostModel.getType().getValue(), 2)); 38 | frames[2] = atlas.findRegion(generateMoveImageName(ghostModel.getType().getValue(), 3)); 39 | walkAnimation = new Animation(0.15f, frames); 40 | } 41 | 42 | private String generateMoveImageName(int type, int frameIndex) { 43 | return "ghost" + type + "move" + frameIndex; 44 | } 45 | 46 | private String generateDeadImageName(int type, int frameIndex) { 47 | return "ghost" + type + "dead" + frameIndex; 48 | } 49 | 50 | @Override 51 | public void draw(Batch batch, float parentAlpha) { 52 | super.draw(batch, parentAlpha); 53 | 54 | float deltaTime = Gdx.graphics.getDeltaTime(); 55 | elapsedTime += deltaTime; 56 | 57 | switch (ghostModel.getState()) { 58 | case STANDING_UP: 59 | case STANDING_DOWN: 60 | case STANDING_RIGHT: 61 | case STANDING_LEFT: 62 | case WALKING_UP: 63 | case WALKING_DOWN: 64 | case WALKING_RIGHT: 65 | case WALKING_LEFT: 66 | currentFrame = walkAnimation.getKeyFrame(elapsedTime, true); 67 | break; 68 | case DEAD: 69 | currentFrame = deadAnimation.getKeyFrame(elapsedTime, false); 70 | if (deadAnimation.isAnimationFinished(elapsedTime)) { 71 | this.remove(); 72 | } 73 | break; 74 | default: 75 | break; 76 | } 77 | 78 | batch.draw( 79 | currentFrame, 80 | ghostModel.getX(), 81 | ghostModel.getY(), 82 | ghostModel.getWidth(), 83 | ghostModel.getHeight()); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /core/src/main/java/net/javaci/mobile/bomberman/core/view/widget/LabyrinthWidget.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.view.widget; 2 | 3 | import com.badlogic.gdx.graphics.g2d.Batch; 4 | import com.badlogic.gdx.graphics.g2d.TextureAtlas; 5 | import com.badlogic.gdx.graphics.g2d.TextureRegion; 6 | import com.badlogic.gdx.math.Vector2; 7 | import com.badlogic.gdx.scenes.scene2d.Actor; 8 | import net.javaci.mobile.bomberman.core.models.LabyrinthModel; 9 | import net.peakgames.libgdx.stagebuilder.core.assets.AssetsInterface; 10 | import net.peakgames.libgdx.stagebuilder.core.assets.ResolutionHelper; 11 | 12 | public class LabyrinthWidget extends Actor { 13 | private LabyrinthModel labyrinthModel; 14 | private ResolutionHelper resolutionHelper; 15 | private AssetsInterface assets; 16 | private Vector2 gameAreaBounds; 17 | private Vector2 gameAreaPosition; 18 | private TextureRegion wall; 19 | private TextureRegion brick; 20 | private int numCols; 21 | private int numRows; 22 | 23 | public LabyrinthWidget(LabyrinthModel labyrinthModel, ResolutionHelper resolutionHelper, AssetsInterface assets) { 24 | this.labyrinthModel = labyrinthModel; 25 | this.resolutionHelper = resolutionHelper; 26 | this.assets = assets; 27 | this.gameAreaBounds = resolutionHelper.getGameAreaBounds(); 28 | this.gameAreaPosition = resolutionHelper.getGameAreaPosition(); 29 | this.numCols = labyrinthModel.getGrid().length; 30 | this.numRows = labyrinthModel.getGrid()[0].length; 31 | TextureAtlas atlas = assets.getTextureAtlas("Common.atlas"); 32 | wall = atlas.findRegion("wall"); 33 | brick = atlas.findRegion("brick"); 34 | } 35 | 36 | @Override 37 | public void draw(Batch batch, float parentAlpha) { 38 | super.draw(batch, parentAlpha); 39 | float width = gameAreaBounds.x / numCols; 40 | float height = gameAreaBounds.y / numRows; 41 | drawWalls(batch, width, height); 42 | } 43 | 44 | private void drawWalls(Batch batch, float width, float height) { 45 | for (int i = 0; i < numCols; i++) { 46 | float x = width * i + gameAreaPosition.x; 47 | for (int j = 0; j < numRows; j++) { 48 | float y = j * height + gameAreaPosition.y; 49 | if (labyrinthModel.getGrid()[i][j] == LabyrinthModel.WALL) { 50 | batch.draw(wall, x, y, width, height); 51 | } else if (labyrinthModel.getGrid()[i][j] == LabyrinthModel.BRICK) { 52 | batch.draw(brick, x, y, width, height); 53 | } 54 | } 55 | } 56 | } 57 | 58 | public Vector2 getWallPosition(int x, int y) { 59 | return new Vector2((gameAreaBounds.x / numCols) * x, (gameAreaBounds.y / numRows) * y); 60 | } 61 | 62 | public Vector2 getPlayerInitialPosition(int playerIndex) { 63 | float width = gameAreaBounds.x / numCols; 64 | float height = gameAreaBounds.y / numRows; 65 | Vector2 position = new Vector2(); 66 | switch (playerIndex) { 67 | case 1: 68 | position.set(gameAreaPosition.x + width, gameAreaPosition.y + height); 69 | break; 70 | case 2: 71 | position.set(gameAreaPosition.x + width * (numCols - 2), gameAreaPosition.y + height); 72 | break; 73 | case 3: 74 | position.set(gameAreaPosition.x + width * (numCols - 2), gameAreaPosition.y + height * (numRows - 2)); 75 | break; 76 | case 4: 77 | position.set(gameAreaPosition.x + width, gameAreaPosition.y + height * (numRows - 2)); 78 | break; 79 | } 80 | return position; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /core/src/test/java/net/javaci/mobile/bomberman/core/net/appwarp/AppWarpClientTest.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net.appwarp; 2 | 3 | import net.javaci.mobile.bomberman.core.net.NetworkListenerAdapter; 4 | import net.javaci.mobile.bomberman.core.net.models.RoomModel; 5 | import org.junit.AfterClass; 6 | import org.junit.BeforeClass; 7 | import org.junit.Test; 8 | 9 | import java.util.List; 10 | import java.util.concurrent.CountDownLatch; 11 | import java.util.concurrent.TimeUnit; 12 | 13 | import static junit.framework.Assert.assertEquals; 14 | import static junit.framework.Assert.assertTrue; 15 | 16 | public class AppWarpClientTest { 17 | private static AppWarpClient client; 18 | private static String username = "ilkinulas"; 19 | private static CountDownLatch connectLatch = new CountDownLatch(1); 20 | private static CountDownLatch disconnectLatch = new CountDownLatch(1); 21 | /* 22 | @BeforeClass 23 | public static void beforeClass() throws Exception { 24 | 25 | client = new AppWarpClient(username); 26 | client.addNetworkListener(new NetworkListenerAdapter() { 27 | @Override 28 | public void onConnected() { 29 | connectLatch.countDown(); 30 | } 31 | 32 | @Override 33 | public void onDisconnected() { 34 | disconnectLatch.countDown(); 35 | } 36 | }); 37 | client.connect(); 38 | assertTrue(connectLatch.await(10, TimeUnit.SECONDS)); 39 | } 40 | 41 | @AfterClass 42 | public static void afterClass() throws Exception { 43 | deleteAllRooms(); 44 | client.disconnect(); 45 | assertTrue(disconnectLatch.await(10, TimeUnit.SECONDS)); 46 | } 47 | 48 | public static void deleteAllRooms() throws Exception { 49 | final CountDownLatch roomListLatch = new CountDownLatch(1); 50 | client.addNetworkListener(new NetworkListenerAdapter() { 51 | @Override 52 | public void onRoomListReceived(List rooms) { 53 | for (RoomModel room : rooms) { 54 | System.out.println("Deleting room " + room.getId()); 55 | client.deleteRoom(room.getId()); 56 | } 57 | roomListLatch.countDown(); 58 | } 59 | 60 | @Override 61 | public void onRoomDeleted(String roomId) { 62 | System.out.println("Room " + roomId + " deleted"); 63 | } 64 | }); 65 | client.listRooms(); 66 | assertTrue(roomListLatch.await(10, TimeUnit.SECONDS)); 67 | } 68 | 69 | @Test 70 | public void testCreateRoom() throws Exception { 71 | String roomName = "fikirton_test_room_" + Math.random(); 72 | createRoom(roomName); 73 | } 74 | 75 | private void createRoom(String roomName) throws InterruptedException { 76 | final CountDownLatch createRoomLatch = new CountDownLatch(1); 77 | client.addNetworkListener(new NetworkListenerAdapter() { 78 | @Override 79 | public void onRoomCreated(RoomModel room) { 80 | createRoomLatch.countDown(); 81 | } 82 | }); 83 | 84 | client.createRoom(roomName); 85 | assertTrue(createRoomLatch.await(10, TimeUnit.SECONDS)); 86 | } 87 | 88 | @Test 89 | public void testListRooms() throws Exception { 90 | deleteAllRooms(); 91 | createRoom("test_room_1"); 92 | createRoom("test_room_2"); 93 | createRoom("test_room_3"); 94 | 95 | final CountDownLatch latch = new CountDownLatch(1); 96 | final int [] numRooms = {0}; 97 | client.addNetworkListener(new NetworkListenerAdapter() { 98 | @Override 99 | public void onRoomListReceived(List rooms) { 100 | numRooms[0] = rooms.size(); 101 | latch.countDown(); 102 | 103 | } 104 | }); 105 | client.listRooms(); 106 | assertTrue(latch.await(10, TimeUnit.SECONDS)); 107 | assertEquals(3, numRooms[0]); 108 | } 109 | 110 | @Test 111 | public void testJoinRoom() throws Exception { 112 | final CountDownLatch latch = new CountDownLatch(1); 113 | client.addNetworkListener(new NetworkListenerAdapter() { 114 | @Override 115 | public void onRoomCreated(RoomModel room) { 116 | client.joinRoom(room.getId()); 117 | } 118 | 119 | @Override 120 | public void onJoinRoomSuccess(String roomId) { 121 | latch.countDown(); 122 | } 123 | }); 124 | createRoom("test_room_1"); 125 | assertTrue(latch.await(10, TimeUnit.SECONDS)); 126 | 127 | } 128 | 129 | 130 | 131 | @Test 132 | public void createRoom() throws Exception { 133 | 134 | final CountDownLatch createRoomLatch = new CountDownLatch(1); 135 | final String roomName = "Fikirton_test_room_" + Math.random(); 136 | final String username = "ilkinulas"; 137 | this.client = new AppWarpClient(username, new NetworkListenerAdapter() { 138 | @Override 139 | public void onConnected() { 140 | sendCreateRoomRequest(roomName); 141 | } 142 | 143 | @Override 144 | public void onRoomCreated(RoomModel room) { 145 | assertEquals(username, room.getOwner()); 146 | assertEquals(roomName, room.getName()); 147 | createRoomLatch.countDown(); 148 | } 149 | }); 150 | client.connect(); 151 | assertTrue(createRoomLatch.await(10, TimeUnit.SECONDS)); 152 | } 153 | 154 | @Test 155 | public void listRooms() throws Exception { 156 | final CountDownLatch roomListLatch = new CountDownLatch(1); 157 | this.client = new AppWarpClient("ilkinulas", new NetworkListenerAdapter() { 158 | @Override 159 | public void onConnected() { 160 | sendListRoomsRequest(); 161 | } 162 | 163 | @Override 164 | public void onRoomListReceived(List rooms) { 165 | roomListLatch.countDown(); 166 | System.out.println("Room List : "); 167 | for (RoomModel room : rooms) { 168 | System.out.println(room); 169 | } 170 | } 171 | }); 172 | 173 | client.connect(); 174 | assertTrue(roomListLatch.await(10, TimeUnit.SECONDS)); 175 | 176 | client.disconnect(); 177 | } 178 | 179 | */ 180 | 181 | } 182 | -------------------------------------------------------------------------------- /core/src/test/java/net/javaci/mobile/bomberman/core/net/appwarp/TestClient.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.core.net.appwarp; 2 | 3 | 4 | import net.javaci.mobile.bomberman.core.Synchronizer; 5 | import net.javaci.mobile.bomberman.core.net.NetworkListenerAdapter; 6 | import net.javaci.mobile.bomberman.core.net.models.RoomModel; 7 | import net.javaci.mobile.bomberman.core.net.protocol.CommandFactory; 8 | 9 | import java.io.BufferedReader; 10 | import java.io.InputStreamReader; 11 | import java.util.List; 12 | import java.util.Locale; 13 | 14 | public class TestClient { 15 | private String username; 16 | private AppWarpClient warpClient; 17 | private Synchronizer synchronizer; 18 | 19 | public static void main(String[] args) throws Exception { 20 | TestClient client = new TestClient(); 21 | client.start(); 22 | } 23 | 24 | private void start() throws Exception { 25 | BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); 26 | String command; 27 | while ((command = in.readLine()) != null && command.length() != 0) { 28 | handleCommand(command.toLowerCase(Locale.US)); 29 | } 30 | } 31 | 32 | private void handleCommand(String command) throws Exception { 33 | if (command.startsWith("connect")) { 34 | handleConnectCommand(command); 35 | } else if (command.startsWith("disconnect")) { 36 | handleDisconnectCommand(); 37 | } else if (command.startsWith("create_room")) { 38 | handleCreateRoomCommand(command); 39 | } else if (command.startsWith("list_rooms")) { 40 | handleListRoomCommand(); 41 | } else if (command.startsWith("join_room")) { 42 | handleJoinRoomCommand(command); 43 | } else if (command.startsWith("send_message_to")) { 44 | handleSendMessageToCommand(command); 45 | } else if (command.startsWith("send_message")) { 46 | handleSendMessageCommand(command); 47 | } else if (command.startsWith("clear_rooms")) { 48 | handleClearRooms(); 49 | } else { 50 | log("Undefined command '" + command + "'"); 51 | } 52 | } 53 | 54 | private void handleClearRooms() { 55 | warpClient.addNetworkListener(new NetworkListenerAdapter() { 56 | @Override 57 | public void onRoomListReceived(List rooms) { 58 | log("Room list : "); 59 | for (RoomModel room : rooms) { 60 | warpClient.deleteRoom(room.getId()); 61 | } 62 | } 63 | 64 | @Override 65 | public void onRoomDeleted(String roomId) { 66 | log("Room deleted : " + roomId); 67 | } 68 | 69 | @Override 70 | public void onDisconnected() { 71 | warpClient.removeNetworkListener(this); 72 | } 73 | }); 74 | warpClient.listRooms(); 75 | } 76 | 77 | private void handleSendMessageCommand(String command) { 78 | String[] parts = command.split(" "); 79 | String message = parts[1]; 80 | warpClient.sendMessage(message); 81 | } 82 | 83 | private void handleSendMessageToCommand(String command) { 84 | String[] parts = command.split(" "); 85 | String destination = parts[1]; 86 | String message = parts[2]; 87 | warpClient.sendMessageTo(destination, message); 88 | } 89 | 90 | private void handleJoinRoomCommand(String command) { 91 | String[] parts = command.split(" "); 92 | String roomId = parts[1]; 93 | warpClient.joinRoom(roomId); 94 | } 95 | 96 | private void handleListRoomCommand() { 97 | warpClient.addNetworkListener(new NetworkListenerAdapter() { 98 | @Override 99 | public void onRoomListReceived(List rooms) { 100 | log("Room list : "); 101 | for (RoomModel room : rooms) { 102 | log(room.toString()); 103 | } 104 | warpClient.removeNetworkListener(this); 105 | } 106 | }); 107 | warpClient.listRooms(); 108 | } 109 | 110 | private void handleCreateRoomCommand(String command) { 111 | String[] parts = command.split(" "); 112 | String roomName = parts[1]; 113 | this.warpClient.createRoom(roomName); 114 | } 115 | 116 | private void handleDisconnectCommand() { 117 | warpClient.disconnect(); 118 | } 119 | 120 | private void handleConnectCommand(String command) { 121 | String[] parts = command.split(" "); 122 | this.username = parts[1]; 123 | log("Connecting with username : " + username); 124 | warpClient = new AppWarpClient(username); 125 | synchronizer = new Synchronizer(warpClient, new CommandFactory()); 126 | warpClient.connect(); 127 | warpClient.addNetworkListener(new NetworkListenerAdapter() { 128 | @Override 129 | public void onMessageReceived(String from, String message) { 130 | System.out.println("Command received : " + message + " from " + from); 131 | } 132 | 133 | @Override 134 | public void onPlayerJoinedRoom(RoomModel room, String playerName) { 135 | System.out.println(playerName + " joined " + room); 136 | } 137 | 138 | @Override 139 | public void onPlayerLeftRoom(RoomModel room, String playerName) { 140 | System.out.println(playerName + " left " + room); 141 | } 142 | }); 143 | } 144 | 145 | public void log(String s) { 146 | System.out.println(Thread.currentThread().getName() + " : " + s); 147 | } 148 | 149 | } 150 | -------------------------------------------------------------------------------- /desktop/assets/images/1280x800/26pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/assets/images/1280x800/26pt.png -------------------------------------------------------------------------------- /desktop/assets/images/1280x800/40pt_title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/assets/images/1280x800/40pt_title.png -------------------------------------------------------------------------------- /desktop/assets/images/1280x800/Common.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/assets/images/1280x800/Common.png -------------------------------------------------------------------------------- /desktop/assets/images/1280x800/LoadingBar.atlas: -------------------------------------------------------------------------------- 1 | 2 | LoadingBar.png 3 | format: RGBA8888 4 | filter: Linear,Linear 5 | repeat: none 6 | loading_back 7 | rotate: false 8 | xy: 2, 2 9 | size: 105, 105 10 | orig: 105, 105 11 | offset: 0, 0 12 | index: -1 13 | loading_bar 14 | rotate: false 15 | xy: 109, 2 16 | size: 105, 105 17 | orig: 105, 105 18 | offset: 0, 0 19 | index: -1 20 | -------------------------------------------------------------------------------- /desktop/assets/images/1280x800/LoadingBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/assets/images/1280x800/LoadingBar.png -------------------------------------------------------------------------------- /desktop/assets/images/1280x800/large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/assets/images/1280x800/large.png -------------------------------------------------------------------------------- /desktop/assets/images/1280x800/normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/assets/images/1280x800/normal.png -------------------------------------------------------------------------------- /desktop/assets/images/1280x800/pixelfont_26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/assets/images/1280x800/pixelfont_26.png -------------------------------------------------------------------------------- /desktop/assets/images/1280x800/small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/assets/images/1280x800/small.png -------------------------------------------------------------------------------- /desktop/assets/images/1280x800/splash_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/assets/images/1280x800/splash_logo.png -------------------------------------------------------------------------------- /desktop/assets/images/1280x800/uiskin.atlas: -------------------------------------------------------------------------------- 1 | 2 | uiskin.png 3 | format: RGBA8888 4 | filter: Nearest,Nearest 5 | repeat: none 6 | default 7 | rotate: false 8 | xy: 1, 50 9 | size: 254, 77 10 | orig: 254, 77 11 | offset: 0, 0 12 | index: -1 13 | default-window 14 | rotate: false 15 | xy: 1, 20 16 | size: 27, 29 17 | split: 4, 3, 20, 3 18 | orig: 27, 29 19 | offset: 0, 0 20 | index: -1 21 | default-select 22 | rotate: false 23 | xy: 29, 29 24 | size: 27, 20 25 | split: 4, 14, 4, 4 26 | orig: 27, 20 27 | offset: 0, 0 28 | index: -1 29 | default-round-large 30 | rotate: false 31 | xy: 57, 29 32 | size: 20, 20 33 | split: 5, 5, 5, 4 34 | orig: 20, 20 35 | offset: 0, 0 36 | index: -1 37 | default-scroll 38 | rotate: false 39 | xy: 78, 29 40 | size: 20, 20 41 | split: 2, 2, 2, 2 42 | orig: 20, 20 43 | offset: 0, 0 44 | index: -1 45 | default-slider-knob 46 | rotate: false 47 | xy: 1, 1 48 | size: 9, 18 49 | orig: 9, 18 50 | offset: 0, 0 51 | index: -1 52 | default-round-down 53 | rotate: false 54 | xy: 99, 29 55 | size: 12, 20 56 | split: 5, 5, 5, 4 57 | orig: 12, 20 58 | offset: 0, 0 59 | index: -1 60 | default-round 61 | rotate: false 62 | xy: 112, 29 63 | size: 12, 20 64 | split: 5, 5, 5, 4 65 | pad: 4, 4, 1, 1 66 | orig: 12, 20 67 | offset: 0, 0 68 | index: -1 69 | check-off 70 | rotate: false 71 | xy: 11, 5 72 | size: 14, 14 73 | orig: 14, 14 74 | offset: 0, 0 75 | index: -1 76 | textfield 77 | rotate: false 78 | xy: 11, 5 79 | size: 14, 14 80 | split: 3, 3, 3, 3 81 | orig: 14, 14 82 | offset: 0, 0 83 | index: -1 84 | check-on 85 | rotate: false 86 | xy: 125, 35 87 | size: 14, 14 88 | orig: 14, 14 89 | offset: 0, 0 90 | index: -1 91 | tree-minus 92 | rotate: false 93 | xy: 140, 35 94 | size: 14, 14 95 | orig: 14, 14 96 | offset: 0, 0 97 | index: -1 98 | tree-plus 99 | rotate: false 100 | xy: 155, 35 101 | size: 14, 14 102 | orig: 14, 14 103 | offset: 0, 0 104 | index: -1 105 | default-slider 106 | rotate: false 107 | xy: 29, 20 108 | size: 8, 8 109 | split: 2, 2, 2, 2 110 | orig: 8, 8 111 | offset: 0, 0 112 | index: -1 113 | default-pane 114 | rotate: false 115 | xy: 11, 1 116 | size: 5, 3 117 | split: 1, 1, 1, 1 118 | orig: 5, 3 119 | offset: 0, 0 120 | index: -1 121 | default-rect-pad 122 | rotate: false 123 | xy: 11, 1 124 | size: 5, 3 125 | split: 1, 1, 1, 1 126 | orig: 5, 3 127 | offset: 0, 0 128 | index: -1 129 | default-splitpane 130 | rotate: false 131 | xy: 17, 1 132 | size: 5, 3 133 | split: 0, 5, 0, 0 134 | orig: 5, 3 135 | offset: 0, 0 136 | index: -1 137 | cursor 138 | rotate: false 139 | xy: 23, 1 140 | size: 3, 3 141 | split: 1, 1, 1, 1 142 | orig: 3, 3 143 | offset: 0, 0 144 | index: -1 145 | default-splitpane-vertical 146 | rotate: false 147 | xy: 125, 29 148 | size: 3, 5 149 | split: 0, 0, 0, 5 150 | orig: 3, 5 151 | offset: 0, 0 152 | index: -1 153 | default-rect-down 154 | rotate: false 155 | xy: 170, 46 156 | size: 3, 3 157 | split: 1, 1, 1, 1 158 | orig: 3, 3 159 | offset: 0, 0 160 | index: -1 161 | default-rect 162 | rotate: false 163 | xy: 38, 25 164 | size: 3, 3 165 | split: 1, 1, 1, 1 166 | orig: 3, 3 167 | offset: 0, 0 168 | index: -1 169 | default-select-selection 170 | rotate: false 171 | xy: 26, 16 172 | size: 3, 3 173 | split: 1, 1, 1, 1 174 | orig: 3, 3 175 | offset: 0, 0 176 | index: -1 177 | default-pane-noborder 178 | rotate: false 179 | xy: 129, 33 180 | size: 1, 1 181 | split: 0, 0, 0, 0 182 | orig: 1, 1 183 | offset: 0, 0 184 | index: -1 185 | selection 186 | rotate: false 187 | xy: 170, 44 188 | size: 1, 1 189 | orig: 1, 1 190 | offset: 0, 0 191 | index: -1 192 | white 193 | rotate: false 194 | xy: 174, 48 195 | size: 1, 1 196 | orig: 1, 1 197 | offset: 0, 0 198 | index: -1 199 | -------------------------------------------------------------------------------- /desktop/assets/images/1280x800/uiskin.json: -------------------------------------------------------------------------------- 1 | { 2 | com.badlogic.gdx.graphics.g2d.BitmapFont: { 3 | default-font: { file: default.fnt }, 4 | other-font: { file: verdana.fnt } 5 | }, 6 | com.badlogic.gdx.graphics.Color: { 7 | green: { a: 1, b: 0, g: 1, r: 0 }, 8 | white: { a: 1, b: 1, g: 1, r: 1 }, 9 | red: { a: 1, b: 0, g: 0, r: 1 }, 10 | black: { a: 1, b: 0, g: 0, r: 0 } 11 | }, 12 | com.badlogic.gdx.scenes.scene2d.ui.Skin$TintedDrawable: { 13 | dialogDim: { name: white, color: { r: 0, g: 0, b: 0, a: 0.45 } } 14 | }, 15 | com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: { 16 | default: { down: default-round-down, up: default-round }, 17 | toggle: { down: default-round-down, checked: default-round-down, up: default-round } 18 | }, 19 | com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle: { 20 | default: { down: default-round-down, up: default-round, font: default-font, fontColor: white }, 21 | toggle: { down: default-round-down, up: default-round, checked: default-round-down, font: default-font, fontColor: white, downFontColor: red } 22 | }, 23 | 24 | com.badlogic.gdx.scenes.scene2d.ui.SplitPane$SplitPaneStyle: { 25 | default-vertical: { handle: default-splitpane-vertical }, 26 | default-horizontal: { handle: default-splitpane } 27 | }, 28 | com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle: { 29 | default: { vScroll: default-scroll, hScrollKnob: default-round-large, background: default-rect, hScroll: default-scroll, vScrollKnob: default-round-large } 30 | }, 31 | com.badlogic.gdx.scenes.scene2d.ui.Window$WindowStyle: { 32 | default: { titleFont: default-font, background: default-window, titleFontColor: white }, 33 | dialog: { titleFont: default-font, background: default-window, titleFontColor: white, stageBackground: dialogDim } 34 | }, 35 | com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle: { 36 | default-horizontal: { background: default-slider, knob: default-slider-knob }, 37 | default-vertical: { background: default-slider, knob: default-slider-knob } 38 | }, 39 | com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: { 40 | default: { font: default-font, fontColor: white } 41 | }, 42 | com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldStyle: { 43 | default: { selection: selection, background: textfield, font: default-font, fontColor: white, cursor: cursor } 44 | }, 45 | com.badlogic.gdx.scenes.scene2d.ui.CheckBox$CheckBoxStyle: { 46 | default: { checkboxOn: check-on, checkboxOff: check-off, font: default-font, fontColor: white } 47 | }, 48 | com.badlogic.gdx.scenes.scene2d.ui.List$ListStyle: { 49 | default: { fontColorUnselected: white, selection: default-rect-pad, fontColorSelected: white, font: default-font } 50 | }, 51 | com.badlogic.gdx.scenes.scene2d.ui.Touchpad$TouchpadStyle: { 52 | default: { background: default-pane, knob: default-round-large } 53 | }, 54 | com.badlogic.gdx.scenes.scene2d.ui.Tree$TreeStyle: { 55 | default: { minus: tree-minus, plus: tree-plus, selection: default-select-selection } 56 | }, 57 | net.peakgames.mobile.core.ui.widget.NinePatchButton$NinePatchButtonStyle: { 58 | default: { down: default-round-down, up: default-round }, 59 | toggle: { down: default-round-down, checked: default-round-down, up: default-round } 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /desktop/assets/images/1280x800/uiskin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/assets/images/1280x800/uiskin.png -------------------------------------------------------------------------------- /desktop/assets/layout/GameListItem.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /desktop/assets/layout/LobbyScreen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /desktop/assets/layout/Popup.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /desktop/assets/sound/boom.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/assets/sound/boom.ogg -------------------------------------------------------------------------------- /desktop/assets/sound/dropBomb.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/assets/sound/dropBomb.ogg -------------------------------------------------------------------------------- /desktop/assets/sound/dying.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/assets/sound/dying.ogg -------------------------------------------------------------------------------- /desktop/assets/sound/justDied.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/assets/sound/justDied.mp3 -------------------------------------------------------------------------------- /desktop/assets/sound/levelStart.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/assets/sound/levelStart.mp3 -------------------------------------------------------------------------------- /desktop/assets/sound/mainTheme.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/assets/sound/mainTheme.ogg -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/background.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/blueButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/blueButton.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/blueButtonH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/blueButtonH.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/bomb1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/bomb1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/bomb2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/bomb2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/bomb3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/bomb3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/bomb4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/bomb4.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/bomb5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/bomb5.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/bomb6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/bomb6.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/bombButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/bombButton.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/bomberman_lost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/bomberman_lost.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/bomberman_win.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/bomberman_win.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/brick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/brick.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/btnEmpty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/btnEmpty.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/btnEmpty_H.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/btnEmpty_H.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/buttonJoin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/buttonJoin.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/explosion1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/explosion1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/explosion2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/explosion2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/explosion3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/explosion3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/explosion4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/explosion4.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/explosion5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/explosion5.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/explosion6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/explosion6.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/explosion7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/explosion7.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/explosion8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/explosion8.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/explosion9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/explosion9.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/gamePadDown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/gamePadDown.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/gamePadDownH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/gamePadDownH.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/gamePadLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/gamePadLeft.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/gamePadLeftH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/gamePadLeftH.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/gamePadRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/gamePadRight.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/gamePadRightH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/gamePadRightH.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/gamePadUp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/gamePadUp.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/gamePadUpH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/gamePadUpH.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/ghost1dead1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/ghost1dead1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/ghost1dead2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/ghost1dead2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/ghost1dead3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/ghost1dead3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/ghost1move1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/ghost1move1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/ghost1move2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/ghost1move2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/ghost1move3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/ghost1move3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/ghost2dead1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/ghost2dead1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/ghost2dead2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/ghost2dead2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/ghost2dead3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/ghost2dead3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/ghost2move1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/ghost2move1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/ghost2move2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/ghost2move2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/ghost2move3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/ghost2move3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl1down1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl1down1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl1down2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl1down2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl1down3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl1down3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl1left1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl1left1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl1left2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl1left2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl1left3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl1left3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl1right1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl1right1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl1right2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl1right2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl1right3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl1right3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl1up1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl1up1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl1up2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl1up2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl1up3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl1up3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl2down1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl2down1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl2down2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl2down2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl2down3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl2down3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl2left1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl2left1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl2left2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl2left2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl2left3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl2left3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl2right1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl2right1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl2right2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl2right2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl2right3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl2right3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl2up1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl2up1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl2up2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl2up2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl2up3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl2up3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl3down1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl3down1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl3down2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl3down2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl3down3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl3down3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl3left1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl3left1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl3left2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl3left2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl3left3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl3left3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl3right1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl3right1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl3right2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl3right2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl3right3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl3right3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl3up1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl3up1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl3up2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl3up2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl3up3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl3up3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl4down1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl4down1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl4down2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl4down2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl4down3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl4down3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl4left1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl4left1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl4left2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl4left2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl4left3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl4left3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl4right1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl4right1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl4right2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl4right2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl4right3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl4right3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl4up1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl4up1.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl4up2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl4up2.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/girl4up3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/girl4up3.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/greenButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/greenButton.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/greenButtonH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/greenButtonH.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/join.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/join.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/panelBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/panelBackground.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/popupSmallBg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/popupSmallBg.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/powerUp_bomb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/powerUp_bomb.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/rip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/rip.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/settingIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/settingIcon.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/settingIconH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/settingIconH.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/starSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/starSmall.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/sunshine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/sunshine.png -------------------------------------------------------------------------------- /desktop/content/1280x800/Common/wall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/desktop/content/1280x800/Common/wall.png -------------------------------------------------------------------------------- /desktop/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | net.javaci.mobile.bomberman 7 | bomberman 8 | 1.0-SNAPSHOT 9 | 10 | 11 | bomberman-desktop 12 | jar 13 | Desktop 14 | 15 | 16 | net.javaci.mobile.bomberman.java.BombermanDesktop 17 | 18 | 19 | 20 | 21 | net.javaci.mobile.bomberman 22 | bomberman-core 23 | ${project.version} 24 | 25 | 26 | 27 | com.badlogicgames.gdx 28 | gdx 29 | ${gdx.version} 30 | 31 | 32 | 33 | com.badlogicgames.gdx 34 | gdx-backend-lwjgl 35 | ${gdx.version} 36 | 37 | 38 | 39 | com.badlogicgames.gdx 40 | gdx-platform 41 | ${gdx.version} 42 | natives-desktop 43 | 44 | 45 | 46 | 47 | 48 | 49 | assets 50 | 51 | 52 | 53 | 54 | 55 | 56 | com.googlecode.mavennatives 57 | maven-nativedependencies-plugin 58 | 0.0.6 59 | 60 | 61 | unpacknatives 62 | pre-integration-test 63 | copy 64 | 65 | 66 | 67 | 68 | maven-antrun-plugin 69 | 1.6 70 | 71 | 72 | integration-test 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | run 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | maven-assembly-plugin 90 | 2.4 91 | 92 | 93 | jar-with-dependencies 94 | 95 | 96 | 97 | ${mainClass} 98 | 99 | 100 | 101 | 102 | 103 | make-assembly 104 | package 105 | 106 | single 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /desktop/src/main/java/net/javaci/mobile/bomberman/java/BombermanDesktop.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.java; 2 | 3 | import com.badlogic.gdx.backends.lwjgl.LwjglApplication; 4 | import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; 5 | import net.javaci.mobile.bomberman.core.BomberManGame; 6 | 7 | public class BombermanDesktop { 8 | public static void main (String[] args) { 9 | LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); 10 | config.width = 800; 11 | config.height = 480; 12 | 13 | BomberManGame game = new BomberManGame(); 14 | game.initialize(config.width, config.height); 15 | 16 | new LwjglApplication(game, config); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /html/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | net.javaci.mobile.bomberman 7 | bomberman 8 | 1.0-SNAPSHOT 9 | 10 | 11 | bomberman-html 12 | war 13 | Test HTML 14 | 15 | 16 | net.javaci.mobile.bomberman.Test 17 | bomberman 18 | 19 | 20 | 21 | 22 | net.javaci.mobile.bomberman 23 | bomberman-core 24 | ${project.version} 25 | 26 | 27 | 28 | com.badlogicgames.gdx 29 | gdx-backend-gwt 30 | ${gdx.version} 31 | 32 | 33 | 34 | net.javaci.mobile.bomberman 35 | bomberman-core 36 | ${project.version} 37 | sources 38 | provided 39 | 40 | 41 | 42 | com.badlogicgames.gdx 43 | gdx 44 | ${gdx.version} 45 | sources 46 | provided 47 | 48 | 49 | 50 | com.badlogicgames.gdx 51 | gdx-backend-gwt 52 | ${gdx.version} 53 | sources 54 | provided 55 | 56 | 57 | 58 | com.google.gwt 59 | gwt-user 60 | ${gwt.version} 61 | provided 62 | 63 | 64 | com.google.gwt 65 | gwt-servlet 66 | ${gwt.version} 67 | runtime 68 | 69 | 70 | 71 | 72 | 73 | 74 | ${project.basedir}/src/main/java 75 | true 76 | 77 | **/*.gwt.xml 78 | 79 | 80 | 81 | 82 | 83 | 84 | org.codehaus.mojo 85 | gwt-maven-plugin 86 | ${gwt.maven.version} 87 | 88 | ${project.build.directory}/webapp 89 | index.html 90 | 91 | 92 | 93 | 94 | compile 95 | 96 | 97 | 98 | 99 | 100 | org.apache.maven.plugins 101 | maven-war-plugin 102 | 2.3 103 | 104 | ${project.build.directory}/webapp 105 | 106 | 107 | 108 | 109 | 110 | org.mortbay.jetty 111 | jetty-maven-plugin 112 | 8.0.0.v20110901 113 | 114 | ${project.basedir}/target/webapp 115 | 116 | 117 | 118 | test-html 119 | integration-test 120 | 121 | run-exploded 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /html/src/main/java/net/javaci/mobile/bomberman/Test.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /html/src/main/java/net/javaci/mobile/bomberman/html/TestHtml.java: -------------------------------------------------------------------------------- 1 | package net.javaci.mobile.bomberman.html; 2 | 3 | import net.javaci.mobile.bomberman.core.Test; 4 | 5 | import com.badlogic.gdx.ApplicationListener; 6 | import com.badlogic.gdx.backends.gwt.GwtApplication; 7 | import com.badlogic.gdx.backends.gwt.GwtApplicationConfiguration; 8 | 9 | public class TestHtml extends GwtApplication { 10 | @Override 11 | public ApplicationListener getApplicationListener () { 12 | return new Test(); 13 | } 14 | 15 | @Override 16 | public GwtApplicationConfiguration getConfig () { 17 | return new GwtApplicationConfiguration(480, 320); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /html/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /html/src/main/webapp/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/html/src/main/webapp/favicon.ico -------------------------------------------------------------------------------- /html/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Test 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /ios/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDisplayName 6 | Test 7 | CFBundleIconFiles 8 | 9 | touch-icon-57x57.png 10 | 11 | CFBundleIdentifier 12 | net.javaci.mobile.bomberman.bomberman 13 | CFBundleVersion 14 | 1.0 15 | MinimumOSVersion 16 | 5.0 17 | UIDeviceFamily 18 | 19 | 1 20 | 21 | UIStatusBarHidden 22 | 23 | UISupportedInterfaceOrientations 24 | 25 | UIInterfaceOrientationPortrait 26 | UIInterfaceOrientationPortraitUpsideDown 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /ios/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using MonoTouch.Foundation; 3 | using MonoTouch.UIKit; 4 | 5 | using com.badlogic.gdx.backends.ios; 6 | using net.javaci.mobile.bomberman.core; 7 | 8 | namespace net.javaci.mobile.bomberman 9 | { 10 | [Register ("AppDelegate")] 11 | public partial class AppDelegate : IOSApplication { 12 | public AppDelegate () : base(new Test(), createConfig()) {} 13 | 14 | internal static IOSApplicationConfiguration createConfig () { 15 | IOSApplicationConfiguration config = new IOSApplicationConfiguration(); 16 | config.orientationLandscape = true; 17 | config.orientationPortrait = false; 18 | config.useAccelerometer = true; 19 | config.useMonotouchOpenTK = true; 20 | config.useObjectAL = true; 21 | return config; 22 | } 23 | } 24 | 25 | public class Application { 26 | static void Main (string[] args) { 27 | UIApplication.Main (args, null, "AppDelegate"); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ios/bomberman.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | iPhoneSimulator 6 | 10.0.0 7 | 2.0 8 | {3E0014BA-5CAE-4962-A8E4-6BCA453CF618} 9 | {6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10 | Exe 11 | Test 12 | Test 13 | 14 | 15 | true 16 | full 17 | false 18 | bin\iPhoneSimulator\Debug 19 | DEBUG; 20 | prompt 21 | 4 22 | false 23 | true 24 | true 25 | None 26 | 27 | 28 | none 29 | false 30 | bin\iPhoneSimulator\Release 31 | prompt 32 | 4 33 | false 34 | None 35 | 36 | 37 | true 38 | full 39 | false 40 | bin\iPhone\Debug 41 | DEBUG; 42 | prompt 43 | 4 44 | false 45 | iPhone Developer 46 | true 47 | true 48 | -aot "nimt-trampolines=512" -nosymbolstrip -nostrip 49 | ARMv7 50 | 51 | 52 | none 53 | false 54 | bin\iPhone\Release 55 | prompt 56 | 4 57 | false 58 | iPhone Developer 59 | -aot "nimt-trampolines=512" -nosymbolstrip -nostrip 60 | ARMv7 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | bin\bomberman-ios.dll 69 | 70 | 71 | bin\IKVM.OpenJDK.Core.dll 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /ios/bomberman.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "bomberman.csproj", "{3E0014BA-5CAE-4962-A8E4-6BCA453CF618}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|iPhoneSimulator = Debug|iPhoneSimulator 9 | Release|iPhoneSimulator = Release|iPhoneSimulator 10 | Debug|iPhone = Debug|iPhone 11 | Release|iPhone = Release|iPhone 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {3E0014BA-5CAE-4962-A8E4-6BCA453CF618}.Debug|iPhone.ActiveCfg = Debug|iPhone 15 | {3E0014BA-5CAE-4962-A8E4-6BCA453CF618}.Debug|iPhone.Build.0 = Debug|iPhone 16 | {3E0014BA-5CAE-4962-A8E4-6BCA453CF618}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator 17 | {3E0014BA-5CAE-4962-A8E4-6BCA453CF618}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator 18 | {3E0014BA-5CAE-4962-A8E4-6BCA453CF618}.Release|iPhone.ActiveCfg = Release|iPhone 19 | {3E0014BA-5CAE-4962-A8E4-6BCA453CF618}.Release|iPhone.Build.0 = Release|iPhone 20 | {3E0014BA-5CAE-4962-A8E4-6BCA453CF618}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator 21 | {3E0014BA-5CAE-4962-A8E4-6BCA453CF618}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator 22 | EndGlobalSection 23 | GlobalSection(MonoDevelopProperties) = preSolution 24 | StartupItem = bomberman.csproj 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /ios/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | net.javaci.mobile.bomberman 8 | bomberman 9 | 1.0-SNAPSHOT 10 | 11 | 12 | bomberman-ios 13 | dll 14 | Test iOS 15 | 16 | 17 | 18 | net.javaci.mobile.bomberman 19 | bomberman-core 20 | ${project.version} 21 | 22 | 23 | 24 | com.badlogic.gdx 25 | gdx-backend-ios 26 | ${gdx.version} 27 | 28 | 29 | 30 | 31 | 32 | bin 33 | 34 | ${project.artifactId} 35 | 36 | 37 | com.samskivert 38 | ikvm-maven-plugin 39 | 1.1.5 40 | 41 | true 42 | 43 | 44 | -debug 45 | 46 | true 47 | 48 | OpenTK.dll 49 | monotouch.dll 50 | System.Data.dll 51 | Mono.Data.Sqlite.dll 52 | 53 | 54 | bin/IKVM.Runtime.dll 55 | bin/IKVM.Runtime.JNI.dll 56 | bin/IKVM.OpenJDK.Core.dll 57 | bin/IKVM.OpenJDK.Util.dll 58 | bin/IKVM.OpenJDK.Text.dll 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /ios/touch-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstthumb/Bomberman/44b4f92ff976d3c5d089008d15020cb08cc894b5/ios/touch-icon-57x57.png -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | net.javaci.mobile.bomberman 6 | bomberman 7 | 1.0-SNAPSHOT 8 | pom 9 | Test Parent 10 | 11 | 12 | 1.5.3 13 | 4.1.1.4 14 | 3.8.2 15 | 2.5.0 16 | 2.5.0 17 | 18 | 19 | 20 | 21 | gdx-nightlies 22 | https://oss.sonatype.org/content/repositories/snapshots/ 23 | 24 | 25 | 26 | 27 | 28 | 29 | org.apache.maven.plugins 30 | maven-compiler-plugin 31 | 2.5.1 32 | 33 | 1.6 34 | 1.6 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | desktop 43 | 44 | desktop 45 | 46 | 47 | 48 | android 49 | 50 | android 51 | 52 | 53 | 54 | html 55 | 56 | html 57 | 58 | 59 | 60 | ios 61 | 62 | ios 63 | 64 | 65 | 66 | 67 | 68 | core 69 | 70 | 71 | --------------------------------------------------------------------------------