├── calculatorApp ├── app │ ├── .gitignore │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── drawable │ │ │ │ │ ├── logo.jpg │ │ │ │ │ ├── phystech.png │ │ │ │ │ └── ic_launcher_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── values │ │ │ │ │ ├── colors.xml │ │ │ │ │ ├── styles.xml │ │ │ │ │ └── strings.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ │ ├── ic_launcher.xml │ │ │ │ │ └── ic_launcher_round.xml │ │ │ │ └── drawable-v24 │ │ │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── phystech │ │ │ │ └── calculatorapp │ │ │ │ └── MainActivity.kt │ │ ├── test │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── phystech │ │ │ │ └── calculatorapp │ │ │ │ └── ExampleUnitTest.kt │ │ └── androidTest │ │ │ └── java │ │ │ └── com │ │ │ └── phystech │ │ │ └── calculatorapp │ │ │ └── ExampleInstrumentedTest.kt │ ├── proguard-rules.pro │ └── build.gradle ├── settings.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.jar ├── .idea │ ├── codeStyles │ │ ├── codeStyleConfig.xml │ │ └── Project.xml │ ├── render.experimental.xml │ ├── vcs.xml │ ├── misc.xml │ ├── runConfigurations.xml │ └── gradle.xml ├── .gitignore ├── build.gradle ├── calc.txt ├── calcFin.txt ├── MainActivity.kt └── gradlew ├── CanyonBunny ├── settings.gradle ├── android │ ├── ic_launcher-web.png │ ├── assets │ │ ├── images │ │ │ ├── uiskin.png │ │ │ ├── arial-15.png │ │ │ ├── canyonbunny.pack.png │ │ │ ├── canyonbunny-ui.pack.png │ │ │ ├── canyonbunny-ui.json │ │ │ ├── canyonbunny-ui.pack.atlas │ │ │ ├── uiskin.json │ │ │ ├── canyonbunny.pack │ │ │ └── uiskin.atlas │ │ └── levels │ │ │ └── level-01.png │ ├── res │ │ ├── drawable-hdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xhdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xxxhdpi │ │ │ └── ic_launcher.png │ │ ├── values │ │ │ ├── color.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── drawable-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_foreground.xml │ ├── project.properties │ ├── src │ │ └── com │ │ │ └── mygdx │ │ │ └── game │ │ │ └── AndroidLauncher.java │ ├── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── desktop │ ├── assets-raw │ │ └── images │ │ │ ├── canyonbunny.png │ │ │ ├── extrea │ │ │ ├── carrot.png │ │ │ ├── goal.png │ │ │ ├── anim_gold_coin_01.png │ │ │ ├── anim_gold_coin_02.png │ │ │ ├── anim_gold_coin_03.png │ │ │ ├── anim_gold_coin_04.png │ │ │ ├── anim_gold_coin_05.png │ │ │ ├── anim_gold_coin_06.png │ │ │ ├── anim_bunny_copter_01.png │ │ │ ├── anim_bunny_copter_02.png │ │ │ ├── anim_bunny_copter_03.png │ │ │ ├── anim_bunny_copter_04.png │ │ │ ├── anim_bunny_copter_05.png │ │ │ ├── anim_bunny_normal_01.png │ │ │ ├── anim_bunny_normal_02.png │ │ │ └── anim_bunny_normal_03.png │ │ │ ├── images-ui │ │ │ ├── bunny.png │ │ │ ├── coins.png │ │ │ ├── info.png │ │ │ ├── logo.png │ │ │ ├── play-dn.png │ │ │ ├── play-up.png │ │ │ ├── background.png │ │ │ ├── options-dn.png │ │ │ └── options-up.png │ │ │ ├── images │ │ │ ├── cloud01.png │ │ │ ├── cloud02.png │ │ │ ├── cloud03.png │ │ │ ├── bunny_head.png │ │ │ ├── rock_edge.png │ │ │ ├── rock_middle.png │ │ │ ├── item_feather.png │ │ │ ├── mountain_left.png │ │ │ ├── water_overlay.png │ │ │ ├── item_gold_coin.png │ │ │ └── mountain_right.png │ │ │ └── canyonbunny.pack │ ├── src │ │ └── com │ │ │ └── mygdx │ │ │ └── game │ │ │ └── desktop │ │ │ └── DesktopLauncher.kt │ └── build.gradle ├── core │ ├── build.gradle │ └── src │ │ └── com │ │ └── mygdx │ │ └── game │ │ ├── screens │ │ ├── AbstractGameScreen.kt │ │ └── GameScreen.kt │ │ ├── CharacterSkin.kt │ │ ├── objects │ │ ├── WaterOverlay.kt │ │ ├── Feather.kt │ │ ├── GoldCoin.kt │ │ ├── Rock.kt │ │ ├── Clouds.kt │ │ ├── AbstractGameObject.kt │ │ ├── Mountains.kt │ │ └── BunnyHead.kt │ │ ├── Constants.kt │ │ ├── GamePreferences.kt │ │ ├── CameraHelper.kt │ │ ├── CanyonBunny.kt │ │ ├── Assets.kt │ │ ├── Level.kt │ │ └── WorldRenderer.kt ├── .gitignore ├── gradlew.bat ├── build.gradle └── gradlew ├── FlappyBird ├── settings.gradle ├── android │ ├── assets │ │ ├── bg.png │ │ ├── bird.png │ │ ├── bird2.png │ │ ├── toptube.png │ │ └── bottomtube.png │ ├── ic_launcher-web.png │ ├── res │ │ ├── drawable-hdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xhdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xxxhdpi │ │ │ └── ic_launcher.png │ │ ├── values │ │ │ ├── color.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── drawable-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_foreground.xml │ ├── src │ │ └── com │ │ │ └── mygdx │ │ │ └── game │ │ │ └── AndroidLauncher.kt │ ├── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle ├── ios │ ├── data │ │ ├── Default.png │ │ ├── Default@2x.png │ │ ├── Media.xcassets │ │ │ ├── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ ├── ipad-app-icon-76@1x.png │ │ │ │ ├── ipad-app-icon-76@2x.png │ │ │ │ ├── app-store-icon-1024@1x.png │ │ │ │ ├── iphone-app-icon-60@2x.png │ │ │ │ ├── iphone-app-icon-60@3x.png │ │ │ │ ├── ipad-settings-icon-29@1x.png │ │ │ │ ├── ipad-settings-icon-29@2x.png │ │ │ │ ├── ipad-pro-app-icon-83.5@2x.png │ │ │ │ ├── ipad-spotlight-icon-40@1x.png │ │ │ │ ├── ipad-spotlight-icon-40@2x.png │ │ │ │ ├── iphone-spotlight-icon-40@2x.png │ │ │ │ ├── iphone-spotlight-icon-40@3x.png │ │ │ │ ├── ipad-notifications-icon-20@1x.png │ │ │ │ ├── ipad-notifications-icon-20@2x.png │ │ │ │ ├── iphone-notification-icon-20@2x.png │ │ │ │ ├── iphone-notification-icon-20@3x.png │ │ │ │ ├── iphone-spotlight-settings-icon-29@2x.png │ │ │ │ ├── iphone-spotlight-settings-icon-29@3x.png │ │ │ │ └── Contents.json │ │ ├── Default~ipad.png │ │ ├── Default-568h@2x.png │ │ ├── Default@2x~ipad.png │ │ ├── Default-375w-667h@2x.png │ │ ├── Default-414w-736h@3x.png │ │ └── Default-1024w-1366h@2x~ipad.png │ ├── build.gradle │ ├── src │ │ └── com │ │ │ └── mygdx │ │ │ └── game │ │ │ └── IOSLauncher.java │ ├── Info.plist.xml │ └── robovm.xml ├── gradle │ └── wrapper │ │ └── gradle-wrapper.jar ├── core │ ├── build.gradle │ └── src │ │ └── com │ │ └── mygdx │ │ └── game │ │ └── FlappyBird.kt ├── README.md ├── desktop │ ├── src │ │ └── com │ │ │ └── mygdx │ │ │ └── game │ │ │ └── desktop │ │ │ └── DesktopLauncher.java │ └── build.gradle ├── .gitignore ├── build.gradle └── gradlew └── .gitattributes /calculatorApp/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /CanyonBunny/settings.gradle: -------------------------------------------------------------------------------- 1 | include 'desktop', 'android', 'core' -------------------------------------------------------------------------------- /FlappyBird/settings.gradle: -------------------------------------------------------------------------------- 1 | include 'desktop', 'android', 'ios', 'core' -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /calculatorApp/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | rootProject.name='calculatorApp' 3 | -------------------------------------------------------------------------------- /FlappyBird/android/assets/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/android/assets/bg.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Default.png -------------------------------------------------------------------------------- /FlappyBird/android/assets/bird.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/android/assets/bird.png -------------------------------------------------------------------------------- /FlappyBird/android/assets/bird2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/android/assets/bird2.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Default@2x.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /FlappyBird/android/assets/toptube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/android/assets/toptube.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Default~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Default~ipad.png -------------------------------------------------------------------------------- /CanyonBunny/android/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/android/ic_launcher-web.png -------------------------------------------------------------------------------- /FlappyBird/android/assets/bottomtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/android/assets/bottomtube.png -------------------------------------------------------------------------------- /FlappyBird/android/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/android/ic_launcher-web.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Default-568h@2x.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Default@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Default@2x~ipad.png -------------------------------------------------------------------------------- /CanyonBunny/android/assets/images/uiskin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/android/assets/images/uiskin.png -------------------------------------------------------------------------------- /CanyonBunny/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.daemon=true 2 | org.gradle.jvmargs=-Xms128m -Xmx1500m 3 | org.gradle.configureondemand=false 4 | gradle=-version -------------------------------------------------------------------------------- /CanyonBunny/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /FlappyBird/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /FlappyBird/ios/data/Default-375w-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Default-375w-667h@2x.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Default-414w-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Default-414w-736h@3x.png -------------------------------------------------------------------------------- /CanyonBunny/android/assets/images/arial-15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/android/assets/images/arial-15.png -------------------------------------------------------------------------------- /CanyonBunny/android/assets/levels/level-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/android/assets/levels/level-01.png -------------------------------------------------------------------------------- /calculatorApp/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/calculatorApp/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /calculatorApp/app/src/main/res/drawable/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/calculatorApp/app/src/main/res/drawable/logo.jpg -------------------------------------------------------------------------------- /FlappyBird/android/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/android/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /FlappyBird/android/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/android/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Default-1024w-1366h@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Default-1024w-1366h@2x~ipad.png -------------------------------------------------------------------------------- /calculatorApp/app/src/main/res/drawable/phystech.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/calculatorApp/app/src/main/res/drawable/phystech.png -------------------------------------------------------------------------------- /CanyonBunny/android/assets/images/canyonbunny.pack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/android/assets/images/canyonbunny.pack.png -------------------------------------------------------------------------------- /CanyonBunny/android/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/android/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /CanyonBunny/android/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/android/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /CanyonBunny/android/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/android/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /CanyonBunny/android/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/android/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/canyonbunny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/canyonbunny.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/extrea/carrot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/extrea/carrot.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/extrea/goal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/extrea/goal.png -------------------------------------------------------------------------------- /FlappyBird/android/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/android/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /FlappyBird/android/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/android/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /FlappyBird/android/res/drawable-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/android/res/drawable-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /CanyonBunny/android/assets/images/canyonbunny-ui.pack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/android/assets/images/canyonbunny-ui.pack.png -------------------------------------------------------------------------------- /CanyonBunny/android/res/drawable-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/android/res/drawable-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /CanyonBunny/android/res/values/color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFFFF 4 | 5 | -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images-ui/bunny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images-ui/bunny.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images-ui/coins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images-ui/coins.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images-ui/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images-ui/info.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images-ui/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images-ui/logo.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images/cloud01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images/cloud01.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images/cloud02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images/cloud02.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images/cloud03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images/cloud03.png -------------------------------------------------------------------------------- /FlappyBird/android/res/values/color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFFFF 4 | 5 | -------------------------------------------------------------------------------- /CanyonBunny/android/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Canyon Bunny 5 | 6 | 7 | -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images-ui/play-dn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images-ui/play-dn.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images-ui/play-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images-ui/play-up.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images/bunny_head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images/bunny_head.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images/rock_edge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images/rock_edge.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images/rock_middle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images/rock_middle.png -------------------------------------------------------------------------------- /FlappyBird/android/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | FlappyBird 5 | 6 | 7 | -------------------------------------------------------------------------------- /calculatorApp/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/calculatorApp/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /calculatorApp/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/calculatorApp/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /calculatorApp/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/calculatorApp/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /calculatorApp/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/calculatorApp/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images-ui/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images-ui/background.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images-ui/options-dn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images-ui/options-dn.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images-ui/options-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images-ui/options-up.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images/item_feather.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images/item_feather.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images/mountain_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images/mountain_left.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images/water_overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images/water_overlay.png -------------------------------------------------------------------------------- /calculatorApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/calculatorApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images/item_gold_coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images/item_gold_coin.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/images/mountain_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/images/mountain_right.png -------------------------------------------------------------------------------- /calculatorApp/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/calculatorApp/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /calculatorApp/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/calculatorApp/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /calculatorApp/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/calculatorApp/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/extrea/anim_gold_coin_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/extrea/anim_gold_coin_01.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/extrea/anim_gold_coin_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/extrea/anim_gold_coin_02.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/extrea/anim_gold_coin_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/extrea/anim_gold_coin_03.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/extrea/anim_gold_coin_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/extrea/anim_gold_coin_04.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/extrea/anim_gold_coin_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/extrea/anim_gold_coin_05.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/extrea/anim_gold_coin_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/extrea/anim_gold_coin_06.png -------------------------------------------------------------------------------- /calculatorApp/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/calculatorApp/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /calculatorApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/calculatorApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/extrea/anim_bunny_copter_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/extrea/anim_bunny_copter_01.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/extrea/anim_bunny_copter_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/extrea/anim_bunny_copter_02.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/extrea/anim_bunny_copter_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/extrea/anim_bunny_copter_03.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/extrea/anim_bunny_copter_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/extrea/anim_bunny_copter_04.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/extrea/anim_bunny_copter_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/extrea/anim_bunny_copter_05.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/extrea/anim_bunny_normal_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/extrea/anim_bunny_normal_01.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/extrea/anim_bunny_normal_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/extrea/anim_bunny_normal_02.png -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/extrea/anim_bunny_normal_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/CanyonBunny/desktop/assets-raw/images/extrea/anim_bunny_normal_03.png -------------------------------------------------------------------------------- /FlappyBird/core/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "kotlin" 2 | 3 | sourceCompatibility = 1.7 4 | [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' 5 | 6 | sourceSets.main.java.srcDirs = [ "src/" ] 7 | -------------------------------------------------------------------------------- /calculatorApp/.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/ipad-app-icon-76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/ipad-app-icon-76@1x.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/ipad-app-icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/ipad-app-icon-76@2x.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/app-store-icon-1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/app-store-icon-1024@1x.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/iphone-app-icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/iphone-app-icon-60@2x.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/iphone-app-icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/iphone-app-icon-60@3x.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/ipad-settings-icon-29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/ipad-settings-icon-29@1x.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/ipad-settings-icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/ipad-settings-icon-29@2x.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/ipad-pro-app-icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/ipad-pro-app-icon-83.5@2x.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/ipad-spotlight-icon-40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/ipad-spotlight-icon-40@1x.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/ipad-spotlight-icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/ipad-spotlight-icon-40@2x.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-icon-40@2x.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-icon-40@3x.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/ipad-notifications-icon-20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/ipad-notifications-icon-20@1x.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/ipad-notifications-icon-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/ipad-notifications-icon-20@2x.png -------------------------------------------------------------------------------- /calculatorApp/.idea/render.experimental.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/iphone-notification-icon-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/iphone-notification-icon-20@2x.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/iphone-notification-icon-20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/iphone-notification-icon-20@3x.png -------------------------------------------------------------------------------- /FlappyBird/README.md: -------------------------------------------------------------------------------- 1 | This clone of flappy bird is for beginners, one page full code. I wrote this code when i was a beginner at kotlin, if you want to look at real 2D game development with optimization, 2 | please go to my CanyonBunny project. 3 | -------------------------------------------------------------------------------- /calculatorApp/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-settings-icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-settings-icon-29@2x.png -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-settings-icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0-zero/KotlinAndroidApps/master/FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-settings-icon-29@3x.png -------------------------------------------------------------------------------- /CanyonBunny/core/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "kotlin" 2 | 3 | sourceCompatibility = 1.7 4 | [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' 5 | 6 | sourceSets.main.java.srcDirs = [ "src/" ] 7 | 8 | eclipse.project.name = appName + "-core" 9 | -------------------------------------------------------------------------------- /calculatorApp/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /calculatorApp/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | -------------------------------------------------------------------------------- /CanyonBunny/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Apr 10 00:35:29 EET 2020 2 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip 3 | distributionBase=GRADLE_USER_HOME 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /calculatorApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /CanyonBunny/android/res/drawable-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /FlappyBird/android/res/drawable-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /calculatorApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /calculatorApp/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /FlappyBird/ios/build.gradle: -------------------------------------------------------------------------------- 1 | sourceSets.main.java.srcDirs = [ "src/" ] 2 | 3 | sourceCompatibility = '1.7' 4 | [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' 5 | 6 | ext { 7 | mainClassName = "com.mygdx.game.IOSLauncher" 8 | } 9 | 10 | launchIPhoneSimulator.dependsOn build 11 | launchIPadSimulator.dependsOn build 12 | launchIOSDevice.dependsOn build 13 | createIPA.dependsOn build 14 | 15 | robovm { 16 | archs = "thumbv7:arm64" 17 | } 18 | -------------------------------------------------------------------------------- /calculatorApp/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /CanyonBunny/android/assets/images/canyonbunny-ui.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: { 4 | play: { down: play-dn, up: play-up }, 5 | options: { down: options-dn, up: options-up } 6 | }, 7 | com.badlogic.gdx.scenes.scene2d.ui.Image: { 8 | background: { drawable: background }, 9 | logo: { drawable: logo }, 10 | info: { drawable: info }, 11 | bunny: { drawable: bunny }, 12 | coins: { drawable: coins }, 13 | }, 14 | } 15 | -------------------------------------------------------------------------------- /calculatorApp/app/src/test/java/com/phystech/calculatorapp/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.phystech.calculatorapp 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /FlappyBird/desktop/src/com/mygdx/game/desktop/DesktopLauncher.java: -------------------------------------------------------------------------------- 1 | package com.mygdx.game.desktop; 2 | 3 | import com.badlogic.gdx.backends.lwjgl.LwjglApplication; 4 | import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; 5 | import com.mygdx.game.FlappyBird; 6 | 7 | public class DesktopLauncher { 8 | public static void main (String[] arg) { 9 | LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); 10 | new LwjglApplication(new FlappyBird(), config); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /CanyonBunny/core/src/com/mygdx/game/screens/AbstractGameScreen.kt: -------------------------------------------------------------------------------- 1 | /* 2 | Author : Arda 3 | Company : PhysTech 4 | Date : 4/17/2020 5 | */ 6 | 7 | package com.mygdx.game.screens 8 | 9 | import com.mygdx.game.Assets 10 | import com.mygdx.game.CanyonBunny 11 | import ktx.app.* 12 | 13 | abstract class AbstractGameScreen(val game: KtxGame) : KtxScreen { 14 | 15 | override fun resume() { 16 | Assets 17 | } 18 | 19 | override fun dispose() { 20 | Assets.dispose() 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /FlappyBird/android/src/com/mygdx/game/AndroidLauncher.kt: -------------------------------------------------------------------------------- 1 | package com.mygdx.game 2 | 3 | import android.os.Bundle 4 | import com.badlogic.gdx.backends.android.AndroidApplication 5 | import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration 6 | 7 | class AndroidLauncher : AndroidApplication() { 8 | override fun onCreate(savedInstanceState: Bundle?) { 9 | super.onCreate(savedInstanceState) 10 | val config = AndroidApplicationConfiguration() 11 | initialize(FlappyBird(), config) 12 | } 13 | } -------------------------------------------------------------------------------- /CanyonBunny/core/src/com/mygdx/game/CharacterSkin.kt: -------------------------------------------------------------------------------- 1 | /* 2 | Author : Arda 3 | Company : PhysTech 4 | Date : 5/20/2020 5 | */ 6 | 7 | package com.mygdx.game 8 | 9 | import com.badlogic.gdx.graphics.Color 10 | 11 | enum class CharacterSkin(s: String, fl: Float, fl1: Float, fl2: Float) { 12 | WHITE("Gray", 0.7f, 0.7f, 0.7f),GRAY("Gray", 0.7f, 0.7f, 0.7f),BROWN("Gray", 0.7f, 0.7f, 0.7f); 13 | 14 | val color = Color() 15 | 16 | init { 17 | color.set(fl , fl1 , fl2 , 1f) 18 | } 19 | 20 | // fun getColor() : Color = color 21 | } 22 | -------------------------------------------------------------------------------- /CanyonBunny/android/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /FlappyBird/android/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /CanyonBunny/android/project.properties: -------------------------------------------------------------------------------- 1 | # This file is used by the Eclipse ADT plugin. It is unnecessary for IDEA and Android Studio projects, which 2 | # configure Proguard and the Android target via the build.gradle file. 3 | 4 | # To enable ProGuard to work with Eclipse ADT, uncomment this (available properties: sdk.dir, user.home) 5 | # and ensure proguard.jar in the Android SDK is up to date (or alternately reduce the android target to 23 or lower): 6 | # proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-rules.pro 7 | 8 | # Project target. 9 | target=android-19 10 | -------------------------------------------------------------------------------- /CanyonBunny/android/src/com/mygdx/game/AndroidLauncher.java: -------------------------------------------------------------------------------- 1 | package com.mygdx.game; 2 | 3 | import android.os.Bundle; 4 | 5 | import com.badlogic.gdx.backends.android.AndroidApplication; 6 | import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; 7 | import com.mygdx.game.CanyonBunny; 8 | 9 | public class AndroidLauncher extends AndroidApplication { 10 | @Override 11 | protected void onCreate (Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | AndroidApplicationConfiguration config = new AndroidApplicationConfiguration(); 14 | initialize(new CanyonBunny(), config); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /calculatorApp/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /calculatorApp/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /calculatorApp/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext.kotlin_version = '1.3.61' 5 | repositories { 6 | google() 7 | jcenter() 8 | 9 | } 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:3.5.3' 12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | 23 | } 24 | } 25 | 26 | task clean(type: Delete) { 27 | delete rootProject.buildDir 28 | } 29 | -------------------------------------------------------------------------------- /calculatorApp/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | calculatorApp 3 | 0 4 | 1 5 | 2 6 | 3 7 | 4 8 | 5 9 | 6 10 | 7 11 | 8 12 | 9 13 | /7 14 | * 15 | + 16 | - 17 | . 18 | = 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /calculatorApp/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /calculatorApp/app/src/androidTest/java/com/phystech/calculatorapp/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.phystech.calculatorapp 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.phystech.calculatorapp", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /FlappyBird/ios/src/com/mygdx/game/IOSLauncher.java: -------------------------------------------------------------------------------- 1 | package com.mygdx.game; 2 | 3 | import org.robovm.apple.foundation.NSAutoreleasePool; 4 | import org.robovm.apple.uikit.UIApplication; 5 | 6 | import com.badlogic.gdx.backends.iosrobovm.IOSApplication; 7 | import com.badlogic.gdx.backends.iosrobovm.IOSApplicationConfiguration; 8 | import com.mygdx.game.FlappyBird; 9 | 10 | public class IOSLauncher extends IOSApplication.Delegate { 11 | @Override 12 | protected IOSApplication createApplication() { 13 | IOSApplicationConfiguration config = new IOSApplicationConfiguration(); 14 | return new IOSApplication(new FlappyBird(), config); 15 | } 16 | 17 | public static void main(String[] argv) { 18 | NSAutoreleasePool pool = new NSAutoreleasePool(); 19 | UIApplication.main(argv, null, IOSLauncher.class); 20 | pool.close(); 21 | } 22 | } -------------------------------------------------------------------------------- /CanyonBunny/core/src/com/mygdx/game/objects/WaterOverlay.kt: -------------------------------------------------------------------------------- 1 | /* 2 | Author : Arda 3 | Company : PhysTech 4 | Date : 4/8/2020 5 | */ 6 | 7 | package com.mygdx.game.objects 8 | 9 | import com.badlogic.gdx.graphics.g2d.SpriteBatch 10 | import com.mygdx.game.Assets 11 | 12 | class WaterOverlay(length : Float) : AbstractGameObject() { 13 | 14 | private var regWaterOverlay = Assets.levelDecoration.waterOverlay 15 | 16 | init { 17 | dimension.set(length * 10 , 3f) 18 | origin.x = -dimension.x / 2f 19 | } 20 | 21 | override fun render(batch: SpriteBatch) { 22 | var reg = regWaterOverlay 23 | 24 | batch.draw(reg.texture , position.x + origin.x , position.y + origin.y , origin.x , origin.y , dimension.x , dimension.y , scale.x , scale.y , 25 | rotation , reg.regionX , reg.regionY , reg.regionWidth , reg.regionHeight , false , false) 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /CanyonBunny/core/src/com/mygdx/game/objects/Feather.kt: -------------------------------------------------------------------------------- 1 | /* 2 | Author : Arda 3 | Company : PhysTech 4 | Date : 4/10/2020 5 | */ 6 | 7 | package com.mygdx.game.objects 8 | 9 | import com.badlogic.gdx.graphics.g2d.SpriteBatch 10 | import com.mygdx.game.Assets 11 | 12 | class Feather() : AbstractGameObject() { 13 | 14 | private var regFeather = Assets.feather.feather 15 | var collected = false 16 | 17 | init { 18 | dimension.set(0.5f, 0.5f) 19 | //Set bounding box for collision detection 20 | bounds.set(0f, 0f, dimension.x, dimension.y) 21 | } 22 | 23 | override fun render(batch: SpriteBatch) { 24 | batch.draw(regFeather.texture, position.x, position.y, origin.x, origin.y, dimension.x, dimension.y, scale.x, scale.y, 25 | rotation, regFeather.regionX, regFeather.regionY, regFeather.regionWidth, regFeather.regionHeight, false, false) 26 | } 27 | 28 | fun getScore() : Int = 250 29 | 30 | } -------------------------------------------------------------------------------- /calculatorApp/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /CanyonBunny/core/src/com/mygdx/game/objects/GoldCoin.kt: -------------------------------------------------------------------------------- 1 | /* 2 | Author : Arda 3 | Company : PhysTech 4 | Date : 4/10/2020 5 | */ 6 | 7 | package com.mygdx.game.objects 8 | 9 | import com.badlogic.gdx.graphics.g2d.SpriteBatch 10 | import com.mygdx.game.Assets 11 | 12 | class GoldCoin() : AbstractGameObject(){ 13 | private var regGoldCoin = Assets.goldCoin.goldCoin 14 | var collected : Boolean = false 15 | 16 | init { 17 | dimension.set(0.5f , 0.5f) 18 | bounds.set(0f , 0f , dimension.x , dimension.y) 19 | } 20 | 21 | override fun render(batch: SpriteBatch) { 22 | if (collected) return 23 | 24 | var reg = regGoldCoin 25 | batch.draw(reg.texture , position.x , position.y , origin.x , origin.y , dimension.x , dimension.y , scale.x , scale.y , 26 | rotation , reg.regionX , reg.regionY , reg.regionWidth , reg.regionHeight , false , false) 27 | } 28 | 29 | fun getScore() : Int = 100 30 | 31 | } -------------------------------------------------------------------------------- /CanyonBunny/core/src/com/mygdx/game/Constants.kt: -------------------------------------------------------------------------------- 1 | package com.mygdx.game 2 | 3 | 4 | class Constants 5 | { 6 | companion object{ 7 | const val VIEWPORT_WIDTH = 5.0f 8 | const val VIEWPORT_HEIGHT = 5.0f 9 | const val TEXTURE_ATLAS_OBJECTS = "android/assets/images/canyonbunny.pack" 10 | const val LEVEL_01 = "android/assets/levels/level-01.png" 11 | const val VIEWPORT_GUI_WIDTH = 800f 12 | const val VIEWPORT_GUI_HEIGHT = 480f 13 | const val LIVES_START : Int = 3 14 | const val ITEM_FEATHER_POWERUP_DURATION = 9f 15 | const val TIME_DELAY_GAME_OVER = 3f 16 | const val TEXTURE_ATLAS_UI = "android/assets/images/canyonbunny-ui.pack.atlas" 17 | const val TEXTURE_ATLAS_LIBGDX_UI = "android/assets/images/uiskin.atlas" 18 | const val SKIN_LIBGDX_UI = "android/assets/images/uiskin.json" 19 | const val SKIN_CANYONBUNNY_UI = "android/assets/images/canyonbunny-ui.json" 20 | const val PREFERENCES = "canyonbunny.preferences" 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /CanyonBunny/android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /FlappyBird/android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /FlappyBird/desktop/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "kotlin" 2 | 3 | sourceCompatibility = 1.7 4 | sourceSets.main.java.srcDirs = [ "src/" ] 5 | sourceSets.main.resources.srcDirs = ["../android/assets"] 6 | 7 | project.ext.mainClassName = "com.mygdx.game.desktop.DesktopLauncher" 8 | project.ext.assetsDir = new File("../android/assets") 9 | 10 | task run(dependsOn: classes, type: JavaExec) { 11 | main = project.mainClassName 12 | classpath = sourceSets.main.runtimeClasspath 13 | standardInput = System.in 14 | workingDir = project.assetsDir 15 | ignoreExitValue = true 16 | } 17 | 18 | task debug(dependsOn: classes, type: JavaExec) { 19 | main = project.mainClassName 20 | classpath = sourceSets.main.runtimeClasspath 21 | standardInput = System.in 22 | workingDir = project.assetsDir 23 | ignoreExitValue = true 24 | debug = true 25 | } 26 | 27 | task dist(type: Jar) { 28 | manifest { 29 | attributes 'Main-Class': project.mainClassName 30 | } 31 | dependsOn configurations.runtimeClasspath 32 | from { 33 | configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } 34 | } 35 | with jar 36 | } 37 | 38 | 39 | dist.dependsOn classes 40 | -------------------------------------------------------------------------------- /CanyonBunny/desktop/src/com/mygdx/game/desktop/DesktopLauncher.kt: -------------------------------------------------------------------------------- 1 | package com.mygdx.game.desktop 2 | 3 | import com.badlogic.gdx.backends.lwjgl.LwjglApplication 4 | import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration 5 | import com.badlogic.gdx.tools.texturepacker.TexturePacker 6 | import com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings 7 | import com.mygdx.game.CanyonBunny 8 | 9 | 10 | object DesktopLauncher { 11 | private var rebuildAtlas = true 12 | private var drawDebugOutline = true 13 | @JvmStatic 14 | fun main(arg: Array) { 15 | 16 | 17 | // if (rebuildAtlas){ 18 | // val settings = Settings() 19 | // settings.maxWidth = 2048 20 | // settings.maxHeight = 2048 21 | // settings.duplicatePadding = false 22 | // settings.debug = drawDebugOutline 23 | // TexturePacker.process(settings , "desktop/assets-raw/images", "android/assets/images", "canyonbunny.pack") 24 | // } 25 | 26 | val config = LwjglApplicationConfiguration() 27 | config.title = "CanyonBunny" 28 | config.width = 800 29 | config.height = 480 30 | LwjglApplication(CanyonBunny() , config) 31 | 32 | } 33 | } -------------------------------------------------------------------------------- /CanyonBunny/desktop/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "kotlin" 2 | 3 | sourceCompatibility = 1.7 4 | sourceSets.main.java.srcDirs = [ "src/" ] 5 | sourceSets.main.resources.srcDirs = ["../android/assets"] 6 | 7 | project.ext.mainClassName = "com.mygdx.game.desktop.DesktopLauncher" 8 | project.ext.assetsDir = new File("../android/assets") 9 | 10 | task run(dependsOn: classes, type: JavaExec) { 11 | main = project.mainClassName 12 | classpath = sourceSets.main.runtimeClasspath 13 | standardInput = System.in 14 | workingDir = project.assetsDir 15 | ignoreExitValue = true 16 | } 17 | 18 | task debug(dependsOn: classes, type: JavaExec) { 19 | main = project.mainClassName 20 | classpath = sourceSets.main.runtimeClasspath 21 | standardInput = System.in 22 | workingDir = project.assetsDir 23 | ignoreExitValue = true 24 | debug = true 25 | } 26 | 27 | task dist(type: Jar) { 28 | manifest { 29 | attributes 'Main-Class': project.mainClassName 30 | } 31 | dependsOn configurations.runtimeClasspath 32 | from { 33 | configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } 34 | } 35 | with jar 36 | } 37 | 38 | 39 | dist.dependsOn classes 40 | 41 | eclipse.project.name = appName + "-desktop" 42 | -------------------------------------------------------------------------------- /calculatorApp/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | apply plugin: 'kotlin-android' 4 | 5 | apply plugin: 'kotlin-android-extensions' 6 | 7 | android { 8 | compileSdkVersion 29 9 | buildToolsVersion "29.0.3" 10 | defaultConfig { 11 | applicationId "com.phystech.calculatorapp" 12 | minSdkVersion 17 13 | targetSdkVersion 29 14 | versionCode 1 15 | versionName "1.0" 16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | } 25 | 26 | dependencies { 27 | implementation fileTree(dir: 'libs', include: ['*.jar']) 28 | implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 29 | implementation 'androidx.appcompat:appcompat:1.0.2' 30 | implementation 'androidx.core:core-ktx:1.0.2' 31 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 32 | testImplementation 'junit:junit:4.12' 33 | androidTestImplementation 'androidx.test.ext:junit:1.1.0' 34 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 35 | } 36 | -------------------------------------------------------------------------------- /CanyonBunny/android/assets/images/canyonbunny-ui.pack.atlas: -------------------------------------------------------------------------------- 1 | 2 | canyonbunny-ui.pack.png 3 | size: 1024,1024 4 | format: RGBA8888 5 | filter: Nearest,Nearest 6 | repeat: none 7 | background 8 | rotate: false 9 | xy: 2, 482 10 | size: 801, 481 11 | orig: 801, 481 12 | offset: 0, 0 13 | index: -1 14 | bunny 15 | rotate: false 16 | xy: 2, 12 17 | size: 269, 468 18 | orig: 269, 468 19 | offset: 0, 0 20 | index: -1 21 | coins 22 | rotate: false 23 | xy: 273, 123 24 | size: 510, 357 25 | orig: 510, 357 26 | offset: 0, 0 27 | index: -1 28 | info 29 | rotate: false 30 | xy: 615, 39 31 | size: 329, 82 32 | orig: 329, 82 33 | offset: 0, 0 34 | index: -1 35 | logo 36 | rotate: false 37 | xy: 273, 2 38 | size: 340, 119 39 | orig: 340, 119 40 | offset: 0, 0 41 | index: -1 42 | options-dn 43 | rotate: false 44 | xy: 805, 813 45 | size: 150, 150 46 | orig: 150, 150 47 | offset: 0, 0 48 | index: -1 49 | options-up 50 | rotate: false 51 | xy: 805, 661 52 | size: 150, 150 53 | orig: 150, 150 54 | offset: 0, 0 55 | index: -1 56 | play-dn 57 | rotate: false 58 | xy: 805, 509 59 | size: 150, 150 60 | orig: 150, 150 61 | offset: 0, 0 62 | index: -1 63 | play-up 64 | rotate: false 65 | xy: 805, 357 66 | size: 150, 150 67 | orig: 150, 150 68 | offset: 0, 0 69 | index: -1 70 | -------------------------------------------------------------------------------- /CanyonBunny/core/src/com/mygdx/game/GamePreferences.kt: -------------------------------------------------------------------------------- 1 | /* 2 | Author : Arda 3 | Company : PhysTech 4 | Date : 5/20/2020 5 | */ 6 | 7 | package com.mygdx.game 8 | 9 | import com.badlogic.gdx.Gdx 10 | import com.badlogic.gdx.math.MathUtils 11 | 12 | object GamePreferences { 13 | private val TAG = "GamePreferences" 14 | private val prefs = Gdx.app.getPreferences(Constants.PREFERENCES) 15 | var sound = false 16 | var music = false 17 | var volSound = 0f 18 | var volMusic = 0f 19 | var charSkin = 0 20 | var showFpsCounter = false 21 | 22 | fun load(){ 23 | val sound = prefs.getBoolean("sound" , true) 24 | val music = prefs.getBoolean("music" , true) 25 | val volSound = MathUtils.clamp(prefs.getFloat("volSound" , 0.5f) , 0f , 0f) 26 | val volMusic = MathUtils.clamp(prefs.getFloat("volMusic", 0.5f), 27 | 0.0f, 1.0f); 28 | val charSkin = MathUtils.clamp(prefs.getInteger("charSkin", 0), 29 | 0, 2); 30 | val showFpsCounter = prefs.getBoolean("showFpsCounter", false); 31 | } 32 | 33 | fun save(){ 34 | prefs.putBoolean("sound", sound); 35 | prefs.putBoolean("music", music); 36 | prefs.putFloat("volSound", volSound); 37 | prefs.putFloat("volMusic", volMusic); 38 | prefs.putInteger("charSkin", charSkin); 39 | prefs.putBoolean("showFpsCounter", showFpsCounter); 40 | prefs.flush(); 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /CanyonBunny/core/src/com/mygdx/game/CameraHelper.kt: -------------------------------------------------------------------------------- 1 | /* 2 | Author : Arda 3 | Company : PhysTech 4 | Date : 4/6/2020 5 | */ 6 | 7 | package com.mygdx.game 8 | 9 | import com.badlogic.gdx.graphics.OrthographicCamera 10 | import com.badlogic.gdx.graphics.g2d.Sprite 11 | import com.badlogic.gdx.math.MathUtils 12 | import com.badlogic.gdx.math.Vector2 13 | import com.mygdx.game.objects.AbstractGameObject 14 | 15 | class CameraHelper { 16 | private val TAG = "CameraHelper" 17 | private val MAX_ZOOM_IN = 0.25f 18 | private val MAX_ZOOM_OUT = 10.0f 19 | 20 | var position : Vector2 = Vector2() 21 | private var zoom : Float = 1.0f 22 | var target : AbstractGameObject? = null 23 | 24 | fun update(deltaTime : Float){ 25 | 26 | if (target!= null){ 27 | position.x = target!!.position.x + target!!.origin.y 28 | position.y = target!!.position.y + target!!.origin.y 29 | } 30 | 31 | //Prevent camera from moving too far 32 | position.y = Math.max(-1f , position.y) 33 | } 34 | 35 | 36 | fun addZoom(amount : Float) = setZoom(zoom + amount) 37 | fun setZoom(Zoom : Float) { 38 | zoom = MathUtils.clamp(Zoom , MAX_ZOOM_IN , MAX_ZOOM_OUT)} 39 | fun getZoom() : Float = zoom 40 | 41 | 42 | 43 | fun applyTo(camera : OrthographicCamera){ 44 | camera.position.x = position.x 45 | camera.position.y = position.y 46 | camera.zoom = zoom 47 | camera.update() 48 | } 49 | 50 | 51 | } -------------------------------------------------------------------------------- /CanyonBunny/desktop/assets-raw/images/canyonbunny.pack: -------------------------------------------------------------------------------- 1 | 2 | canyonbunny.png 3 | format: RGBA8888 4 | filter: Nearest,Nearest 5 | repeat: none 6 | mountain_left 7 | rotate: false 8 | xy: 1, 712 9 | size: 1000, 225 10 | orig: 1000, 225 11 | offset: 0, 0 12 | index: -1 13 | mountain_right 14 | rotate: false 15 | xy: 1, 485 16 | size: 1000, 225 17 | orig: 1000, 225 18 | offset: 0, 0 19 | index: -1 20 | rock_middle 21 | rotate: false 22 | xy: 1, 127 23 | size: 86, 356 24 | orig: 86, 356 25 | offset: 0, 0 26 | index: -1 27 | rock_edge 28 | rotate: false 29 | xy: 89, 127 30 | size: 63, 356 31 | orig: 63, 356 32 | offset: 0, 0 33 | index: -1 34 | cloud02 35 | rotate: false 36 | xy: 154, 395 37 | size: 198, 88 38 | orig: 198, 88 39 | offset: 0, 0 40 | index: -1 41 | cloud03 42 | rotate: false 43 | xy: 154, 308 44 | size: 182, 85 45 | orig: 182, 85 46 | offset: 0, 0 47 | index: -1 48 | cloud01 49 | rotate: false 50 | xy: 354, 405 51 | size: 178, 78 52 | orig: 178, 78 53 | offset: 0, 0 54 | index: -1 55 | bunny_head 56 | rotate: false 57 | xy: 1, 43 58 | size: 122, 82 59 | orig: 122, 82 60 | offset: 0, 0 61 | index: -1 62 | water_overlay 63 | rotate: false 64 | xy: 154, 146 65 | size: 32, 160 66 | orig: 32, 160 67 | offset: 0, 0 68 | index: -1 69 | item_gold_coin 70 | rotate: false 71 | xy: 534, 427 72 | size: 56, 56 73 | orig: 56, 56 74 | offset: 0, 0 75 | index: -1 76 | item_feather 77 | rotate: false 78 | xy: 1, 1 79 | size: 46, 40 80 | orig: 46, 40 81 | offset: 0, 0 82 | index: -1 83 | -------------------------------------------------------------------------------- /FlappyBird/ios/Info.plist.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${app.name} 9 | CFBundleExecutable 10 | ${app.executable} 11 | CFBundleIdentifier 12 | ${app.id} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${app.name} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | ${app.version} 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | ${app.build} 25 | LSRequiresIPhoneOS 26 | 27 | UIViewControllerBasedStatusBarAppearance 28 | 29 | UIStatusBarHidden 30 | 31 | UIDeviceFamily 32 | 33 | 1 34 | 2 35 | 36 | UIRequiredDeviceCapabilities 37 | 38 | armv7 39 | opengles-2 40 | 41 | UISupportedInterfaceOrientations 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationLandscapeLeft 45 | UIInterfaceOrientationLandscapeRight 46 | 47 | CFBundleIconName 48 | AppIcon 49 | 50 | 51 | -------------------------------------------------------------------------------- /CanyonBunny/android/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | 22 | -verbose 23 | 24 | -dontwarn android.support.** 25 | -dontwarn com.badlogic.gdx.backends.android.AndroidFragmentApplication 26 | -dontwarn com.badlogic.gdx.utils.GdxBuild 27 | -dontwarn com.badlogic.gdx.physics.box2d.utils.Box2DBuild 28 | -dontwarn com.badlogic.gdx.jnigen.BuildTarget* 29 | -dontwarn com.badlogic.gdx.graphics.g2d.freetype.FreetypeBuild 30 | 31 | -keep class com.badlogic.gdx.controllers.android.AndroidControllers 32 | 33 | -keepclassmembers class com.badlogic.gdx.backends.android.AndroidInput* { 34 | (com.badlogic.gdx.Application, android.content.Context, java.lang.Object, com.badlogic.gdx.backends.android.AndroidApplicationConfiguration); 35 | } 36 | 37 | -keepclassmembers class com.badlogic.gdx.physics.box2d.World { 38 | boolean contactFilter(long, long); 39 | void beginContact(long); 40 | void endContact(long); 41 | void preSolve(long, long); 42 | void postSolve(long, long); 43 | boolean reportFixture(long); 44 | float reportRayFixture(long, float, float, float, float, float); 45 | } 46 | -------------------------------------------------------------------------------- /FlappyBird/android/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | 22 | -verbose 23 | 24 | -dontwarn android.support.** 25 | -dontwarn com.badlogic.gdx.backends.android.AndroidFragmentApplication 26 | -dontwarn com.badlogic.gdx.utils.GdxBuild 27 | -dontwarn com.badlogic.gdx.physics.box2d.utils.Box2DBuild 28 | -dontwarn com.badlogic.gdx.jnigen.BuildTarget* 29 | -dontwarn com.badlogic.gdx.graphics.g2d.freetype.FreetypeBuild 30 | 31 | -keep class com.badlogic.gdx.controllers.android.AndroidControllers 32 | 33 | -keepclassmembers class com.badlogic.gdx.backends.android.AndroidInput* { 34 | (com.badlogic.gdx.Application, android.content.Context, java.lang.Object, com.badlogic.gdx.backends.android.AndroidApplicationConfiguration); 35 | } 36 | 37 | -keepclassmembers class com.badlogic.gdx.physics.box2d.World { 38 | boolean contactFilter(long, long); 39 | void beginContact(long); 40 | void endContact(long); 41 | void preSolve(long, long); 42 | void postSolve(long, long); 43 | boolean reportFixture(long); 44 | float reportRayFixture(long, float, float, float, float, float); 45 | } 46 | -------------------------------------------------------------------------------- /CanyonBunny/core/src/com/mygdx/game/CanyonBunny.kt: -------------------------------------------------------------------------------- 1 | package com.mygdx.game 2 | 3 | import com.badlogic.gdx.* 4 | import com.badlogic.gdx.graphics.GL20 5 | import com.badlogic.gdx.graphics.Texture 6 | import com.badlogic.gdx.graphics.g2d.SpriteBatch 7 | import com.mygdx.game.screens.GameScreen 8 | import com.mygdx.game.screens.MenuScreen 9 | import ktx.app.KtxApplicationAdapter 10 | import ktx.app.KtxGame 11 | import ktx.app.KtxScreen 12 | import kotlin.properties.Delegates 13 | 14 | 15 | class CanyonBunny() : KtxGame() { 16 | 17 | private val TAG = "CanyonBunnyMain" 18 | // lateinit var worldController : WorldController 19 | // private lateinit var worldRenderer : WorldRenderer 20 | // private var paused by Delegates.notNull() 21 | 22 | 23 | 24 | override fun create() { 25 | Gdx.app.logLevel = Application.LOG_DEBUG 26 | //Load assets 27 | Assets 28 | 29 | // worldController = WorldController(this) 30 | // worldRenderer = WorldRenderer(worldController) 31 | // paused = false 32 | 33 | addScreen(MenuScreen(this)) 34 | addScreen(GameScreen(this)) 35 | setScreen() 36 | 37 | 38 | } 39 | 40 | // override fun render() { 41 | // 42 | // 43 | // if(!paused){ 44 | // worldController.update(Gdx.graphics.deltaTime) 45 | // 46 | // } 47 | // Gdx.gl.glClearColor(0x64/255.0f, 0x95/255.0f, 0xed/255.0f, 0xff/255.0f) 48 | // Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT) 49 | // 50 | // worldRenderer.render() 51 | // } 52 | 53 | // override fun resize(width: Int, height: Int) { 54 | // worldRenderer.resize(width , height) 55 | // } 56 | 57 | override fun dispose() { 58 | // worldRenderer.dispose() 59 | Assets.dispose() 60 | } 61 | 62 | // override fun pause() { 63 | // paused = true 64 | // } 65 | // 66 | // override fun resume() { 67 | // Assets 68 | // paused = false 69 | // } 70 | 71 | 72 | } -------------------------------------------------------------------------------- /calculatorApp/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /FlappyBird/ios/robovm.xml: -------------------------------------------------------------------------------- 1 | 2 | ${app.executable} 3 | ${app.mainclass} 4 | ios 5 | thumbv7 6 | ios 7 | Info.plist.xml 8 | 9 | 10 | ../android/assets 11 | 12 | ** 13 | 14 | true 15 | 16 | 17 | data 18 | 19 | 20 | 21 | com.badlogic.gdx.scenes.scene2d.ui.* 22 | com.badlogic.gdx.graphics.g3d.particles.** 23 | com.android.okhttp.HttpHandler 24 | com.android.okhttp.HttpsHandler 25 | com.android.org.conscrypt.** 26 | com.android.org.bouncycastle.jce.provider.BouncyCastleProvider 27 | com.android.org.bouncycastle.jcajce.provider.keystore.BC$Mappings 28 | com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi 29 | com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi$Std 30 | com.android.org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi 31 | com.android.org.bouncycastle.crypto.digests.AndroidDigestFactoryOpenSSL 32 | org.apache.harmony.security.provider.cert.DRLCertFactory 33 | org.apache.harmony.security.provider.crypto.CryptoProvider 34 | 35 | 36 | z 37 | 38 | 39 | UIKit 40 | OpenGLES 41 | QuartzCore 42 | CoreGraphics 43 | OpenAL 44 | AudioToolbox 45 | AVFoundation 46 | 47 | 48 | -------------------------------------------------------------------------------- /CanyonBunny/core/src/com/mygdx/game/objects/Rock.kt: -------------------------------------------------------------------------------- 1 | /* 2 | Author : Arda 3 | Company : PhysTech 4 | Date : 4/8/2020 5 | */ 6 | 7 | package com.mygdx.game.objects 8 | 9 | import com.badlogic.gdx.graphics.g2d.SpriteBatch 10 | import com.mygdx.game.Assets 11 | 12 | class Rock(var length : Int = 1) : AbstractGameObject() { 13 | init { 14 | dimension.set(1f , 1.5f) 15 | } 16 | 17 | private val regEdge = Assets.rock.edge 18 | private val regMiddle = Assets.rock.middle 19 | 20 | fun increaseLength(amount : Int) { 21 | length += amount 22 | bounds.set(0f , 0f , dimension.x * length , dimension.y) 23 | } 24 | 25 | fun updateBounds(length : Int){ 26 | //Update bounding box for collision detection 27 | bounds.set(0f , 0f , dimension.x * length , dimension.y) 28 | } 29 | 30 | override fun render(batch: SpriteBatch) { 31 | 32 | 33 | var relX = 0f 34 | var relY = 0f 35 | 36 | //Draw left edge 37 | var reg = regEdge 38 | relX -= dimension.x / 4f 39 | 40 | batch.draw(reg.texture , position.x + relX , position.y + relY , origin.x , origin.y , relX , dimension.y / 4f, scale.x , scale.y , rotation , reg.regionX , reg.regionY 41 | , reg.regionWidth , reg.regionHeight , false , false) 42 | 43 | //Draw middle 44 | 45 | relX = 0f 46 | reg = regMiddle 47 | 48 | for (i in 0 until length) { 49 | batch.draw(reg.texture , position.x + relX, position.y + relY, origin.x , origin.y , dimension.x , dimension.y , 50 | scale.x , scale.y , rotation , reg.regionX , reg.regionY , reg.regionWidth , reg.regionHeight , false , false) 51 | relX += dimension.x 52 | } 53 | 54 | //Draw right edge 55 | reg = regEdge 56 | batch.draw(reg.texture , position.x + relX , position.y + relY , origin.x + dimension.x / 8f , origin.y, dimension.x/4f , dimension.y , scale.x , scale.y 57 | , rotation , reg.regionX, reg.regionY, reg.regionWidth , reg.regionWidth , true , false) 58 | 59 | } 60 | 61 | 62 | } -------------------------------------------------------------------------------- /CanyonBunny/core/src/com/mygdx/game/screens/GameScreen.kt: -------------------------------------------------------------------------------- 1 | /* 2 | Author : Arda 3 | Company : PhysTech 4 | Date : 4/18/2020 5 | */ 6 | 7 | package com.mygdx.game.screens 8 | 9 | import com.badlogic.gdx.Game 10 | import com.badlogic.gdx.Gdx 11 | import com.badlogic.gdx.Input 12 | import com.badlogic.gdx.graphics.GL20 13 | import com.mygdx.game.CanyonBunny 14 | import com.mygdx.game.GamePreferences 15 | import com.mygdx.game.WorldController 16 | import com.mygdx.game.WorldRenderer 17 | import ktx.app.KtxGame 18 | import ktx.app.KtxScreen 19 | 20 | 21 | class GameScreen(game : KtxGame) : AbstractGameScreen(game) { 22 | 23 | private lateinit var worldController : WorldController 24 | private lateinit var worldRenderer : WorldRenderer 25 | private var paused : Boolean = false 26 | 27 | 28 | override fun render(delta: Float) { 29 | //Don't update when game is paused 30 | if(!paused){ 31 | //Update game world by the time that has passed since last rendered frame 32 | worldController.update(delta) 33 | } 34 | //Sets the clear screen color to : Cornflower blue 35 | Gdx.gl.glClearColor(0x64 / 255f , 0x95 / 255f , 0xed/255f , 0xff / 255f) 36 | //Clears screen 37 | Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT) 38 | //Render game world to screen 39 | worldRenderer.render() 40 | } 41 | 42 | override fun show() { 43 | GamePreferences.load() 44 | Gdx.input.setCatchKey(Input.Keys.BACK , true) 45 | } 46 | 47 | override fun hide(){ 48 | worldRenderer.dispose() 49 | Gdx.input.setCatchKey(Input.Keys.BACK , false) 50 | } 51 | 52 | override fun pause() { 53 | paused = true 54 | } 55 | 56 | override fun resume() { 57 | super.resume() 58 | //Only called on android 59 | paused = false 60 | } 61 | 62 | override fun resize(width: Int, height: Int) { 63 | worldController = WorldController(game) 64 | worldRenderer = WorldRenderer(worldController) 65 | worldRenderer.resize(width , height) 66 | } 67 | 68 | 69 | } -------------------------------------------------------------------------------- /CanyonBunny/core/src/com/mygdx/game/objects/Clouds.kt: -------------------------------------------------------------------------------- 1 | /* 2 | Author : Arda 3 | Company : PhysTech 4 | Date : 4/9/2020 5 | */ 6 | 7 | package com.mygdx.game.objects 8 | 9 | import com.badlogic.gdx.graphics.g2d.SpriteBatch 10 | import com.badlogic.gdx.graphics.g2d.TextureRegion 11 | import com.badlogic.gdx.math.MathUtils 12 | import com.badlogic.gdx.math.Vector2 13 | import com.mygdx.game.Assets 14 | import kotlin.random.Random 15 | import kotlin.random.nextInt 16 | 17 | class Clouds(var length: Float) : AbstractGameObject() { 18 | 19 | private class Cloud(var regCloud: TextureRegion) : AbstractGameObject() { 20 | 21 | override fun render(batch: SpriteBatch) { 22 | var reg = regCloud 23 | batch.draw(reg.texture, position.x + origin.x, position.y + origin.y, origin.x, origin.y, 24 | dimension.x, dimension.y, scale.x, scale.y, rotation, reg.regionX, reg.regionY, reg.regionWidth, reg.regionHeight, false, false) 25 | 26 | } 27 | } 28 | 29 | 30 | private var regClouds: ArrayList = arrayListOf() 31 | private var clouds : ArrayList = arrayListOf() 32 | private val distFac = 5 33 | private val numClouds = length / distFac 34 | 35 | init { 36 | dimension.set(3.0f, 1.5f) 37 | regClouds.add(Assets.levelDecoration.cloud01) 38 | regClouds.add(Assets.levelDecoration.cloud02) 39 | regClouds.add(Assets.levelDecoration.cloud03) 40 | 41 | } 42 | private fun spawnCloud() : Cloud{ 43 | val cloud = Cloud(regClouds.random()) 44 | cloud.dimension.set(dimension) 45 | //Position 46 | val pos = Vector2() 47 | pos.x = length + 10f //Position after end of level 48 | pos.y += 1.75f //Base position 49 | pos.y += MathUtils.random(0f , 0.2f) * randBool() //Random additional pos 50 | cloud.position.set(pos) 51 | return cloud 52 | } 53 | 54 | private fun randBool() : Int{ 55 | val rand = Random.nextInt(IntRange(-10 , 10)) 56 | return if(rand > 0) 1 else 0 57 | } 58 | 59 | override fun render(batch: SpriteBatch) { 60 | clouds.forEach { it.render(batch) } 61 | } 62 | 63 | } -------------------------------------------------------------------------------- /CanyonBunny/core/src/com/mygdx/game/objects/AbstractGameObject.kt: -------------------------------------------------------------------------------- 1 | /* 2 | Author : Arda 3 | Company : PhysTech 4 | Date : 4/8/2020 5 | */ 6 | 7 | package com.mygdx.game.objects 8 | 9 | import com.badlogic.gdx.graphics.g2d.SpriteBatch 10 | import com.badlogic.gdx.math.MathUtils 11 | import com.badlogic.gdx.math.Rectangle 12 | import com.badlogic.gdx.math.Vector2 13 | 14 | abstract class AbstractGameObject { 15 | val position: Vector2 = Vector2() 16 | val dimension: Vector2 = Vector2(1f, 1f) 17 | val origin: Vector2 = Vector2() 18 | val scale: Vector2 = Vector2(1f, 1f) 19 | val rotation: Float = 0f 20 | val velocity = Vector2() 21 | val terminalVelocity = Vector2(1f, 1f) 22 | val friction = Vector2() 23 | val acceleration = Vector2() 24 | val bounds = Rectangle() 25 | 26 | protected open fun updateMotionX(deltaTime: Float) { 27 | if (velocity.x != 0f) { 28 | //Apply friction 29 | } 30 | if (velocity.x > 0) { 31 | velocity.x = Math.max(velocity.x - friction.x * deltaTime, 0f) 32 | } else { 33 | velocity.x = Math.min(velocity.x + friction.x * deltaTime, 0f) 34 | } 35 | //Apply acceleration 36 | velocity.x += acceleration.x * deltaTime 37 | //Making sure it doesnt accede terminal velocity 38 | velocity.x = MathUtils.clamp(velocity.x, -terminalVelocity.x, terminalVelocity.x) 39 | } 40 | 41 | protected open fun updateMotionY(deltaTime: Float) { 42 | if (velocity.y != 0f) { 43 | //Apply friction 44 | } 45 | if (velocity.y > 0) { 46 | velocity.y = Math.max(velocity.y - friction.y * deltaTime, 0f) 47 | } else { 48 | velocity.y = Math.min(velocity.y + friction.y * deltaTime, 0f) 49 | } 50 | //Apply acceleration 51 | velocity.y += acceleration.y * deltaTime 52 | //Making sure it doesnt accede terminal velocity 53 | velocity.y = MathUtils.clamp(velocity.y, -terminalVelocity.y, terminalVelocity.y) 54 | } 55 | 56 | open fun update(deltaTime: Float) { 57 | updateMotionX(deltaTime) 58 | updateMotionY(deltaTime) 59 | //Move to new position 60 | position.x += velocity.x * deltaTime 61 | position.y += velocity.y * deltaTime 62 | } 63 | 64 | abstract fun render(batch: SpriteBatch) 65 | } 66 | -------------------------------------------------------------------------------- /CanyonBunny/.gitignore: -------------------------------------------------------------------------------- 1 | ## Java 2 | 3 | *.class 4 | *.war 5 | *.ear 6 | hs_err_pid* 7 | 8 | ## Robovm 9 | /ios/robovm-build/ 10 | 11 | ## GWT 12 | /html/war/ 13 | /html/gwt-unitCache/ 14 | .apt_generated/ 15 | .gwt/ 16 | gwt-unitCache/ 17 | www-test/ 18 | .gwt-tmp/ 19 | 20 | ## Android Studio and Intellij and Android in general 21 | /android/libs/armeabi/ 22 | /android/libs/armeabi-v7a/ 23 | /android/libs/arm64-v8a/ 24 | /android/libs/x86/ 25 | /android/libs/x86_64/ 26 | /android/gen/ 27 | .idea/ 28 | *.ipr 29 | *.iws 30 | *.iml 31 | /android/out/ 32 | com_crashlytics_export_strings.xml 33 | 34 | ## Eclipse 35 | 36 | .classpath 37 | .project 38 | .metadata/ 39 | /android/bin/ 40 | /core/bin/ 41 | /desktop/bin/ 42 | /html/bin/ 43 | /ios/bin/ 44 | /ios-moe/bin/ 45 | *.tmp 46 | *.bak 47 | *.swp 48 | *~.nib 49 | .settings/ 50 | .loadpath 51 | .externalToolBuilders/ 52 | *.launch 53 | 54 | ## NetBeans 55 | 56 | /nbproject/private/ 57 | /android/nbproject/private/ 58 | /core/nbproject/private/ 59 | /desktop/nbproject/private/ 60 | /html/nbproject/private/ 61 | /ios/nbproject/private/ 62 | /ios-moe/nbproject/private/ 63 | 64 | /build/ 65 | /android/build/ 66 | /core/build/ 67 | /desktop/build/ 68 | /html/build/ 69 | /ios/build/ 70 | /ios-moe/build/ 71 | 72 | /nbbuild/ 73 | /android/nbbuild/ 74 | /core/nbbuild/ 75 | /desktop/nbbuild/ 76 | /html/nbbuild/ 77 | /ios/nbbuild/ 78 | /ios-moe/nbbuild/ 79 | 80 | /dist/ 81 | /android/dist/ 82 | /core/dist/ 83 | /desktop/dist/ 84 | /html/dist/ 85 | /ios/dist/ 86 | /ios-moe/dist/ 87 | 88 | /nbdist/ 89 | /android/nbdist/ 90 | /core/nbdist/ 91 | /desktop/nbdist/ 92 | /html/nbdist/ 93 | /ios/nbdist/ 94 | /ios-moe/nbdist/ 95 | 96 | nbactions.xml 97 | nb-configuration.xml 98 | 99 | ## Gradle 100 | 101 | /local.properties 102 | .gradle/ 103 | gradle-app.setting 104 | /build/ 105 | /android/build/ 106 | /core/build/ 107 | /desktop/build/ 108 | /html/build/ 109 | /ios/build/ 110 | /ios-moe/build/ 111 | 112 | ## OS Specific 113 | .DS_Store 114 | Thumbs.db 115 | 116 | ## iOS 117 | /ios/xcode/*.xcodeproj/* 118 | !/ios/xcode/*.xcodeproj/xcshareddata 119 | !/ios/xcode/*.xcodeproj/project.pbxproj 120 | /ios/xcode/native/ 121 | /ios/IOSLauncher.app 122 | /ios/IOSLauncher.app.dSYM 123 | 124 | /ios-moe/xcode/*.xcodeproj/* 125 | !/ios-moe/xcode/*.xcodeproj/xcshareddata 126 | !/ios-moe/xcode/*.xcodeproj/project.pbxproj 127 | /ios-moe/xcode/native/ 128 | -------------------------------------------------------------------------------- /FlappyBird/.gitignore: -------------------------------------------------------------------------------- 1 | ## Java 2 | 3 | *.class 4 | *.war 5 | *.ear 6 | hs_err_pid* 7 | 8 | ## Robovm 9 | /ios/robovm-build/ 10 | 11 | ## GWT 12 | /html/war/ 13 | /html/gwt-unitCache/ 14 | .apt_generated/ 15 | .gwt/ 16 | gwt-unitCache/ 17 | www-test/ 18 | .gwt-tmp/ 19 | 20 | ## Android Studio and Intellij and Android in general 21 | /android/libs/armeabi/ 22 | /android/libs/armeabi-v7a/ 23 | /android/libs/arm64-v8a/ 24 | /android/libs/x86/ 25 | /android/libs/x86_64/ 26 | /android/gen/ 27 | .idea/ 28 | *.ipr 29 | *.iws 30 | *.iml 31 | /android/out/ 32 | com_crashlytics_export_strings.xml 33 | 34 | ## Eclipse 35 | 36 | .classpath 37 | .project 38 | .metadata/ 39 | /android/bin/ 40 | /core/bin/ 41 | /desktop/bin/ 42 | /html/bin/ 43 | /ios/bin/ 44 | /ios-moe/bin/ 45 | *.tmp 46 | *.bak 47 | *.swp 48 | *~.nib 49 | .settings/ 50 | .loadpath 51 | .externalToolBuilders/ 52 | *.launch 53 | 54 | ## NetBeans 55 | 56 | /nbproject/private/ 57 | /android/nbproject/private/ 58 | /core/nbproject/private/ 59 | /desktop/nbproject/private/ 60 | /html/nbproject/private/ 61 | /ios/nbproject/private/ 62 | /ios-moe/nbproject/private/ 63 | 64 | /build/ 65 | /android/build/ 66 | /core/build/ 67 | /desktop/build/ 68 | /html/build/ 69 | /ios/build/ 70 | /ios-moe/build/ 71 | 72 | /nbbuild/ 73 | /android/nbbuild/ 74 | /core/nbbuild/ 75 | /desktop/nbbuild/ 76 | /html/nbbuild/ 77 | /ios/nbbuild/ 78 | /ios-moe/nbbuild/ 79 | 80 | /dist/ 81 | /android/dist/ 82 | /core/dist/ 83 | /desktop/dist/ 84 | /html/dist/ 85 | /ios/dist/ 86 | /ios-moe/dist/ 87 | 88 | /nbdist/ 89 | /android/nbdist/ 90 | /core/nbdist/ 91 | /desktop/nbdist/ 92 | /html/nbdist/ 93 | /ios/nbdist/ 94 | /ios-moe/nbdist/ 95 | 96 | nbactions.xml 97 | nb-configuration.xml 98 | 99 | ## Gradle 100 | 101 | /local.properties 102 | .gradle/ 103 | gradle-app.setting 104 | /build/ 105 | /android/build/ 106 | /core/build/ 107 | /desktop/build/ 108 | /html/build/ 109 | /ios/build/ 110 | /ios-moe/build/ 111 | 112 | ## OS Specific 113 | .DS_Store 114 | Thumbs.db 115 | 116 | ## iOS 117 | /ios/xcode/*.xcodeproj/* 118 | !/ios/xcode/*.xcodeproj/xcshareddata 119 | !/ios/xcode/*.xcodeproj/project.pbxproj 120 | /ios/xcode/native/ 121 | /ios/IOSLauncher.app 122 | /ios/IOSLauncher.app.dSYM 123 | 124 | /ios-moe/xcode/*.xcodeproj/* 125 | !/ios-moe/xcode/*.xcodeproj/xcshareddata 126 | !/ios-moe/xcode/*.xcodeproj/project.pbxproj 127 | /ios-moe/xcode/native/ 128 | -------------------------------------------------------------------------------- /CanyonBunny/core/src/com/mygdx/game/objects/Mountains.kt: -------------------------------------------------------------------------------- 1 | /* 2 | Author : Arda 3 | Company : PhysTech 4 | Date : 4/8/2020 5 | */ 6 | 7 | package com.mygdx.game.objects 8 | 9 | import com.badlogic.gdx.graphics.g2d.SpriteBatch 10 | import com.badlogic.gdx.math.MathUtils 11 | import com.mygdx.game.Assets 12 | 13 | class Mountains(var length: Int) : AbstractGameObject() { 14 | private var regMountainLeft = Assets.levelDecoration.mountainLeft 15 | private var regMountainRight = Assets.levelDecoration.mountainRight 16 | 17 | init { 18 | dimension.set(10f, 2f) 19 | 20 | //Shift mountain and extend length 21 | origin.x = -dimension.x * 2f 22 | length += dimension.x.toInt() * 2 23 | } 24 | 25 | private fun drawMountain(batch: SpriteBatch, offsetX: Float, offsetY: Float, tintColor: Float) { 26 | var reg = regMountainLeft 27 | batch.setColor(tintColor, tintColor, tintColor, 1f) 28 | var xRel = dimension.x * offsetX 29 | var yRel = dimension.y * offsetY 30 | 31 | 32 | //Mountains span whole level 33 | var mountainLength = 0 34 | mountainLength += MathUtils.ceil(length / (2 * dimension.x)) 35 | mountainLength += MathUtils.ceil(0.5f + offsetX) 36 | 37 | for (i in 0 until mountainLength) { 38 | //MountainLeft 39 | reg = regMountainLeft 40 | batch.draw(reg.texture, origin.x + xRel, position.y + origin.y + yRel, 41 | origin.x, origin.y, dimension.x, dimension.y, scale.x, scale.y, rotation, reg.regionX, reg.regionY, reg.regionWidth, reg.regionHeight, false, false) 42 | xRel += dimension.x 43 | 44 | 45 | //Mountain right 46 | reg = regMountainRight 47 | batch.draw(reg.texture , origin.x + xRel , position.y + origin.y + yRel, 48 | origin.x , origin.y , dimension.x , dimension.y , scale.x , scale.y , rotation , reg.regionX , reg.regionY , reg.regionWidth , reg.regionHeight , false , false) 49 | xRel += dimension.x 50 | 51 | } 52 | //Reset color to white 53 | batch.setColor(1f , 1f , 1f ,1f) 54 | } 55 | 56 | override fun render(batch: SpriteBatch) { 57 | //Distant mountains(dark gray) 58 | drawMountain(batch , 0.5f , 0.5f , 0.5f) 59 | //Distant mountains(gray) 60 | drawMountain(batch , 0.25f , 0.25f , 0.7f) 61 | //Distant mountains(light gray) 62 | drawMountain(batch , 0f , 0f , 0.9f) 63 | } 64 | 65 | 66 | } -------------------------------------------------------------------------------- /CanyonBunny/android/res/drawable-anydpi-v26/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | 16 | 21 | 26 | 31 | 36 | 40 | 41 | -------------------------------------------------------------------------------- /FlappyBird/android/res/drawable-anydpi-v26/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | 16 | 21 | 26 | 31 | 36 | 40 | 41 | -------------------------------------------------------------------------------- /FlappyBird/android/build.gradle: -------------------------------------------------------------------------------- 1 | android { 2 | buildToolsVersion "29.0.3" 3 | compileSdkVersion 29 4 | sourceSets { 5 | main { 6 | manifest.srcFile 'AndroidManifest.xml' 7 | java.srcDirs = ['src'] 8 | aidl.srcDirs = ['src'] 9 | renderscript.srcDirs = ['src'] 10 | res.srcDirs = ['res'] 11 | assets.srcDirs = ['assets'] 12 | jniLibs.srcDirs = ['libs'] 13 | } 14 | 15 | } 16 | packagingOptions { 17 | exclude 'META-INF/robovm/ios/robovm.xml' 18 | } 19 | defaultConfig { 20 | applicationId "com.mygdx.game" 21 | minSdkVersion 14 22 | targetSdkVersion 29 23 | versionCode 1 24 | versionName "1.0" 25 | } 26 | buildTypes { 27 | release { 28 | minifyEnabled false 29 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 30 | } 31 | } 32 | } 33 | 34 | 35 | // called every time gradle gets executed, takes the native dependencies of 36 | // the natives configuration, and extracts them to the proper libs/ folders 37 | // so they get packed with the APK. 38 | task copyAndroidNatives { 39 | doFirst { 40 | file("libs/armeabi/").mkdirs() 41 | file("libs/armeabi-v7a/").mkdirs() 42 | file("libs/arm64-v8a/").mkdirs() 43 | file("libs/x86_64/").mkdirs() 44 | file("libs/x86/").mkdirs() 45 | 46 | configurations.natives.files.each { jar -> 47 | def outputDir = null 48 | if (jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a") 49 | if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a") 50 | if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi") 51 | if(jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64") 52 | if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86") 53 | if(outputDir != null) { 54 | copy { 55 | from zipTree(jar) 56 | into outputDir 57 | include "*.so" 58 | } 59 | } 60 | } 61 | } 62 | } 63 | 64 | tasks.whenTaskAdded { packageTask -> 65 | if (packageTask.name.contains("package")) { 66 | packageTask.dependsOn 'copyAndroidNatives' 67 | } 68 | } 69 | 70 | task run(type: Exec) { 71 | def path 72 | def localProperties = project.file("../local.properties") 73 | if (localProperties.exists()) { 74 | Properties properties = new Properties() 75 | localProperties.withInputStream { instr -> 76 | properties.load(instr) 77 | } 78 | def sdkDir = properties.getProperty('sdk.dir') 79 | if (sdkDir) { 80 | path = sdkDir 81 | } else { 82 | path = "$System.env.ANDROID_HOME" 83 | } 84 | } else { 85 | path = "$System.env.ANDROID_HOME" 86 | } 87 | 88 | def adb = path + "/platform-tools/adb" 89 | commandLine "$adb", 'shell', 'am', 'start', '-n', 'com.mygdx.game/com.mygdx.game.AndroidLauncher' 90 | } 91 | -------------------------------------------------------------------------------- /FlappyBird/ios/data/Media.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "iphone-notification-icon-20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "iphone-notification-icon-20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "iphone-spotlight-settings-icon-29@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "iphone-spotlight-settings-icon-29@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "iphone-spotlight-icon-40@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "iphone-spotlight-icon-40@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "iphone-app-icon-60@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "iphone-app-icon-60@3x.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "size" : "20x20", 53 | "idiom" : "ipad", 54 | "filename" : "ipad-notifications-icon-20@1x.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "ipad-notifications-icon-20@2x.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "29x29", 65 | "idiom" : "ipad", 66 | "filename" : "ipad-settings-icon-29@1x.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "ipad-settings-icon-29@2x.png", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "size" : "40x40", 77 | "idiom" : "ipad", 78 | "filename" : "ipad-spotlight-icon-40@1x.png", 79 | "scale" : "1x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "ipad-spotlight-icon-40@2x.png", 85 | "scale" : "2x" 86 | }, 87 | { 88 | "size" : "76x76", 89 | "idiom" : "ipad", 90 | "filename" : "ipad-app-icon-76@1x.png", 91 | "scale" : "1x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "ipad-app-icon-76@2x.png", 97 | "scale" : "2x" 98 | }, 99 | { 100 | "size" : "83.5x83.5", 101 | "idiom" : "ipad", 102 | "filename" : "ipad-pro-app-icon-83.5@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "1024x1024", 107 | "idiom" : "ios-marketing", 108 | "filename" : "app-store-icon-1024@1x.png", 109 | "scale" : "1x" 110 | } 111 | ], 112 | "info" : { 113 | "version" : 1, 114 | "author" : "xcode" 115 | } 116 | } -------------------------------------------------------------------------------- /CanyonBunny/android/build.gradle: -------------------------------------------------------------------------------- 1 | android { 2 | buildToolsVersion "29.0.3" 3 | compileSdkVersion 29 4 | sourceSets { 5 | main { 6 | manifest.srcFile 'AndroidManifest.xml' 7 | java.srcDirs = ['src'] 8 | aidl.srcDirs = ['src'] 9 | renderscript.srcDirs = ['src'] 10 | res.srcDirs = ['res'] 11 | assets.srcDirs = ['assets'] 12 | jniLibs.srcDirs = ['libs'] 13 | } 14 | 15 | } 16 | packagingOptions { 17 | exclude 'META-INF/robovm/ios/robovm.xml' 18 | } 19 | defaultConfig { 20 | applicationId "com.mygdx.game" 21 | minSdkVersion 14 22 | targetSdkVersion 29 23 | versionCode 1 24 | versionName "1.0" 25 | } 26 | buildTypes { 27 | release { 28 | minifyEnabled false 29 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 30 | } 31 | } 32 | } 33 | 34 | 35 | // called every time gradle gets executed, takes the native dependencies of 36 | // the natives configuration, and extracts them to the proper libs/ folders 37 | // so they get packed with the APK. 38 | task copyAndroidNatives { 39 | doFirst { 40 | file("libs/armeabi/").mkdirs() 41 | file("libs/armeabi-v7a/").mkdirs() 42 | file("libs/arm64-v8a/").mkdirs() 43 | file("libs/x86_64/").mkdirs() 44 | file("libs/x86/").mkdirs() 45 | 46 | configurations.natives.files.each { jar -> 47 | def outputDir = null 48 | if (jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a") 49 | if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a") 50 | if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi") 51 | if(jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64") 52 | if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86") 53 | if(outputDir != null) { 54 | copy { 55 | from zipTree(jar) 56 | into outputDir 57 | include "*.so" 58 | } 59 | } 60 | } 61 | } 62 | } 63 | 64 | tasks.whenTaskAdded { packageTask -> 65 | if (packageTask.name.contains("package")) { 66 | packageTask.dependsOn 'copyAndroidNatives' 67 | } 68 | } 69 | 70 | task run(type: Exec) { 71 | def path 72 | def localProperties = project.file("../local.properties") 73 | if (localProperties.exists()) { 74 | Properties properties = new Properties() 75 | localProperties.withInputStream { instr -> 76 | properties.load(instr) 77 | } 78 | def sdkDir = properties.getProperty('sdk.dir') 79 | if (sdkDir) { 80 | path = sdkDir 81 | } else { 82 | path = "$System.env.ANDROID_HOME" 83 | } 84 | } else { 85 | path = "$System.env.ANDROID_HOME" 86 | } 87 | 88 | def adb = path + "/platform-tools/adb" 89 | commandLine "$adb", 'shell', 'am', 'start', '-n', 'com.mygdx.game/com.mygdx.game.AndroidLauncher' 90 | } 91 | 92 | eclipse.project.name = appName + "-android" 93 | -------------------------------------------------------------------------------- /CanyonBunny/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem http://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 34 | 35 | @rem Find java.exe 36 | if defined JAVA_HOME goto findJavaFromJavaHome 37 | 38 | set JAVA_EXE=java.exe 39 | %JAVA_EXE% -version >NUL 2>&1 40 | if "%ERRORLEVEL%" == "0" goto init 41 | 42 | echo. 43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 44 | echo. 45 | echo Please set the JAVA_HOME variable in your environment to match the 46 | echo location of your Java installation. 47 | 48 | goto fail 49 | 50 | :findJavaFromJavaHome 51 | set JAVA_HOME=%JAVA_HOME:"=% 52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 53 | 54 | if exist "%JAVA_EXE%" goto init 55 | 56 | echo. 57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 58 | echo. 59 | echo Please set the JAVA_HOME variable in your environment to match the 60 | echo location of your Java installation. 61 | 62 | goto fail 63 | 64 | :init 65 | @rem Get command-line arguments, handling Windows variants 66 | 67 | if not "%OS%" == "Windows_NT" goto win9xME_args 68 | 69 | :win9xME_args 70 | @rem Slurp the command line arguments. 71 | set CMD_LINE_ARGS= 72 | set _SKIP=2 73 | 74 | :win9xME_args_slurp 75 | if "x%~1" == "x" goto execute 76 | 77 | set CMD_LINE_ARGS=%* 78 | 79 | :execute 80 | @rem Setup the command line 81 | 82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 83 | 84 | @rem Execute Gradle 85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 86 | 87 | :end 88 | @rem End local scope for the variables with windows NT shell 89 | if "%ERRORLEVEL%"=="0" goto mainEnd 90 | 91 | :fail 92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 93 | rem the _cmd.exe /c_ return code! 94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 95 | exit /b 1 96 | 97 | :mainEnd 98 | if "%OS%"=="Windows_NT" endlocal 99 | 100 | :omega 101 | -------------------------------------------------------------------------------- /CanyonBunny/android/assets/images/uiskin.json: -------------------------------------------------------------------------------- 1 | { 2 | com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file: default.fnt } }, 3 | com.badlogic.gdx.graphics.Color: { 4 | green: { a: 1, b: 0, g: 1, r: 0 }, 5 | white: { a: 1, b: 1, g: 1, r: 1 }, 6 | red: { a: 1, b: 0, g: 0, r: 1 }, 7 | black: { a: 1, b: 0, g: 0, r: 0 } 8 | }, 9 | com.badlogic.gdx.scenes.scene2d.ui.Skin$TintedDrawable: { 10 | dialogDim: { name: white, color: { r: 0, g: 0, b: 0, a: 0.45 } } 11 | }, 12 | com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: { 13 | default: { down: default-round-down, up: default-round }, 14 | toggle: { down: default-round-down, checked: default-round-down, up: default-round } 15 | }, 16 | com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle: { 17 | default: { down: default-round-down, up: default-round, font: default-font, fontColor: white }, 18 | toggle: { down: default-round-down, up: default-round, checked: default-round-down, font: default-font, fontColor: white, downFontColor: red } 19 | }, 20 | com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle: { 21 | default: { vScroll: default-scroll, hScrollKnob: default-round-large, background: default-rect, hScroll: default-scroll, vScrollKnob: default-round-large } 22 | }, 23 | com.badlogic.gdx.scenes.scene2d.ui.SelectBox$SelectBoxStyle: { 24 | default: { 25 | font: default-font, fontColor: white, background: default-select, 26 | scrollStyle: default, 27 | listStyle: { font: default-font, selection: default-select-selection } 28 | } 29 | }, 30 | com.badlogic.gdx.scenes.scene2d.ui.SplitPane$SplitPaneStyle: { 31 | default-vertical: { handle: default-splitpane-vertical }, 32 | default-horizontal: { handle: default-splitpane } 33 | }, 34 | com.badlogic.gdx.scenes.scene2d.ui.Window$WindowStyle: { 35 | default: { titleFont: default-font, background: default-window, titleFontColor: white }, 36 | dialog: { titleFont: default-font, background: default-window, titleFontColor: white, stageBackground: dialogDim } 37 | }, 38 | com.badlogic.gdx.scenes.scene2d.ui.ProgressBar$ProgressBarStyle: { 39 | default-horizontal: { background: default-slider, knob: default-slider-knob }, 40 | default-vertical: { background: default-slider, knob: default-round-large } 41 | }, 42 | com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle: { 43 | default-horizontal: { background: default-slider, knob: default-slider-knob }, 44 | default-vertical: { background: default-slider, knob: default-round-large } 45 | }, 46 | com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: { 47 | default: { font: default-font, fontColor: white } 48 | }, 49 | com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldStyle: { 50 | default: { selection: selection, background: textfield, font: default-font, fontColor: white, cursor: cursor } 51 | }, 52 | com.badlogic.gdx.scenes.scene2d.ui.CheckBox$CheckBoxStyle: { 53 | default: { checkboxOn: check-on, checkboxOff: check-off, font: default-font, fontColor: white } 54 | }, 55 | com.badlogic.gdx.scenes.scene2d.ui.List$ListStyle: { 56 | default: { fontColorUnselected: white, selection: selection, fontColorSelected: white, font: default-font } 57 | }, 58 | com.badlogic.gdx.scenes.scene2d.ui.Touchpad$TouchpadStyle: { 59 | default: { background: default-pane, knob: default-round-large } 60 | }, 61 | com.badlogic.gdx.scenes.scene2d.ui.Tree$TreeStyle: { 62 | default: { minus: tree-minus, plus: tree-plus, selection: default-select-selection } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /CanyonBunny/android/assets/images/canyonbunny.pack: -------------------------------------------------------------------------------- 1 | 2 | canyonbunny.pack.png 3 | size: 1024,1024 4 | format: RGBA8888 5 | filter: Nearest,Nearest 6 | repeat: none 7 | anim_bunny_copter 8 | rotate: false 9 | xy: 2, 86 10 | size: 125, 112 11 | orig: 125, 112 12 | offset: 0, 0 13 | index: 1 14 | anim_bunny_copter 15 | rotate: false 16 | xy: 537, 357 17 | size: 125, 112 18 | orig: 125, 112 19 | offset: 0, 0 20 | index: 2 21 | anim_bunny_copter 22 | rotate: false 23 | xy: 664, 357 24 | size: 125, 112 25 | orig: 125, 112 26 | offset: 0, 0 27 | index: 3 28 | anim_bunny_copter 29 | rotate: false 30 | xy: 791, 357 31 | size: 125, 112 32 | orig: 125, 112 33 | offset: 0, 0 34 | index: 4 35 | anim_bunny_copter 36 | rotate: false 37 | xy: 155, 157 38 | size: 125, 112 39 | orig: 125, 112 40 | offset: 0, 0 41 | index: 5 42 | anim_bunny_normal 43 | rotate: false 44 | xy: 541, 471 45 | size: 130, 85 46 | orig: 130, 85 47 | offset: 0, 0 48 | index: 1 49 | anim_bunny_normal 50 | rotate: false 51 | xy: 673, 471 52 | size: 130, 85 53 | orig: 130, 85 54 | offset: 0, 0 55 | index: 2 56 | anim_bunny_normal 57 | rotate: false 58 | xy: 805, 471 59 | size: 130, 85 60 | orig: 130, 85 61 | offset: 0, 0 62 | index: 3 63 | anim_gold_coin 64 | rotate: false 65 | xy: 937, 500 66 | size: 56, 56 67 | orig: 56, 56 68 | offset: 0, 0 69 | index: 1 70 | anim_gold_coin 71 | rotate: false 72 | xy: 316, 213 73 | size: 56, 56 74 | orig: 56, 56 75 | offset: 0, 0 76 | index: 2 77 | anim_gold_coin 78 | rotate: false 79 | xy: 316, 155 80 | size: 56, 56 81 | orig: 56, 56 82 | offset: 0, 0 83 | index: 3 84 | anim_gold_coin 85 | rotate: false 86 | xy: 316, 97 87 | size: 56, 56 88 | orig: 56, 56 89 | offset: 0, 0 90 | index: 4 91 | anim_gold_coin 92 | rotate: false 93 | xy: 129, 99 94 | size: 56, 56 95 | orig: 56, 56 96 | offset: 0, 0 97 | index: 5 98 | anim_gold_coin 99 | rotate: false 100 | xy: 187, 99 101 | size: 56, 56 102 | orig: 56, 56 103 | offset: 0, 0 104 | index: 6 105 | bunny_head 106 | rotate: false 107 | xy: 2, 2 108 | size: 122, 82 109 | orig: 122, 82 110 | offset: 0, 0 111 | index: -1 112 | carrot 113 | rotate: false 114 | xy: 245, 103 115 | size: 20, 52 116 | orig: 20, 52 117 | offset: 0, 0 118 | index: -1 119 | cloud01 120 | rotate: false 121 | xy: 357, 391 122 | size: 178, 78 123 | orig: 178, 78 124 | offset: 0, 0 125 | index: -1 126 | cloud02 127 | rotate: false 128 | xy: 155, 271 129 | size: 198, 88 130 | orig: 198, 88 131 | offset: 0, 0 132 | index: -1 133 | cloud03 134 | rotate: false 135 | xy: 357, 471 136 | size: 182, 85 137 | orig: 182, 85 138 | offset: 0, 0 139 | index: -1 140 | goal 141 | rotate: false 142 | xy: 155, 361 143 | size: 200, 195 144 | orig: 200, 195 145 | offset: 0, 0 146 | index: -1 147 | item_feather 148 | rotate: false 149 | xy: 415, 349 150 | size: 46, 40 151 | orig: 46, 40 152 | offset: 0, 0 153 | index: -1 154 | item_gold_coin 155 | rotate: false 156 | xy: 357, 333 157 | size: 56, 56 158 | orig: 56, 56 159 | offset: 0, 0 160 | index: -1 161 | mountain_left 162 | rotate: false 163 | xy: 2, 785 164 | size: 1000, 225 165 | orig: 1000, 225 166 | offset: 0, 0 167 | index: -1 168 | mountain_right 169 | rotate: false 170 | xy: 2, 558 171 | size: 1000, 225 172 | orig: 1000, 225 173 | offset: 0, 0 174 | index: -1 175 | rock_edge 176 | rotate: false 177 | xy: 90, 200 178 | size: 63, 356 179 | orig: 63, 356 180 | offset: 0, 0 181 | index: -1 182 | rock_middle 183 | rotate: false 184 | xy: 2, 200 185 | size: 86, 356 186 | orig: 86, 356 187 | offset: 0, 0 188 | index: -1 189 | water_overlay 190 | rotate: false 191 | xy: 282, 109 192 | size: 32, 160 193 | orig: 32, 160 194 | offset: 0, 0 195 | index: -1 196 | -------------------------------------------------------------------------------- /CanyonBunny/android/assets/images/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 | -------------------------------------------------------------------------------- /CanyonBunny/core/src/com/mygdx/game/Assets.kt: -------------------------------------------------------------------------------- 1 | /* 2 | Author : Arda 3 | Company : PhysTech 4 | Date : 4/7/2020 5 | */ 6 | 7 | package com.mygdx.game 8 | 9 | import com.badlogic.gdx.Gdx 10 | import com.badlogic.gdx.assets.AssetDescriptor 11 | import com.badlogic.gdx.assets.AssetErrorListener 12 | import com.badlogic.gdx.assets.AssetManager 13 | import com.badlogic.gdx.graphics.Texture 14 | import com.badlogic.gdx.graphics.g2d.BitmapFont 15 | import com.badlogic.gdx.graphics.g2d.TextureAtlas 16 | import com.badlogic.gdx.utils.Disposable 17 | 18 | object Assets : Disposable, AssetErrorListener { 19 | val TAG = "Assets" 20 | val assetManager = AssetManager() 21 | val fonts = AssetFonts() 22 | 23 | class AssetFonts(val defaultSmall: BitmapFont = BitmapFont(Gdx.files.internal("images/arial-15.fnt") , true), 24 | val defaultNormal: BitmapFont = BitmapFont(Gdx.files.internal("images/arial-15.fnt") , true), 25 | val defaultBig: BitmapFont = BitmapFont(Gdx.files.internal("images/arial-15.fnt") , true)) { 26 | 27 | init { 28 | //Set font sizes 29 | defaultSmall.data.setScale(0.75f) 30 | defaultNormal.data.setScale(1f) 31 | defaultBig.data.setScale(2f) 32 | //Enable linear texture filtering for smooth fonts 33 | defaultSmall.region.texture.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear) 34 | defaultNormal.region.texture.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear) 35 | defaultBig.region.texture.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear) 36 | } 37 | 38 | } 39 | 40 | init { 41 | //Set asset manager error handler 42 | assetManager.setErrorListener(this) 43 | //Load texture atlas 44 | 45 | assetManager.load(Constants.TEXTURE_ATLAS_OBJECTS, TextureAtlas::class.java) 46 | //Start loading assets and wait 47 | assetManager.finishLoading() 48 | Gdx.app.debug(TAG, "${assetManager.assetNames.size} Assets loaded.") 49 | 50 | assetManager.assetNames.forEach { Gdx.app.debug(TAG, "Asset : $it") } 51 | assetManager.update() 52 | 53 | } 54 | 55 | val atlas: TextureAtlas = assetManager.get(Constants.TEXTURE_ATLAS_OBJECTS) 56 | 57 | init { 58 | atlas.textures.forEach { it.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear) } 59 | } 60 | 61 | //Game objects 62 | val bunny = AssetBunny(atlas) 63 | val goldCoin = AssetGoldCoin(atlas) 64 | val rock = AssetRock(atlas) 65 | val feather = AssetFeather(atlas) 66 | val levelDecoration = AssetDecoration(atlas) 67 | 68 | 69 | override fun dispose() { 70 | assetManager.dispose() 71 | fonts.defaultBig.dispose() 72 | fonts.defaultNormal.dispose() 73 | fonts.defaultSmall.dispose() 74 | } 75 | 76 | override fun error(asset: AssetDescriptor<*>?, throwable: Throwable?) { 77 | Gdx.app.error(TAG, "Asset couldn't be loaded. -> ${asset?.fileName} -> Exception : $throwable ") 78 | } 79 | 80 | class AssetBunny(atlas: TextureAtlas) { 81 | val head = atlas.findRegion("bunny_head") 82 | } 83 | 84 | class AssetRock(atlas: TextureAtlas) { 85 | val edge = atlas.findRegion("rock_edge") 86 | val middle = atlas.findRegion("rock_middle") 87 | } 88 | 89 | class AssetGoldCoin(atlas: TextureAtlas) { 90 | val goldCoin = atlas.findRegion("item_gold_coin") 91 | } 92 | 93 | class AssetFeather(atlas: TextureAtlas) { 94 | val feather = atlas.findRegion("item_feather") 95 | } 96 | 97 | class AssetDecoration(atlas: TextureAtlas) { 98 | val mountainLeft = atlas.findRegion("mountain_left") 99 | val mountainRight = atlas.findRegion("mountain_right") 100 | val cloud01 = atlas.findRegion("cloud01") 101 | val cloud02 = atlas.findRegion("cloud02") 102 | val cloud03 = atlas.findRegion("cloud03") 103 | val waterOverlay = atlas.findRegion("water_overlay") 104 | 105 | } 106 | 107 | } -------------------------------------------------------------------------------- /FlappyBird/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlinVersion = '1.3.41' 3 | 4 | repositories { 5 | mavenLocal() 6 | mavenCentral() 7 | maven { url "https://plugins.gradle.org/m2/" } 8 | maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } 9 | jcenter() 10 | google() 11 | } 12 | dependencies { 13 | classpath 'com.android.tools.build:gradle:3.5.0' 14 | classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.8' 15 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" 16 | 17 | } 18 | } 19 | 20 | allprojects { 21 | 22 | version = '1.0' 23 | ext { 24 | appName = "FlappyBird" 25 | gdxVersion = '1.9.10' 26 | roboVMVersion = '2.3.8' 27 | box2DLightsVersion = '1.4' 28 | ashleyVersion = '1.7.0' 29 | aiVersion = '1.8.0' 30 | } 31 | 32 | repositories { 33 | mavenLocal() 34 | mavenCentral() 35 | jcenter() 36 | google() 37 | maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } 38 | maven { url "https://oss.sonatype.org/content/repositories/releases/" } 39 | } 40 | } 41 | 42 | project(":desktop") { 43 | apply plugin: "kotlin" 44 | 45 | 46 | dependencies { 47 | implementation project(":core") 48 | api "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion" 49 | api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" 50 | api "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop" 51 | api "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" 52 | } 53 | } 54 | 55 | project(":android") { 56 | apply plugin: "android" 57 | apply plugin: "kotlin-android" 58 | 59 | configurations { natives } 60 | 61 | dependencies { 62 | implementation project(":core") 63 | api "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion" 64 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi" 65 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a" 66 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a" 67 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86" 68 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64" 69 | api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion" 70 | natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi" 71 | natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a" 72 | natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-arm64-v8a" 73 | natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86" 74 | natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86_64" 75 | api "com.badlogicgames.ashley:ashley:$ashleyVersion" 76 | api "com.badlogicgames.gdx:gdx-ai:$aiVersion" 77 | api "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" 78 | } 79 | } 80 | 81 | project(":ios") { 82 | apply plugin: "kotlin" 83 | apply plugin: "robovm" 84 | 85 | 86 | dependencies { 87 | implementation project(":core") 88 | api "com.mobidevelop.robovm:robovm-rt:$roboVMVersion" 89 | api "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion" 90 | api "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion" 91 | api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios" 92 | api "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-ios" 93 | api "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" 94 | } 95 | } 96 | 97 | project(":core") { 98 | apply plugin: "kotlin" 99 | 100 | 101 | dependencies { 102 | api "com.badlogicgames.gdx:gdx:$gdxVersion" 103 | api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion" 104 | api "com.badlogicgames.ashley:ashley:$ashleyVersion" 105 | api "com.badlogicgames.gdx:gdx-ai:$aiVersion" 106 | api "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /calculatorApp/calc.txt: -------------------------------------------------------------------------------- 1 | private lateinit var result: EditText 2 | private lateinit var newNumber: EditText 3 | //private var result:EditText? = null #Another usage type 4 | private val displayOperation by lazy(LazyThreadSafetyMode.NONE) {findViewById(R.id.operation)} 5 | 6 | //Variables to hold operands and type of calculation 7 | private var operand1:Double? = null 8 | private var operand2:Double = 0.0 9 | private var pendingOperation:String = "=" 10 | 11 | override fun onCreate(savedInstanceState: Bundle?) { 12 | super.onCreate(savedInstanceState) 13 | setContentView(R.layout.activity_main) 14 | result = findViewById(R.id.result) 15 | newNumber = findViewById(R.id.newNumber) 16 | 17 | //Data input buttons 18 | val button0:Button = findViewById(R.id.button0) 19 | val button1:Button = findViewById(R.id.button1) 20 | val button2:Button = findViewById(R.id.button2) 21 | val button3:Button = findViewById(R.id.button3) 22 | val button4:Button = findViewById(R.id.button4) 23 | val button5:Button = findViewById(R.id.button5) 24 | val button6:Button = findViewById(R.id.button6) 25 | val button7:Button = findViewById(R.id.button7) 26 | val button8:Button = findViewById(R.id.button8) 27 | val button9:Button = findViewById(R.id.button9) 28 | val buttonDot:Button = findViewById(R.id.buttonDot) 29 | 30 | //Button operations 31 | 32 | val buttonEquals:Button = findViewById(R.id.buttonEquals) 33 | val buttonDivide:Button = findViewById(R.id.buttonDivide) 34 | val buttonMultiply:Button = findViewById(R.id.buttonMultiply) 35 | val buttonMinus:Button = findViewById(R.id.buttonMinus) 36 | val buttonSum:Button = findViewById(R.id.buttonSum) 37 | 38 | val listener = View.OnClickListener{v-> 39 | val b = v as Button 40 | newNumber.append(b.text) 41 | } 42 | 43 | button0.setOnClickListener(listener) 44 | button1.setOnClickListener(listener) 45 | button2.setOnClickListener(listener) 46 | button3.setOnClickListener(listener) 47 | button4.setOnClickListener(listener) 48 | button5.setOnClickListener(listener) 49 | button6.setOnClickListener(listener) 50 | button7.setOnClickListener(listener) 51 | button8.setOnClickListener(listener) 52 | button9.setOnClickListener(listener) 53 | buttonDot.setOnClickListener(listener) 54 | 55 | val opListener = View.OnClickListener { v -> 56 | val op = (v as Button).text.toString() 57 | val value = newNumber.text.toString() 58 | if(value.isNotEmpty()){ 59 | performOperation(value, op) 60 | } 61 | /* else if not working!!!! 62 | else if(newNumber.text.toString() == ""){ 63 | displayOperation.setText("No op to calc!") 64 | }*/ 65 | pendingOperation = op 66 | displayOperation.text = pendingOperation 67 | } 68 | 69 | buttonEquals.setOnClickListener(opListener) 70 | buttonSum.setOnClickListener(opListener) 71 | buttonMinus.setOnClickListener(opListener) 72 | buttonMultiply.setOnClickListener(opListener) 73 | buttonDivide.setOnClickListener(opListener) 74 | } 75 | 76 | private fun performOperation(value: String, op:String){ 77 | if(operand1 == null){ 78 | operand1 = value.toDouble() 79 | }else{ 80 | operand2 = value.toDouble() 81 | if(pendingOperation == "="){ 82 | pendingOperation = op 83 | } 84 | when(pendingOperation){ 85 | "=" -> operand1 = operand2 86 | "/" -> if(operand2 == 0.0){ 87 | operand1 = Double.NaN //handle divide by zero 88 | }else{ 89 | operand1 = operand1!! / operand2 90 | } 91 | "+" -> operand1 = operand1!! + operand2 92 | "-" -> operand1 = operand1!! - operand2 93 | "*" -> operand1 = operand1!! * operand2 94 | } 95 | } 96 | result.setText(operand1.toString()) 97 | newNumber.setText("") 98 | } -------------------------------------------------------------------------------- /calculatorApp/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 9 | 10 | 11 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | xmlns:android 20 | 21 | ^$ 22 | 23 | 24 | 25 |
26 |
27 | 28 | 29 | 30 | xmlns:.* 31 | 32 | ^$ 33 | 34 | 35 | BY_NAME 36 | 37 |
38 |
39 | 40 | 41 | 42 | .*:id 43 | 44 | http://schemas.android.com/apk/res/android 45 | 46 | 47 | 48 |
49 |
50 | 51 | 52 | 53 | .*:name 54 | 55 | http://schemas.android.com/apk/res/android 56 | 57 | 58 | 59 |
60 |
61 | 62 | 63 | 64 | name 65 | 66 | ^$ 67 | 68 | 69 | 70 |
71 |
72 | 73 | 74 | 75 | style 76 | 77 | ^$ 78 | 79 | 80 | 81 |
82 |
83 | 84 | 85 | 86 | .* 87 | 88 | ^$ 89 | 90 | 91 | BY_NAME 92 | 93 |
94 |
95 | 96 | 97 | 98 | .* 99 | 100 | http://schemas.android.com/apk/res/android 101 | 102 | 103 | ANDROID_ATTRIBUTE_ORDER 104 | 105 |
106 |
107 | 108 | 109 | 110 | .* 111 | 112 | .* 113 | 114 | 115 | BY_NAME 116 | 117 |
118 |
119 |
120 |
121 | 122 | 124 |
125 |
-------------------------------------------------------------------------------- /CanyonBunny/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlinVersion = '1.3.41' 3 | 4 | repositories { 5 | mavenLocal() 6 | mavenCentral() 7 | maven { url "https://plugins.gradle.org/m2/" } 8 | maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } 9 | jcenter() 10 | google() 11 | } 12 | dependencies { 13 | classpath 'com.android.tools.build:gradle:3.6.0-rc01' 14 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" 15 | 16 | } 17 | } 18 | 19 | allprojects { 20 | apply plugin: "eclipse" 21 | 22 | version = '1.0' 23 | ext { 24 | appName = "Canyon Bunny" 25 | gdxVersion = '1.9.10' 26 | roboVMVersion = '2.3.8' 27 | box2DLightsVersion = '1.4' 28 | ashleyVersion = '1.7.0' 29 | aiVersion = '1.8.0' 30 | } 31 | 32 | repositories { 33 | mavenLocal() 34 | mavenCentral() 35 | jcenter() 36 | google() 37 | maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } 38 | maven { url "https://oss.sonatype.org/content/repositories/releases/" } 39 | } 40 | } 41 | 42 | project(":desktop") { 43 | apply plugin: "kotlin" 44 | 45 | 46 | ext { 47 | // Update this version to match the latest KTX release: 48 | ktxVersion = '1.9.10-b4' 49 | } 50 | 51 | dependencies { 52 | implementation project(":core") 53 | api "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion" 54 | api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" 55 | api "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop" 56 | api "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" 57 | implementation "io.github.libktx:ktx-app:$ktxVersion" 58 | implementation "com.badlogicgames.gdx:gdx-tools:$gdxVersion" 59 | } 60 | 61 | 62 | 63 | } 64 | 65 | project(":android") { 66 | apply plugin: "android" 67 | apply plugin: "kotlin-android" 68 | 69 | ext { 70 | // Update this version to match the latest KTX release: 71 | ktxVersion = '1.9.10-b4' 72 | } 73 | 74 | configurations { natives } 75 | 76 | dependencies { 77 | implementation project(":core") 78 | api "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion" 79 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi" 80 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a" 81 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a" 82 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86" 83 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64" 84 | api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion" 85 | natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi" 86 | natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a" 87 | natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-arm64-v8a" 88 | natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86" 89 | natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86_64" 90 | api "com.badlogicgames.gdx:gdx-ai:$aiVersion" 91 | api "com.badlogicgames.ashley:ashley:$ashleyVersion" 92 | api "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" 93 | implementation "io.github.libktx:ktx-app:$ktxVersion" 94 | implementation "com.badlogicgames.gdx:gdx-tools:$gdxVersion" 95 | } 96 | 97 | } 98 | 99 | project(":core") { 100 | apply plugin: "kotlin" 101 | 102 | ext { 103 | // Update this version to match the latest KTX release: 104 | ktxVersion = '1.9.10-b4' 105 | } 106 | 107 | dependencies { 108 | api "com.badlogicgames.gdx:gdx:$gdxVersion" 109 | api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion" 110 | api "com.badlogicgames.gdx:gdx-ai:$aiVersion" 111 | api "com.badlogicgames.ashley:ashley:$ashleyVersion" 112 | api "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" 113 | implementation "io.github.libktx:ktx-app:$ktxVersion" 114 | implementation "com.badlogicgames.gdx:gdx-tools:$gdxVersion" 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /calculatorApp/app/src/main/java/com/phystech/calculatorapp/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.phystech.calculatorapp 2 | 3 | import android.annotation.SuppressLint 4 | import androidx.appcompat.app.AppCompatActivity 5 | import android.os.Bundle 6 | import android.view.View 7 | import android.widget.Button 8 | import kotlinx.android.synthetic.main.activity_main.* 9 | import java.lang.Exception 10 | 11 | 12 | private const val OPERATION ="Operation" 13 | private const val OPERAND1 = "OPERAND1" 14 | 15 | class MainActivity : AppCompatActivity() { 16 | 17 | private var operand1 : Double? = null 18 | private var operand2 : Double = 0.0 19 | private var pendingOperation = "" 20 | 21 | 22 | @SuppressLint("SetTextI18n") 23 | override fun onCreate(savedInstanceState: Bundle?) { 24 | super.onCreate(savedInstanceState) 25 | setContentView(R.layout.activity_main) 26 | 27 | 28 | val listener = View.OnClickListener{v -> 29 | val b = (v as Button) 30 | if (b.text == "neg"){ 31 | if (newNumber.text.isEmpty()) 32 | newNumber.append("-") 33 | // if (newNumber.text.equals("0.0") && newNumber.text.equals("NaN")){ 34 | // newNumber.text.clear() 35 | // newNumber.text.append("-") 36 | // } 37 | else{ 38 | newNumber.setText("-${newNumber.text}") 39 | } 40 | }else{ 41 | newNumber.append(b.text)} 42 | } 43 | 44 | button0.setOnClickListener(listener) 45 | button1.setOnClickListener(listener) 46 | button2.setOnClickListener(listener) 47 | button3.setOnClickListener(listener) 48 | button4.setOnClickListener(listener) 49 | button5.setOnClickListener(listener) 50 | button6.setOnClickListener(listener) 51 | button7.setOnClickListener(listener) 52 | button8.setOnClickListener(listener) 53 | button9.setOnClickListener(listener) 54 | buttonDot.setOnClickListener(listener) 55 | buttonNeg.setOnClickListener(listener) 56 | 57 | 58 | val operandListener = View.OnClickListener{v -> 59 | val op = (v as Button).text.toString() 60 | val value = newNumber.text.toString() 61 | 62 | if (newNumber.text.isNotEmpty()){ 63 | performOperation(op, value) 64 | } 65 | pendingOperation = op 66 | operation.text = pendingOperation 67 | } 68 | 69 | buttonMinus.setOnClickListener(operandListener) 70 | buttonDivide.setOnClickListener(operandListener) 71 | buttonSum.setOnClickListener(operandListener) 72 | buttonMultiply.setOnClickListener(operandListener) 73 | buttonEquals.setOnClickListener(operandListener) 74 | 75 | } 76 | private fun performOperation(op: String, value: String){ 77 | try{ 78 | if(operand1 == null){ 79 | operand1 = value.toDouble() 80 | }else{ 81 | operand2 = value.toDouble() 82 | if(pendingOperation == "="){ 83 | pendingOperation = op 84 | } 85 | when(pendingOperation){ 86 | "=" -> operand1 = operand2 87 | "+" -> operand1 = operand1!! + operand2 88 | "-" -> operand1 = operand1!! - operand2 89 | "*" -> operand1 = operand1!! * operand2 90 | "/" -> if(operand2 == 0.0){ 91 | operand1 = Double.NaN 92 | }else{ 93 | operand1 = operand1!! / operand2 94 | } 95 | // Another form of writing if statement 96 | // "/" -> operand1 = if(operand2 == 0.0){ 97 | // Double.NaN 98 | // }else{ 99 | // operand1!! / operand2 100 | } 101 | } 102 | result.setText(operand1.toString()) 103 | newNumber.text.clear() 104 | }catch(e : Exception){ 105 | result.setText(Double.NaN.toString()) 106 | newNumber.text.clear() 107 | } 108 | } 109 | 110 | override fun onSaveInstanceState(outState: Bundle) { 111 | super.onSaveInstanceState(outState) 112 | outState.putString(OPERATION, operation.text.toString()) 113 | if (operand1 != null){ 114 | outState.putDouble(OPERAND1, operand1!!)} 115 | } 116 | 117 | override fun onRestoreInstanceState(savedInstanceState: Bundle) { 118 | super.onRestoreInstanceState(savedInstanceState) 119 | if(operand1 != null){ 120 | operand1 = savedInstanceState.getDouble(OPERAND1)} 121 | 122 | operation.text = savedInstanceState.getString(OPERATION) 123 | pendingOperation = operation.text.toString() 124 | 125 | 126 | } 127 | 128 | } 129 | -------------------------------------------------------------------------------- /CanyonBunny/core/src/com/mygdx/game/objects/BunnyHead.kt: -------------------------------------------------------------------------------- 1 | /* 2 | Author : Arda 3 | Company : PhysTech 4 | Date : 4/10/2020 5 | */ 6 | 7 | package com.mygdx.game.objects 8 | 9 | import com.badlogic.gdx.graphics.g2d.SpriteBatch 10 | import com.mygdx.game.Assets 11 | import com.mygdx.game.CharacterSkin 12 | import com.mygdx.game.Constants 13 | import com.mygdx.game.GamePreferences 14 | 15 | class BunnyHead() : AbstractGameObject() { 16 | 17 | private val TAG = "BunnyHead" 18 | private var regHead = Assets.bunny.head 19 | val JUMP_TIME_MAX = 0.3f 20 | val JUMP_TIME_MIN = 0.1f 21 | val JUMP_TIME_OFFSET_FLYING = JUMP_TIME_MAX - 0.018f 22 | var viewDirection = VIEW_DIRECTION.RIGHT 23 | var jumpState = JUMP_STATE.FALLING 24 | var timeJumping = 0f 25 | var hasFeatherPowerUp = false 26 | var timeLeftFeatherPowerUp = 0f 27 | 28 | 29 | enum class VIEW_DIRECTION { LEFT, RIGHT } 30 | enum class JUMP_STATE { GROUNDED , FALLING , JUMP_RISING , JUMP_FALLING } 31 | 32 | init { 33 | dimension.set(1f , 1f) 34 | //Center image on game obj 35 | origin.set(dimension.x / 2f , dimension.y / 2f) 36 | //Bounding box for collision detection 37 | bounds.set(0f , 0f , dimension.x , dimension.y) 38 | //Physics values 39 | terminalVelocity.set(3f , 4f) 40 | friction.set(12f , 0f) 41 | acceleration.set(0f , -25f) 42 | } 43 | 44 | fun setJumping(jumpKeyPressed : Boolean){ 45 | when (jumpState) { 46 | JUMP_STATE.GROUNDED -> { 47 | if (jumpKeyPressed){ 48 | //Start counting jump time 49 | timeJumping = 0f 50 | jumpState = JUMP_STATE.JUMP_RISING 51 | } 52 | } 53 | JUMP_STATE.JUMP_RISING -> { 54 | if(!jumpKeyPressed){ 55 | jumpState = JUMP_STATE.JUMP_FALLING 56 | } 57 | } 58 | JUMP_STATE.FALLING -> { 59 | //Falling 60 | } 61 | JUMP_STATE.JUMP_FALLING -> { 62 | //Falling after jump 63 | if (jumpKeyPressed && hasFeatherPowerUp){ 64 | timeJumping = JUMP_TIME_OFFSET_FLYING 65 | jumpState = JUMP_STATE.JUMP_RISING 66 | } 67 | } 68 | } 69 | } 70 | 71 | fun setFeatherPowerUp(pickedUp : Boolean){ 72 | hasFeatherPowerUp = pickedUp 73 | if(pickedUp){ 74 | timeLeftFeatherPowerUp = Constants.ITEM_FEATHER_POWERUP_DURATION 75 | } 76 | } 77 | 78 | fun hasFeatherPowerUp() : Boolean = hasFeatherPowerUp && timeLeftFeatherPowerUp > 0 79 | 80 | override fun update(deltaTime: Float) { 81 | super.update(deltaTime) 82 | if(velocity.x != 0f) { 83 | viewDirection = if (velocity.x < 0) VIEW_DIRECTION.LEFT else VIEW_DIRECTION.RIGHT 84 | } 85 | if (timeLeftFeatherPowerUp > 0){ 86 | timeLeftFeatherPowerUp -= deltaTime 87 | if(timeLeftFeatherPowerUp < 0){ 88 | timeLeftFeatherPowerUp = 0f 89 | setFeatherPowerUp(false) 90 | } 91 | } 92 | } 93 | 94 | override fun updateMotionY(deltaTime: Float) { 95 | when (jumpState){ 96 | JUMP_STATE.GROUNDED -> jumpState = JUMP_STATE.FALLING 97 | JUMP_STATE.JUMP_RISING -> { 98 | //Keep track of jump time 99 | timeJumping += deltaTime 100 | //Time left? 101 | if (timeJumping <= JUMP_TIME_MAX){ 102 | velocity.y = terminalVelocity.y 103 | } 104 | } 105 | JUMP_STATE.JUMP_FALLING -> { 106 | //Add delta times to track jump time 107 | timeJumping += deltaTime 108 | //Jump to minimal height if jump key was pressed too short 109 | if (timeJumping > 0 && timeJumping <= JUMP_TIME_MIN){ 110 | //Still jumping 111 | velocity.y = terminalVelocity.y 112 | } 113 | } 114 | else -> kotlin.run { } 115 | } 116 | if (jumpState != JUMP_STATE.GROUNDED){ 117 | super.updateMotionY(deltaTime) 118 | } 119 | } 120 | 121 | override fun render(batch: SpriteBatch) { 122 | //Apply skin color 123 | batch.setColor(CharacterSkin.values()[GamePreferences.charSkin].color) 124 | 125 | //Set special color when obj has feather power 126 | if (hasFeatherPowerUp){ 127 | batch.setColor(1f , 0.8f , 0f , 1f) 128 | } 129 | //Draw image 130 | val reg = regHead 131 | batch.draw(reg.texture , position.x , position.y , origin.x , origin.y , dimension.x , dimension.y , scale.x , scale.y, 132 | rotation , reg.regionX , reg.regionY , reg.regionWidth , reg.regionHeight , viewDirection == VIEW_DIRECTION.LEFT , false) 133 | 134 | //Reset color white 135 | batch.setColor(1f , 1f , 1f , 1f) 136 | } 137 | 138 | } -------------------------------------------------------------------------------- /calculatorApp/calcFin.txt: -------------------------------------------------------------------------------- 1 | package com.phystech.calculatorapp 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import android.os.Bundle 5 | import android.view.View 6 | import android.widget.Button 7 | import android.widget.EditText 8 | import android.widget.TextView 9 | import kotlinx.android.synthetic.main.activity_main.* 10 | import java.lang.Exception 11 | 12 | private const val OPERATION ="Operation" 13 | private const val OPERAND1 = "OPERAND1" 14 | 15 | class MainActivity : AppCompatActivity() { 16 | private val result by lazy(LazyThreadSafetyMode.NONE){findViewById(R.id.result)} 17 | private val newNumber by lazy(LazyThreadSafetyMode.NONE) {findViewById(R.id.newNumber) } 18 | private val operation by lazy(LazyThreadSafetyMode.NONE) {findViewById(R.id.operation) } 19 | private var operand1 : Double? = null 20 | private var operand2 : Double = 0.0 21 | private var pendingOperation = "" 22 | 23 | 24 | override fun onCreate(savedInstanceState: Bundle?) { 25 | super.onCreate(savedInstanceState) 26 | setContentView(R.layout.activity_main) 27 | 28 | val button0 : Button = findViewById(R.id.button0) 29 | val button1 : Button = findViewById(R.id.button1) 30 | val button2 : Button = findViewById(R.id.button2) 31 | val button3 : Button = findViewById(R.id.button3) 32 | val button4 : Button = findViewById(R.id.button4) 33 | val button5 : Button = findViewById(R.id.button5) 34 | val button6 : Button = findViewById(R.id.button6) 35 | val button7 : Button = findViewById(R.id.button7) 36 | val button8 : Button = findViewById(R.id.button8) 37 | val button9 : Button = findViewById(R.id.button9) 38 | val buttonDot: Button = findViewById(R.id.buttonDot) 39 | 40 | val listener = View.OnClickListener{v -> 41 | val b = v as Button 42 | newNumber.append(b.text) 43 | } 44 | 45 | button0.setOnClickListener(listener) 46 | button1.setOnClickListener(listener) 47 | button2.setOnClickListener(listener) 48 | button3.setOnClickListener(listener) 49 | button4.setOnClickListener(listener) 50 | button5.setOnClickListener(listener) 51 | button6.setOnClickListener(listener) 52 | button7.setOnClickListener(listener) 53 | button8.setOnClickListener(listener) 54 | button9.setOnClickListener(listener) 55 | buttonDot.setOnClickListener(listener) 56 | 57 | val buttonMinus: Button = findViewById(R.id.buttonMinus) 58 | val buttonSum: Button = findViewById(R.id.buttonSum) 59 | val buttonMultiply: Button = findViewById(R.id.buttonMultiply) 60 | val buttonDivide: Button = findViewById(R.id.buttonDivide) 61 | 62 | val operandListener = View.OnClickListener{v -> 63 | val op = (v as Button).text.toString() 64 | val value = newNumber.text.toString() 65 | 66 | if (newNumber.text.isNotEmpty()){ 67 | performOperation(op, value) 68 | } 69 | pendingOperation = op 70 | operation.text = pendingOperation 71 | } 72 | 73 | buttonMinus.setOnClickListener(operandListener) 74 | buttonDivide.setOnClickListener(operandListener) 75 | buttonSum.setOnClickListener(operandListener) 76 | buttonMultiply.setOnClickListener(operandListener) 77 | buttonEquals.setOnClickListener(operandListener) 78 | 79 | } 80 | private fun performOperation(op: String, value: String){ 81 | try{ 82 | if(operand1 == null){ 83 | operand1 = value.toDouble() 84 | }else{ 85 | operand2 = value.toDouble() 86 | if(pendingOperation == "="){ 87 | pendingOperation = op 88 | } 89 | when(pendingOperation){ 90 | "=" -> operand1 = operand2 91 | "+" -> operand1 = operand1!! + operand2 92 | "-" -> operand1 = operand1!! - operand2 93 | "*" -> operand1 = operand1!! * operand2 94 | "/" -> if(operand2 == 0.0){ 95 | operand1 = Double.NaN 96 | }else{ 97 | operand1 = operand1!! / operand2 98 | } 99 | } 100 | } 101 | result.setText(operand1.toString()) 102 | newNumber.text.clear() 103 | }catch(e : Exception){ 104 | result.setText("NaN") 105 | newNumber.text.clear() 106 | } 107 | } 108 | 109 | override fun onSaveInstanceState(outState: Bundle) { 110 | super.onSaveInstanceState(outState) 111 | outState.putString(OPERATION, operation.text.toString()) 112 | outState.putDouble(OPERAND1, operand1!!) 113 | } 114 | 115 | override fun onRestoreInstanceState(savedInstanceState: Bundle) { 116 | super.onRestoreInstanceState(savedInstanceState) 117 | operand1 = savedInstanceState.getDouble(OPERAND1) 118 | operation.text = savedInstanceState.getString(OPERATION) 119 | pendingOperation = operation.text.toString() 120 | 121 | 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /calculatorApp/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.phystech.calculatorapp 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import android.os.Bundle 5 | import android.view.View 6 | import android.widget.Button 7 | import android.widget.EditText 8 | import android.widget.TextView 9 | import kotlinx.android.synthetic.main.activity_main.* 10 | import java.lang.Exception 11 | 12 | 13 | private const val OPERATION ="Operation" 14 | private const val OPERAND1 = "OPERAND1" 15 | 16 | class MainActivity : AppCompatActivity() { 17 | private val result by lazy(LazyThreadSafetyMode.NONE){findViewById(R.id.result)} 18 | private val newNumber by lazy(LazyThreadSafetyMode.NONE) {findViewById(R.id.newNumber) } 19 | private val operation by lazy(LazyThreadSafetyMode.NONE) {findViewById(R.id.operation) } 20 | private var operand1 : Double? = null 21 | private var operand2 : Double = 0.0 22 | private var pendingOperation = "" 23 | 24 | 25 | override fun onCreate(savedInstanceState: Bundle?) { 26 | super.onCreate(savedInstanceState) 27 | setContentView(R.layout.activity_main) 28 | 29 | val button0 : Button = findViewById(R.id.button0) 30 | val button1 : Button = findViewById(R.id.button1) 31 | val button2 : Button = findViewById(R.id.button2) 32 | val button3 : Button = findViewById(R.id.button3) 33 | val button4 : Button = findViewById(R.id.button4) 34 | val button5 : Button = findViewById(R.id.button5) 35 | val button6 : Button = findViewById(R.id.button6) 36 | val button7 : Button = findViewById(R.id.button7) 37 | val button8 : Button = findViewById(R.id.button8) 38 | val button9 : Button = findViewById(R.id.button9) 39 | val buttonDot: Button = findViewById(R.id.buttonDot) 40 | 41 | val listener = View.OnClickListener{v -> 42 | val b = v as Button 43 | newNumber.append(b.text) 44 | } 45 | 46 | button0.setOnClickListener(listener) 47 | button1.setOnClickListener(listener) 48 | button2.setOnClickListener(listener) 49 | button3.setOnClickListener(listener) 50 | button4.setOnClickListener(listener) 51 | button5.setOnClickListener(listener) 52 | button6.setOnClickListener(listener) 53 | button7.setOnClickListener(listener) 54 | button8.setOnClickListener(listener) 55 | button9.setOnClickListener(listener) 56 | buttonDot.setOnClickListener(listener) 57 | 58 | val buttonMinus: Button = findViewById(R.id.buttonMinus) 59 | val buttonSum: Button = findViewById(R.id.buttonSum) 60 | val buttonMultiply: Button = findViewById(R.id.buttonMultiply) 61 | val buttonDivide: Button = findViewById(R.id.buttonDivide) 62 | 63 | val operandListener = View.OnClickListener{v -> 64 | val op = (v as Button).text.toString() 65 | val value = newNumber.text.toString() 66 | 67 | if (newNumber.text.isNotEmpty()){ 68 | performOperation(op, value) 69 | } 70 | pendingOperation = op 71 | operation.text = pendingOperation 72 | } 73 | 74 | buttonMinus.setOnClickListener(operandListener) 75 | buttonDivide.setOnClickListener(operandListener) 76 | buttonSum.setOnClickListener(operandListener) 77 | buttonMultiply.setOnClickListener(operandListener) 78 | buttonEquals.setOnClickListener(operandListener) 79 | 80 | } 81 | private fun performOperation(op: String, value: String){ 82 | try{ 83 | if(operand1 == null){ 84 | operand1 = value.toDouble() 85 | }else{ 86 | operand2 = value.toDouble() 87 | if(pendingOperation == "="){ 88 | pendingOperation = op 89 | } 90 | when(pendingOperation){ 91 | "=" -> operand1 = operand2 92 | "+" -> operand1 = operand1!! + operand2 93 | "-" -> operand1 = operand1!! - operand2 94 | "*" -> operand1 = operand1!! * operand2 95 | "/" -> if(operand2 == 0.0){ 96 | operand1 = Double.NaN 97 | }else{ 98 | operand1 = operand1!! / operand2 99 | } 100 | } 101 | } 102 | result.setText(operand1.toString()) 103 | newNumber.text.clear() 104 | }catch(e : Exception){ 105 | result.setText("NaN") 106 | newNumber.text.clear() 107 | } 108 | } 109 | 110 | override fun onSaveInstanceState(outState: Bundle) { 111 | super.onSaveInstanceState(outState) 112 | outState.putString(OPERATION, operation.text.toString()) 113 | outState.putDouble(OPERAND1, operand1!!) 114 | } 115 | 116 | override fun onRestoreInstanceState(savedInstanceState: Bundle) { 117 | super.onRestoreInstanceState(savedInstanceState) 118 | operand1 = savedInstanceState.getDouble(OPERAND1) 119 | operation.text = savedInstanceState.getString(OPERATION) 120 | pendingOperation = operation.text.toString() 121 | 122 | 123 | } 124 | 125 | } 126 | -------------------------------------------------------------------------------- /CanyonBunny/core/src/com/mygdx/game/Level.kt: -------------------------------------------------------------------------------- 1 | /* 2 | Author : Arda 3 | Company : PhysTech 4 | Date : 4/9/2020 5 | */ 6 | 7 | package com.mygdx.game 8 | 9 | import com.badlogic.gdx.Gdx 10 | import com.badlogic.gdx.graphics.Pixmap 11 | import com.badlogic.gdx.graphics.g2d.SpriteBatch 12 | import com.mygdx.game.objects.* 13 | 14 | 15 | class Level(private val fileName : String) { 16 | private val TAG = "Level" 17 | 18 | enum class BLOCKTYPE(r: Int, g: Int, b: Int) { 19 | EMPTY(0,0,0), //black 20 | ROCK(0, 255, 0), //green 21 | PLAYER_SPAWPOINT(255 , 255 , 255), //White 22 | ITEM_FEATHER(255, 0, 255), //Purple 23 | ITEM_GOLD_COIN(255 , 255 , 0); //Yellow 24 | val color : Int = r shl 24 or (g shl 16) or (b shl 8) or 0xff 25 | 26 | fun sameColor(color : Int) = this.color == color 27 | 28 | } 29 | 30 | //objects 31 | var rocks : ArrayList = arrayListOf() 32 | var goldcoins : ArrayList = arrayListOf() 33 | var feathers : ArrayList = arrayListOf() 34 | var bunnyHead : BunnyHead? = null 35 | 36 | //Loading image file for level data 37 | 38 | val pixmap : Pixmap = Pixmap(Gdx.files.internal(fileName)) 39 | //Scan pixels from top-left to bottom-right 40 | var lastPixel = -1 41 | 42 | init { 43 | for (pixelY in 0 until pixmap.height) { 44 | for (pixelX in 0 until pixmap.width) { 45 | var offsetHeight = 0.25f 46 | //Height grows from bottom to top 47 | val baseHeight = pixmap.height - pixelY 48 | //Color of current pixel 32-bit RGBA 49 | val currentPixel: Int = pixmap.getPixel(pixelX, pixelY) 50 | //find matching color to identify block type at x,y point and create the game object if there is a match 51 | 52 | if (BLOCKTYPE.EMPTY.sameColor(currentPixel)) { 53 | //do nothing 54 | } else if (BLOCKTYPE.ROCK.sameColor(currentPixel)) { 55 | if (lastPixel != currentPixel) { 56 | val obj = Rock() 57 | val heightIncreaseFactor = 0.25f 58 | val offSetHeight = -2.5f 59 | obj.position.set(pixelX.toFloat(), baseHeight * obj.dimension.y * heightIncreaseFactor + offSetHeight) 60 | obj.increaseLength(0) 61 | rocks.add(obj) 62 | } else { 63 | rocks[rocks.size - 1].increaseLength(1) 64 | } 65 | } else if (BLOCKTYPE.PLAYER_SPAWPOINT.sameColor(currentPixel)) { 66 | //Player spawn point 67 | val obj = BunnyHead() 68 | offsetHeight = -3f 69 | obj.position.set(pixelX.toFloat(), baseHeight * obj.dimension.y + offsetHeight) 70 | bunnyHead = obj 71 | } else if (BLOCKTYPE.ITEM_FEATHER.sameColor(currentPixel)) { 72 | //feather 73 | val obj = Feather() 74 | offsetHeight = -1.5f 75 | obj.position.set(pixelX.toFloat() , baseHeight * obj.dimension.y + offsetHeight) 76 | feathers.add(obj) 77 | } else if (BLOCKTYPE.ITEM_GOLD_COIN.sameColor(currentPixel)) { 78 | //Gold coin 79 | val obj = GoldCoin() 80 | offsetHeight = -1.5f 81 | obj.position.set(pixelX.toFloat() , baseHeight * obj.dimension.y + offsetHeight) 82 | goldcoins.add(obj) 83 | } else { 84 | //Unknown obj/pixel color 85 | val r = 0xff and (currentPixel ushr 24) //red color channel 86 | val g = 0xff and (currentPixel ushr 16) //green color channel 87 | val b = 0xff and (currentPixel ushr 8) //blue color channel 88 | val a = 0xff and currentPixel //alpha channel 89 | Gdx.app.error(TAG, "Unknown object at x<" + pixelX + "> y<" 90 | + pixelY + ">: r<" + r + "> g<" + g + "> b<" + b + "> a<" + a + ">") 91 | } 92 | lastPixel = currentPixel 93 | } 94 | 95 | } 96 | } 97 | private val clouds = Clouds(pixmap.width.toFloat()) 98 | private val mountains = Mountains(pixmap.width) 99 | private val waterOverlay = WaterOverlay(pixmap.width.toFloat()) 100 | init{ 101 | clouds.position.set(0f , 2f) 102 | mountains.position.set(-1f , -1f) 103 | waterOverlay.position.set(0f , -3.75f) 104 | pixmap.dispose() 105 | Gdx.app.debug(TAG , "Level : $fileName loaded.")} 106 | 107 | fun render(batch : SpriteBatch){ 108 | mountains.render(batch) 109 | rocks.forEach { it.render(batch) } 110 | waterOverlay.render(batch) 111 | clouds.render(batch) 112 | //Draw coins 113 | goldcoins.forEach { it.render(batch) } 114 | //Draw feathers 115 | feathers.forEach { it.render(batch) } 116 | //Draw player 117 | bunnyHead?.render(batch) 118 | } 119 | 120 | fun update(deltaTime : Float){ 121 | bunnyHead?.update(deltaTime) 122 | rocks.forEach { it.update(deltaTime) } 123 | feathers.forEach { it.update(deltaTime) } 124 | goldcoins.forEach { it.update(deltaTime) } 125 | clouds.update(deltaTime) 126 | 127 | 128 | } 129 | 130 | } -------------------------------------------------------------------------------- /calculatorApp/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /CanyonBunny/core/src/com/mygdx/game/WorldRenderer.kt: -------------------------------------------------------------------------------- 1 | package com.mygdx.game 2 | 3 | import com.badlogic.gdx.Gdx 4 | import com.badlogic.gdx.Input.Keys.V 5 | import com.badlogic.gdx.graphics.OrthographicCamera 6 | import com.badlogic.gdx.graphics.Texture 7 | import com.badlogic.gdx.graphics.g2d.BitmapFont 8 | import com.badlogic.gdx.graphics.g2d.Sprite 9 | import com.badlogic.gdx.graphics.g2d.SpriteBatch 10 | import com.badlogic.gdx.utils.Disposable 11 | import com.badlogic.gdx.utils.Align 12 | 13 | class WorldRenderer(val worldController: WorldController) : Disposable { 14 | 15 | private var camera: OrthographicCamera = OrthographicCamera(Constants.VIEWPORT_WIDTH, Constants.VIEWPORT_HEIGHT) 16 | private var batch: SpriteBatch = SpriteBatch() 17 | private var cameraGUI = OrthographicCamera(Constants.VIEWPORT_GUI_WIDTH, Constants.VIEWPORT_GUI_HEIGHT) 18 | 19 | 20 | init { 21 | camera.position.set(0f, 0f, 0f) 22 | camera.update() 23 | 24 | cameraGUI.position.set(0f, 0f, 0f) 25 | cameraGUI.setToOrtho(true) //flip y-axis 26 | cameraGUI.update() 27 | } 28 | 29 | 30 | fun render() { 31 | renderWorld(batch) 32 | renderGui(batch) 33 | } 34 | 35 | private fun renderWorld(batch: SpriteBatch) { 36 | worldController.cameraHelper.applyTo(camera) 37 | batch.projectionMatrix = camera.combined 38 | batch.begin() 39 | worldController.level.render(batch) 40 | batch.end() 41 | } 42 | 43 | fun SpriteBatch.setWhite(){ 44 | this.setColor(1f , 1f , 1f , 1f) 45 | } 46 | 47 | private fun renderGuiFeatherPowerUp(batch: SpriteBatch){ 48 | val x = -15f 49 | val y = 20f 50 | val timeLeftFeatherPowerUp = worldController.level.bunnyHead!!.timeLeftFeatherPowerUp 51 | if(timeLeftFeatherPowerUp > 0){ 52 | //Start icon fade in/out if power up time is less than 4second. Fade interval is set to 5 changes per sec 53 | if(timeLeftFeatherPowerUp < 4){ 54 | if ((timeLeftFeatherPowerUp.toInt() * 5 % 2) != 0) batch.setColor(1f , 1f , 1f , 0.5f) 55 | } 56 | } 57 | batch.draw(Assets.feather.feather , x , y , 50f , 50f , 100f , 100f , 0.4f , -0.4f , 0f) 58 | batch.setWhite() 59 | Assets.fonts.defaultSmall.draw(batch , "${timeLeftFeatherPowerUp.toInt()}" , x + 60f , y + 57f) 60 | 61 | } 62 | 63 | private fun renderGuiGameOverMessage(batch: SpriteBatch){ 64 | val x = cameraGUI.viewportWidth / 2f 65 | val y = cameraGUI.viewportHeight / 2f 66 | val glyph = BitmapFont.Glyph() 67 | if (worldController.isGameOver()){ 68 | val fontGameOver : BitmapFont = Assets.fonts.defaultBig 69 | fontGameOver.setColor(1f , 0.75f , 0.25f , 1f) 70 | fontGameOver.draw(batch , "GAME OVER" , x , y , 0f , Align.center , true) 71 | } 72 | 73 | } 74 | 75 | private fun renderGuiScore(batch: SpriteBatch) { 76 | val x = -15f 77 | val y = -15f 78 | batch.draw(Assets.goldCoin.goldCoin, x, y, 50f, 50f, 100f, 100f, 0.35f, -0.35f, 0f) 79 | Assets.fonts.defaultBig.draw(batch, "" + worldController.score, x + 75f, y + 37f) 80 | } 81 | 82 | private fun renderGuiExtraLives(batch: SpriteBatch) { 83 | val x = cameraGUI.viewportWidth - 50f - Constants.LIVES_START * 50f 84 | val y = -15f 85 | for (i in 0 until Constants.LIVES_START) { 86 | if (worldController.lives > i) { 87 | batch.setColor(0.5f, 0.5f, 0.5f, 0.5f) 88 | batch.draw(Assets.bunny.head, x + i * 50, y, 50f, 50f, 120f, 100f, 0.35f, -0.35f, 0f) 89 | batch.setColor(1f, 1f, 1f, 1f) 90 | } 91 | } 92 | if (worldController.lives>= 0 && worldController.livesVisual>worldController.lives){ 93 | val i = worldController.lives 94 | val alphaColor = 0f.coerceAtLeast(worldController.livesVisual - worldController.lives - 0.5f) 95 | val alphaScale = 0.35f * (2 + worldController.lives - worldController.livesVisual) * 2f 96 | val alphaRotate = -45f * alphaColor 97 | batch.setColor(1f , 0.7f , 0.7f , alphaColor) 98 | batch.draw(Assets.bunny.head , x+i*50 , y , 50f , 50f , 120f, 100f , alphaScale , -alphaScale , alphaRotate) 99 | batch.setWhite() 100 | } 101 | } 102 | 103 | private fun renderGuiFpsCounter(batch: SpriteBatch) { 104 | val x = cameraGUI.viewportWidth - 55f 105 | val y = cameraGUI.viewportHeight - 15f 106 | val fps : Int = Gdx.graphics.framesPerSecond 107 | val fpsFont : BitmapFont = Assets.fonts.defaultNormal 108 | 109 | when { 110 | fps >= 45 -> fpsFont.setColor(0f , 1f , 0f ,1f) //Green color 111 | fps >= 30 -> fpsFont.setColor(1f , 1f , 0f , 1f) //Yellow color 112 | else -> fpsFont.setColor(1f , 0f , 0f , 1f) //Red color 113 | } 114 | 115 | fpsFont.draw(batch , "FPS: $fps" , x , y) 116 | fpsFont.setColor(1f , 1f , 1f ,1f) //White 117 | } 118 | 119 | private fun renderGui(batch: SpriteBatch){ 120 | batch.projectionMatrix = cameraGUI.combined 121 | batch.begin() 122 | //Draw collected gold coins icon + text (set to left edge) 123 | renderGuiScore(batch) 124 | //Render extra lives icon + text (top right edge) 125 | renderGuiExtraLives(batch) 126 | //Draw fps text 127 | if(GamePreferences.showFpsCounter) renderGuiFpsCounter(batch) 128 | renderGuiGameOverMessage(batch) 129 | renderGuiFeatherPowerUp(batch) 130 | batch.end() 131 | } 132 | 133 | 134 | fun resize(width: Int, height: Int) { 135 | camera.viewportWidth = Constants.VIEWPORT_HEIGHT / height * width 136 | camera.update() 137 | 138 | cameraGUI.viewportHeight = Constants.VIEWPORT_GUI_HEIGHT 139 | cameraGUI.viewportWidth = Constants.VIEWPORT_GUI_WIDTH / height * width 140 | cameraGUI.position.set(cameraGUI.viewportWidth / 2f, cameraGUI.viewportHeight / 2f, 0f) 141 | cameraGUI.update() 142 | } 143 | 144 | override fun dispose() { 145 | batch.dispose() 146 | } 147 | } -------------------------------------------------------------------------------- /calculatorApp/app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /CanyonBunny/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin, switch paths to Windows format before running java 129 | if $cygwin ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=$((i+1)) 158 | done 159 | case $i in 160 | (0) set -- ;; 161 | (1) set -- "$args0" ;; 162 | (2) set -- "$args0" "$args1" ;; 163 | (3) set -- "$args0" "$args1" "$args2" ;; 164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=$(save "$@") 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 185 | cd "$(dirname "$0")" 186 | fi 187 | 188 | exec "$JAVACMD" "$@" 189 | -------------------------------------------------------------------------------- /FlappyBird/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin, switch paths to Windows format before running java 129 | if $cygwin ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=$((i+1)) 158 | done 159 | case $i in 160 | (0) set -- ;; 161 | (1) set -- "$args0" ;; 162 | (2) set -- "$args0" "$args1" ;; 163 | (3) set -- "$args0" "$args1" "$args2" ;; 164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=$(save "$@") 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 185 | cd "$(dirname "$0")" 186 | fi 187 | 188 | exec "$JAVACMD" "$@" 189 | -------------------------------------------------------------------------------- /FlappyBird/core/src/com/mygdx/game/FlappyBird.kt: -------------------------------------------------------------------------------- 1 | package com.mygdx.game 2 | 3 | import com.badlogic.gdx.ApplicationAdapter 4 | import com.badlogic.gdx.Gdx 5 | import com.badlogic.gdx.graphics.Color 6 | import com.badlogic.gdx.graphics.Texture 7 | import com.badlogic.gdx.graphics.g2d.BitmapFont 8 | import com.badlogic.gdx.graphics.g2d.Sprite 9 | import com.badlogic.gdx.graphics.g2d.SpriteBatch 10 | import com.badlogic.gdx.graphics.glutils.ShapeRenderer 11 | import com.badlogic.gdx.math.Circle 12 | import com.badlogic.gdx.math.Intersector 13 | import com.badlogic.gdx.math.Rectangle 14 | import kotlin.collections.ArrayList 15 | import kotlin.random.Random 16 | 17 | 18 | class FlappyBird : ApplicationAdapter() { 19 | lateinit var batch: SpriteBatch 20 | lateinit var background: Texture 21 | lateinit var sprite: Sprite 22 | lateinit var bottomTube: Texture 23 | lateinit var topTube: Texture 24 | // lateinit var shapeRenderer : ShapeRenderer 25 | var birds: ArrayList = ArrayList(2) 26 | var flapState = 0 27 | var BirdY = 0.0 28 | var birdVelocity = 0f 29 | var gravity = 2f 30 | var gap = 400f 31 | lateinit var birdCircle : Circle 32 | lateinit var pipeRectangleBottom : Array 33 | lateinit var pipeRectangleTop : Array 34 | var score : Int = 0 35 | var scoringTube : Int = 0 36 | 37 | 38 | //variables for tubes #1 39 | var tubeVelocity = 7f 40 | //var tubeX : Float? = null 41 | val numberOfTubes: Int = 4 42 | var distanceBetweenTubes: Float = 0f 43 | val tubeOffset = Array(4) { 0f } 44 | val tubeX = Array(4) { 0f } 45 | lateinit var font : BitmapFont 46 | 47 | 48 | //Variables i added 49 | var x = 0.1f 50 | var isTouched = false 51 | var ReverseFly = false 52 | var SecTimer = System.currentTimeMillis() 53 | var BirdX = 0.0 54 | var fallVelocity = 0.3f 55 | 56 | 57 | override fun create() { 58 | 59 | batch = SpriteBatch() 60 | background = Texture("bg.png") 61 | topTube = Texture("toptube.png") 62 | bottomTube = Texture("bottomtube.png") 63 | // birds[0] = Texture("bird.png") 64 | // birds[1]= Texture("bird2.png") 65 | // shapeRenderer = ShapeRenderer() 66 | birdCircle = Circle() 67 | font = BitmapFont() 68 | font.setColor(Color.WHITE) 69 | font.data.setScale(10f) 70 | font.setOwnsTexture(true) 71 | 72 | 73 | 74 | // Another method or arraylist 75 | 76 | birds.add(Texture("bird.png")) 77 | birds.add(Texture("bird2.png")) 78 | BirdY = ((Gdx.graphics.height - birds[0].height) / 2.0) 79 | BirdX = (Gdx.graphics.width - 3.8 * birds[flapState].width) / 2.0 80 | sprite = Sprite(birds[flapState]) 81 | 82 | 83 | //Variables for tubes 84 | distanceBetweenTubes = (Gdx.graphics.width / 2 + 150).toFloat() 85 | var maxTubeOffset = (Gdx.graphics.height - gap) / 2 - 100 86 | pipeRectangleBottom = Array(4){ Rectangle() } 87 | pipeRectangleTop = Array(4){Rectangle()} 88 | 89 | 90 | 91 | for (i in 0 until numberOfTubes) { 92 | tubeOffset[i] = (Random.nextFloat() - 0.5f) * (Gdx.graphics.height - gap - 275) 93 | tubeX[i] = ((Gdx.graphics.width - topTube.width) / 2).toFloat() + + Gdx.graphics.width + i * distanceBetweenTubes 94 | } 95 | 96 | 97 | } 98 | 99 | override fun render() {//Ekrana bir kere basıldıktan sonra sürekli çalıştırılacak kod 100 | //batch.draw(birds[flapState], (BirdX).toFloat(), (( BirdY + x )).toFloat()) 101 | when { 102 | tubeX[0] < -bottomTube.width -> { 103 | tubeOffset[0] = (Random.nextFloat() - 0.5f) * (Gdx.graphics.height - gap - 275) 104 | } 105 | tubeX[1] < -bottomTube.width -> { 106 | tubeOffset[1] = (Random.nextFloat() - 0.5f) * (Gdx.graphics.height - gap - 275) 107 | } 108 | tubeX[2] < -bottomTube.width -> { 109 | tubeOffset[2] = (Random.nextFloat() - 0.5f) * (Gdx.graphics.height - gap - 275) 110 | } 111 | tubeX[3] < -bottomTube.width -> { 112 | tubeOffset[3] = (Random.nextFloat() - 0.5f) * (Gdx.graphics.height - gap - 275) 113 | } 114 | //Kanat cırpısı icin 115 | } 116 | 117 | 118 | flapTimer() //Kanat cırpısı icin 119 | 120 | batch.begin() 121 | batch.draw(background, 0f, 0f, Gdx.graphics.width.toFloat(), Gdx.graphics.height.toFloat()) 122 | 123 | 124 | if (tubeX[scoringTube] < (Gdx.graphics.width - 3.8 * birds[flapState].width) / 2.0){ 125 | score += 1 126 | Gdx.app.log("Score = ","$score") 127 | if (scoringTube < 3){ 128 | scoringTube += 1 129 | }else{ 130 | scoringTube = 0 131 | } 132 | } 133 | 134 | if (BirdY + (birds[0].height) / 2 > 0) { 135 | 136 | if (Gdx.input.justTouched()) { 137 | drawTubes(isTouched) 138 | 139 | birdVelocity = -21f 140 | //batch.draw(birds[flapState], (BirdX).toFloat(), (( BirdY + x )).toFloat()) 141 | rotationClicked() 142 | 143 | font.draw(batch, score.toString(), Gdx.graphics.width / 2.1f, Gdx.graphics.height - 100f) 144 | 145 | isTouched = true 146 | 147 | 148 | 149 | } else if (!isTouched) { 150 | beforeGameStart() 151 | } else if (isTouched) { 152 | //Ekrana bir kere basıldıktan sonra sürekli çalıştırılacak kod 153 | drawTubes(isTouched) 154 | font.draw(batch, score.toString(), Gdx.graphics.width / 2.1f, Gdx.graphics.height - 100f) 155 | 156 | 157 | rotationNormal() 158 | birdVelocity++ 159 | BirdY -= birdVelocity + gravity 160 | } 161 | } else { 162 | sprite.draw(batch) 163 | } 164 | 165 | batch.end() 166 | 167 | birdCircle.set(((Gdx.graphics.width - 3 * birds[flapState].width) / 2 ).toFloat(), (BirdY + birds[flapState].height / 2 + x).toFloat(), (birds[flapState].width / 2).toFloat()) 168 | 169 | for(i in 0 until numberOfTubes) { 170 | pipeRectangleBottom[i] = (Rectangle(tubeX[i], (Gdx.graphics.height + gap) / 2 + tubeOffset[i],bottomTube.width.toFloat(), bottomTube.height.toFloat())) 171 | pipeRectangleTop[i] = (Rectangle(tubeX[i], (Gdx.graphics.height + gap) / 2 + tubeOffset[i],topTube.width.toFloat(), topTube.height.toFloat())) 172 | 173 | } 174 | 175 | 176 | // shapeRenderer.begin(ShapeRenderer.ShapeType.Filled) 177 | // shapeRenderer.color = Color.RED 178 | // shapeRenderer.circle(birdCircle.x, birdCircle.y, birdCircle.radius) 179 | 180 | for(i in pipeRectangleTop.indices){ 181 | 182 | // shapeRenderer.rect(tubeX[i], (Gdx.graphics.height + gap) / 2 + tubeOffset[i],pipeRectangleBottom[i].width, pipeRectangleBottom[i].height) 183 | // shapeRenderer.rect(tubeX[i], (Gdx.graphics.height - gap) / 2 - bottomTube.height + tubeOffset[i], pipeRectangleTop[i].width, pipeRectangleTop[i].height) 184 | 185 | if (Intersector.overlaps(birdCircle, pipeRectangleTop[i]) || Intersector.overlaps(birdCircle, pipeRectangleBottom[i])){ 186 | Gdx.app.log("Collisio","pilawbi") 187 | } 188 | 189 | } 190 | 191 | 192 | 193 | // shapeRenderer.end() 194 | } 195 | 196 | fun drawTubes(isTouched: Boolean) { 197 | if (isTouched) { 198 | 199 | for (i in 0 until numberOfTubes) { 200 | if (tubeX[i] < -bottomTube.width) { 201 | tubeX[i] += numberOfTubes * distanceBetweenTubes 202 | }else{ 203 | tubeX[i] -= tubeVelocity 204 | } 205 | 206 | batch.draw(topTube, (tubeX[i]), (Gdx.graphics.height + gap) / 2 + tubeOffset[i]) 207 | batch.draw(bottomTube, (tubeX[i]), ((Gdx.graphics.height - gap) / 2 - bottomTube.height + tubeOffset[i])) 208 | } 209 | } 210 | } 211 | 212 | 213 | fun beforeGameStart() { 214 | //Basılı değilse aşağı yukarı uç 215 | if (!ReverseFly) { 216 | x += 3.5f 217 | if (x > 40f) { 218 | ReverseFly = true 219 | } 220 | } else if (ReverseFly) { 221 | x -= 3.5f 222 | if (x < -60f) { 223 | ReverseFly = false 224 | } 225 | } 226 | batch.draw(birds[flapState], (BirdX).toFloat(), ((BirdY + x)).toFloat()) 227 | } 228 | 229 | fun flapTimer() { 230 | //Kanatları çırpmak için timer kodu 231 | if (System.currentTimeMillis() > SecTimer + 220) { 232 | if (flapState == 0) { 233 | flapState = 1 234 | } else { 235 | flapState = 0 236 | } 237 | SecTimer = System.currentTimeMillis() 238 | } 239 | } 240 | 241 | fun rotationNormal() { 242 | 243 | sprite.texture = birds[flapState] 244 | sprite.setPosition((BirdX).toFloat(), (BirdY + x).toFloat()) 245 | // val fallRotation = sprite.getRotation() 246 | // val timeToFall = (BirdY + x) / birdVelocity 247 | // sprite.rotate(((-90f - abs(fallRotation)) / timeToFall).toFloat()) 248 | if (sprite.getRotation() > -90) 249 | sprite.rotate(-fallVelocity) 250 | 251 | sprite.draw(batch) 252 | fallVelocity += 0.1f 253 | 254 | } 255 | 256 | fun rotationClicked() { 257 | sprite.texture = birds[flapState] 258 | sprite.setPosition((BirdX).toFloat(), (BirdY + x).toFloat()) 259 | val initialRotation = sprite.getRotation() 260 | 261 | sprite.rotate(30f - initialRotation) 262 | 263 | sprite.draw(batch) 264 | fallVelocity = 0.3f 265 | } 266 | 267 | 268 | override fun dispose() { 269 | batch.dispose() 270 | background.dispose() 271 | 272 | } 273 | } 274 | 275 | --------------------------------------------------------------------------------