├── .gitignore ├── .metadata ├── README.md ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── bladeofgod │ │ │ │ └── tankcombat │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets └── images │ ├── explosion │ ├── explosion1.webp │ ├── explosion2.webp │ ├── explosion3.webp │ ├── explosion4.webp │ └── explosion5.webp │ ├── new_map.webp │ └── tank │ ├── bullet_blue.webp │ ├── bullet_green.webp │ ├── bullet_sand.webp │ ├── t_body_blue.webp │ ├── t_body_green.webp │ ├── t_body_sand.webp │ ├── t_turret_blue.webp │ ├── t_turret_green.webp │ └── t_turret_sand.webp ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── component │ ├── background │ │ └── background.dart │ ├── base_component.dart │ ├── explosion │ │ └── decoration_theater.dart │ └── tank │ │ ├── bullet.dart │ │ ├── tank_factory.dart │ │ └── tank_model.dart ├── controller │ ├── control_panel_widget.dart │ └── controller_listener.dart ├── game │ ├── game_action.dart │ └── tank_game.dart ├── main.dart ├── observer │ └── game_observer.dart ├── utils │ ├── computer_timer.dart │ └── extension.dart └── widgets │ ├── fire_button.dart │ └── joy_stick.dart ├── pubspec.lock ├── pubspec.yaml ├── tank-combat.xmind ├── test └── widget_test.dart └── web ├── favicon.png ├── icons ├── Icon-192.png └── Icon-512.png ├── index.html └── manifest.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Exceptions to above rules. 44 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 45 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 0af027f80543302c65f99e1c1a2f3b3cbb8d04f3 8 | channel: dev 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tankcombat 2 | 3 | Base on flame 4 | 5 | About Blog : https://juejin.cn/post/7083390476719489061 6 | 7 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.bladeofgod.tankcombat" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | } 54 | } 55 | } 56 | 57 | flutter { 58 | source '../..' 59 | } 60 | 61 | dependencies { 62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 63 | } 64 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 11 | 18 | 22 | 26 | 31 | 35 | 36 | 37 | 38 | 39 | 40 | 42 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/bladeofgod/tankcombat/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.bladeofgod.tankcombat 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.5.31' 3 | repositories { 4 | maven { url 'https://maven.aliyun.com/repository/public' } 5 | maven { url 'https://maven.aliyun.com/repository/google' } 6 | maven { url 'https://maven.aliyun.com/repository/jcenter' } 7 | maven {url 'http://download.flutter.io'} 8 | google() 9 | jcenter() 10 | } 11 | 12 | dependencies { 13 | classpath 'com.android.tools.build:gradle:3.5.0' 14 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | maven { url 'https://maven.aliyun.com/repository/public' } 21 | maven { url 'https://maven.aliyun.com/repository/google' } 22 | maven { url 'https://maven.aliyun.com/repository/jcenter' } 23 | maven {url 'http://download.flutter.io'} 24 | google() 25 | jcenter() 26 | } 27 | } 28 | 29 | rootProject.buildDir = '../build' 30 | subprojects { 31 | project.buildDir = "${rootProject.buildDir}/${project.name}" 32 | } 33 | subprojects { 34 | project.evaluationDependsOn(':app') 35 | } 36 | 37 | task clean(type: Delete) { 38 | delete rootProject.buildDir 39 | } 40 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /assets/images/explosion/explosion1.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/assets/images/explosion/explosion1.webp -------------------------------------------------------------------------------- /assets/images/explosion/explosion2.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/assets/images/explosion/explosion2.webp -------------------------------------------------------------------------------- /assets/images/explosion/explosion3.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/assets/images/explosion/explosion3.webp -------------------------------------------------------------------------------- /assets/images/explosion/explosion4.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/assets/images/explosion/explosion4.webp -------------------------------------------------------------------------------- /assets/images/explosion/explosion5.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/assets/images/explosion/explosion5.webp -------------------------------------------------------------------------------- /assets/images/new_map.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/assets/images/new_map.webp -------------------------------------------------------------------------------- /assets/images/tank/bullet_blue.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/assets/images/tank/bullet_blue.webp -------------------------------------------------------------------------------- /assets/images/tank/bullet_green.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/assets/images/tank/bullet_green.webp -------------------------------------------------------------------------------- /assets/images/tank/bullet_sand.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/assets/images/tank/bullet_sand.webp -------------------------------------------------------------------------------- /assets/images/tank/t_body_blue.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/assets/images/tank/t_body_blue.webp -------------------------------------------------------------------------------- /assets/images/tank/t_body_green.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/assets/images/tank/t_body_green.webp -------------------------------------------------------------------------------- /assets/images/tank/t_body_sand.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/assets/images/tank/t_body_sand.webp -------------------------------------------------------------------------------- /assets/images/tank/t_turret_blue.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/assets/images/tank/t_turret_blue.webp -------------------------------------------------------------------------------- /assets/images/tank/t_turret_green.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/assets/images/tank/t_turret_green.webp -------------------------------------------------------------------------------- /assets/images/tank/t_turret_sand.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/assets/images/tank/t_turret_sand.webp -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1020; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | ); 177 | inputPaths = ( 178 | ); 179 | name = "Thin Binary"; 180 | outputPaths = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 185 | }; 186 | 9740EEB61CF901F6004384FC /* Run Script */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputPaths = ( 192 | ); 193 | name = "Run Script"; 194 | outputPaths = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | shellPath = /bin/sh; 198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 199 | }; 200 | /* End PBXShellScriptBuildPhase section */ 201 | 202 | /* Begin PBXSourcesBuildPhase section */ 203 | 97C146EA1CF9000F007C117D /* Sources */ = { 204 | isa = PBXSourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin PBXVariantGroup section */ 215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 97C146FB1CF9000F007C117D /* Base */, 219 | ); 220 | name = Main.storyboard; 221 | sourceTree = ""; 222 | }; 223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 97C147001CF9000F007C117D /* Base */, 227 | ); 228 | name = LaunchScreen.storyboard; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXVariantGroup section */ 232 | 233 | /* Begin XCBuildConfiguration section */ 234 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_COMMA = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 258 | CLANG_WARN_STRICT_PROTOTYPES = YES; 259 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | SUPPORTED_PLATFORMS = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | VALIDATE_PRODUCT = YES; 281 | }; 282 | name = Profile; 283 | }; 284 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 285 | isa = XCBuildConfiguration; 286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CLANG_ENABLE_MODULES = YES; 290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 291 | ENABLE_BITCODE = NO; 292 | FRAMEWORK_SEARCH_PATHS = ( 293 | "$(inherited)", 294 | "$(PROJECT_DIR)/Flutter", 295 | ); 296 | INFOPLIST_FILE = Runner/Info.plist; 297 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 298 | LIBRARY_SEARCH_PATHS = ( 299 | "$(inherited)", 300 | "$(PROJECT_DIR)/Flutter", 301 | ); 302 | PRODUCT_BUNDLE_IDENTIFIER = com.bladeofgod.tankcombat; 303 | PRODUCT_NAME = "$(TARGET_NAME)"; 304 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 305 | SWIFT_VERSION = 5.0; 306 | VERSIONING_SYSTEM = "apple-generic"; 307 | }; 308 | name = Profile; 309 | }; 310 | 97C147031CF9000F007C117D /* Debug */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ALWAYS_SEARCH_USER_PATHS = NO; 314 | CLANG_ANALYZER_NONNULL = YES; 315 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 316 | CLANG_CXX_LIBRARY = "libc++"; 317 | CLANG_ENABLE_MODULES = YES; 318 | CLANG_ENABLE_OBJC_ARC = YES; 319 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 320 | CLANG_WARN_BOOL_CONVERSION = YES; 321 | CLANG_WARN_COMMA = YES; 322 | CLANG_WARN_CONSTANT_CONVERSION = YES; 323 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 324 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 325 | CLANG_WARN_EMPTY_BODY = YES; 326 | CLANG_WARN_ENUM_CONVERSION = YES; 327 | CLANG_WARN_INFINITE_RECURSION = YES; 328 | CLANG_WARN_INT_CONVERSION = YES; 329 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 330 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 331 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 332 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 333 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 334 | CLANG_WARN_STRICT_PROTOTYPES = YES; 335 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 336 | CLANG_WARN_UNREACHABLE_CODE = YES; 337 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 339 | COPY_PHASE_STRIP = NO; 340 | DEBUG_INFORMATION_FORMAT = dwarf; 341 | ENABLE_STRICT_OBJC_MSGSEND = YES; 342 | ENABLE_TESTABILITY = YES; 343 | GCC_C_LANGUAGE_STANDARD = gnu99; 344 | GCC_DYNAMIC_NO_PIC = NO; 345 | GCC_NO_COMMON_BLOCKS = YES; 346 | GCC_OPTIMIZATION_LEVEL = 0; 347 | GCC_PREPROCESSOR_DEFINITIONS = ( 348 | "DEBUG=1", 349 | "$(inherited)", 350 | ); 351 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 352 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 353 | GCC_WARN_UNDECLARED_SELECTOR = YES; 354 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 355 | GCC_WARN_UNUSED_FUNCTION = YES; 356 | GCC_WARN_UNUSED_VARIABLE = YES; 357 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 358 | MTL_ENABLE_DEBUG_INFO = YES; 359 | ONLY_ACTIVE_ARCH = YES; 360 | SDKROOT = iphoneos; 361 | TARGETED_DEVICE_FAMILY = "1,2"; 362 | }; 363 | name = Debug; 364 | }; 365 | 97C147041CF9000F007C117D /* Release */ = { 366 | isa = XCBuildConfiguration; 367 | buildSettings = { 368 | ALWAYS_SEARCH_USER_PATHS = NO; 369 | CLANG_ANALYZER_NONNULL = YES; 370 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 371 | CLANG_CXX_LIBRARY = "libc++"; 372 | CLANG_ENABLE_MODULES = YES; 373 | CLANG_ENABLE_OBJC_ARC = YES; 374 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 375 | CLANG_WARN_BOOL_CONVERSION = YES; 376 | CLANG_WARN_COMMA = YES; 377 | CLANG_WARN_CONSTANT_CONVERSION = YES; 378 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 379 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 380 | CLANG_WARN_EMPTY_BODY = YES; 381 | CLANG_WARN_ENUM_CONVERSION = YES; 382 | CLANG_WARN_INFINITE_RECURSION = YES; 383 | CLANG_WARN_INT_CONVERSION = YES; 384 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 385 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 386 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 387 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 388 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 389 | CLANG_WARN_STRICT_PROTOTYPES = YES; 390 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 391 | CLANG_WARN_UNREACHABLE_CODE = YES; 392 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 393 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 394 | COPY_PHASE_STRIP = NO; 395 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 396 | ENABLE_NS_ASSERTIONS = NO; 397 | ENABLE_STRICT_OBJC_MSGSEND = YES; 398 | GCC_C_LANGUAGE_STANDARD = gnu99; 399 | GCC_NO_COMMON_BLOCKS = YES; 400 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 401 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 402 | GCC_WARN_UNDECLARED_SELECTOR = YES; 403 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 404 | GCC_WARN_UNUSED_FUNCTION = YES; 405 | GCC_WARN_UNUSED_VARIABLE = YES; 406 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 407 | MTL_ENABLE_DEBUG_INFO = NO; 408 | SDKROOT = iphoneos; 409 | SUPPORTED_PLATFORMS = iphoneos; 410 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 411 | TARGETED_DEVICE_FAMILY = "1,2"; 412 | VALIDATE_PRODUCT = YES; 413 | }; 414 | name = Release; 415 | }; 416 | 97C147061CF9000F007C117D /* Debug */ = { 417 | isa = XCBuildConfiguration; 418 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 419 | buildSettings = { 420 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 421 | CLANG_ENABLE_MODULES = YES; 422 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 423 | ENABLE_BITCODE = NO; 424 | FRAMEWORK_SEARCH_PATHS = ( 425 | "$(inherited)", 426 | "$(PROJECT_DIR)/Flutter", 427 | ); 428 | INFOPLIST_FILE = Runner/Info.plist; 429 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 430 | LIBRARY_SEARCH_PATHS = ( 431 | "$(inherited)", 432 | "$(PROJECT_DIR)/Flutter", 433 | ); 434 | PRODUCT_BUNDLE_IDENTIFIER = com.bladeofgod.tankcombat; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 437 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 438 | SWIFT_VERSION = 5.0; 439 | VERSIONING_SYSTEM = "apple-generic"; 440 | }; 441 | name = Debug; 442 | }; 443 | 97C147071CF9000F007C117D /* Release */ = { 444 | isa = XCBuildConfiguration; 445 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 446 | buildSettings = { 447 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 448 | CLANG_ENABLE_MODULES = YES; 449 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 450 | ENABLE_BITCODE = NO; 451 | FRAMEWORK_SEARCH_PATHS = ( 452 | "$(inherited)", 453 | "$(PROJECT_DIR)/Flutter", 454 | ); 455 | INFOPLIST_FILE = Runner/Info.plist; 456 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 457 | LIBRARY_SEARCH_PATHS = ( 458 | "$(inherited)", 459 | "$(PROJECT_DIR)/Flutter", 460 | ); 461 | PRODUCT_BUNDLE_IDENTIFIER = com.bladeofgod.tankcombat; 462 | PRODUCT_NAME = "$(TARGET_NAME)"; 463 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 464 | SWIFT_VERSION = 5.0; 465 | VERSIONING_SYSTEM = "apple-generic"; 466 | }; 467 | name = Release; 468 | }; 469 | /* End XCBuildConfiguration section */ 470 | 471 | /* Begin XCConfigurationList section */ 472 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 473 | isa = XCConfigurationList; 474 | buildConfigurations = ( 475 | 97C147031CF9000F007C117D /* Debug */, 476 | 97C147041CF9000F007C117D /* Release */, 477 | 249021D3217E4FDB00AE95B9 /* Profile */, 478 | ); 479 | defaultConfigurationIsVisible = 0; 480 | defaultConfigurationName = Release; 481 | }; 482 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 483 | isa = XCConfigurationList; 484 | buildConfigurations = ( 485 | 97C147061CF9000F007C117D /* Debug */, 486 | 97C147071CF9000F007C117D /* Release */, 487 | 249021D4217E4FDB00AE95B9 /* Profile */, 488 | ); 489 | defaultConfigurationIsVisible = 0; 490 | defaultConfigurationName = Release; 491 | }; 492 | /* End XCConfigurationList section */ 493 | }; 494 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 495 | } 496 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | tankcombat 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/component/background/background.dart: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Author : LiJiqqi 4 | * Date : 2020/7/30 5 | */ 6 | 7 | import 'dart:ui'; 8 | 9 | import 'package:flame/sprite.dart'; 10 | import 'package:tankcombat/component/base_component.dart'; 11 | import 'package:vector_math/vector_math_64.dart'; 12 | 13 | ///游戏背景 14 | class BattleBackground extends WindowComponent { 15 | 16 | BattleBackground() { 17 | init(); 18 | } 19 | 20 | Sprite? bgSprite; 21 | Rect? bgRect; 22 | 23 | void init() async { 24 | bgSprite = await Sprite.load('new_map.webp'); 25 | } 26 | 27 | @override 28 | void render(Canvas canvas) { 29 | bgSprite?.renderRect(canvas, bgRect ?? Rect.zero); 30 | } 31 | 32 | @override 33 | void update(double t) {} 34 | 35 | @override 36 | void onGameResize(Vector2 canvasSize) { 37 | bgRect = Rect.fromLTWH(0, 0, canvasSize.storage.first, canvasSize.storage.last); 38 | super.onGameResize(canvasSize); 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /lib/component/base_component.dart: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Author : LiJiqqi 4 | * Date : 2020/7/30 5 | */ 6 | 7 | import 'package:flame/components.dart'; 8 | 9 | ///todo 一些绘制位置计算在 PositionComponent是封装好, 10 | /// 实际使用时,应按照Flame的文档继承PositionComponent 11 | 12 | abstract class WindowComponent extends Component{ 13 | 14 | } 15 | 16 | -------------------------------------------------------------------------------- /lib/component/explosion/decoration_theater.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'dart:ui'; 3 | 4 | import 'package:flame/game.dart'; 5 | import 'package:flame/sprite.dart'; 6 | import 'package:flutter/cupertino.dart'; 7 | import 'package:tankcombat/component/base_component.dart'; 8 | import '../../utils/extension.dart'; 9 | import 'package:vector_math/vector_math_64.dart'; 10 | 11 | import '../background/background.dart'; 12 | 13 | 14 | ///负责装饰性场景及衍生的[Sprite] 15 | /// * 如:背景、爆炸。 16 | mixin DecorationTheater on FlameGame{ 17 | 18 | final BattleBackground bg = BattleBackground(); 19 | 20 | final List explosions = []; 21 | 22 | ///在[pos]位置添加一个爆炸效果 23 | void addExplosions(Offset pos) { 24 | explosions.add(OrangeExplosion(pos)); 25 | } 26 | 27 | @override 28 | void render(Canvas canvas) { 29 | bg.render(canvas); 30 | super.render(canvas); 31 | explosions.render(canvas); 32 | } 33 | 34 | @override 35 | void update(double dt) { 36 | super.update(dt); 37 | explosions.update(dt); 38 | explosions.removeWhere((element) => element.playDone); 39 | } 40 | 41 | @override 42 | void onGameResize(Vector2 canvasSize) { 43 | bg.onGameResize(canvasSize); 44 | super.onGameResize(canvasSize); 45 | explosions.onGameResize(canvasSize); 46 | } 47 | } 48 | 49 | 50 | class OrangeExplosion extends WindowComponent{ 51 | 52 | OrangeExplosion(this.position) : exRect = Rect.fromCenter(center: position,width: 30,height: 30) { 53 | loadSprite(); 54 | } 55 | 56 | ///爆炸位置 57 | final Offset position; 58 | 59 | ///爆炸纹理 60 | final List sprites = []; 61 | 62 | ///爆炸纹理尺寸 63 | final Rect exRect; 64 | 65 | int playIndex =0; 66 | 67 | bool playDone = false; 68 | 69 | ///爆炸开始经过的时间 70 | /// * 用于调整[sprites]的fps 71 | double passedTime = 0; 72 | 73 | 74 | void loadSprite() async { 75 | sprites.add(await Sprite.load('explosion/explosion1.webp')); 76 | sprites.add(await Sprite.load('explosion/explosion2.webp')); 77 | sprites.add(await Sprite.load('explosion/explosion3.webp')); 78 | sprites.add(await Sprite.load('explosion/explosion4.webp')); 79 | sprites.add(await Sprite.load('explosion/explosion5.webp')); 80 | } 81 | 82 | 83 | @override 84 | void render(Canvas canvas) { 85 | if(playDone) 86 | return; 87 | if(sprites.length == 5 && playIndex < 5) { 88 | sprites[playIndex].renderRect(canvas, exRect); 89 | } 90 | } 91 | 92 | @override 93 | void update(double t) { 94 | if(playDone) 95 | return; 96 | if(playIndex < 5) { 97 | //1秒 5张图片 98 | passedTime += t; 99 | playIndex = passedTime ~/ 0.2; 100 | }else{ 101 | playDone = true; 102 | } 103 | } 104 | 105 | @override 106 | void onGameResize(Vector2 canvasSize) { 107 | super.onGameResize(canvasSize); 108 | } 109 | 110 | } 111 | 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /lib/component/tank/bullet.dart: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Author : LiJiqqi 4 | * Date : 2020/7/30 5 | */ 6 | import 'dart:ui'; 7 | 8 | import 'package:flame/components.dart'; 9 | import 'package:flame/sprite.dart'; 10 | import 'package:tankcombat/component/base_component.dart'; 11 | 12 | import 'dart:async' as async; 13 | import 'dart:collection'; 14 | 15 | ///电脑炮弹 16 | class ComputerBullet extends BaseBullet{ 17 | 18 | factory ComputerBullet.green({required int tankId, required Size activeSize}) { 19 | return ComputerBullet('tank/bullet_green.webp', tankId: tankId, activeSize: activeSize); 20 | } 21 | 22 | factory ComputerBullet.sand({required int tankId, required Size activeSize}) { 23 | return ComputerBullet('tank/bullet_green.webp', tankId: tankId, activeSize: activeSize); 24 | } 25 | 26 | ComputerBullet(this.spritePath, {required int tankId, required Size activeSize}) 27 | : super(tankId: tankId, activeSize: activeSize); 28 | 29 | final String spritePath; 30 | 31 | late Sprite _sprite; 32 | 33 | Rect _rect = Rect.fromLTWH(-4, -2, 6, 4); 34 | 35 | @override 36 | Rect get bulletRect => _rect; 37 | 38 | @override 39 | Sprite get bulletSprite => _sprite; 40 | 41 | @override 42 | Future loadSprite() async { 43 | _sprite = await Sprite.load(spritePath); 44 | } 45 | 46 | @override 47 | ComputerBullet copyWith({int? tankId, Size? activeSize, Offset? position, double? angle, BulletStatus status = BulletStatus.none}) { 48 | final ComputerBullet pb = ComputerBullet(this.spritePath, tankId: tankId ?? this.tankId, activeSize: activeSize ?? this.activeSize); 49 | pb.position = position ?? Offset.zero; 50 | pb.angle = angle ?? 0; 51 | pb.status = status; 52 | return pb; 53 | } 54 | 55 | } 56 | 57 | ///玩家炮弹 58 | class PlayerBullet extends BaseBullet{ 59 | 60 | PlayerBullet({required int tankId, required Size activeSize}) 61 | : super(tankId: tankId, activeSize: activeSize); 62 | 63 | late Sprite _sprite; 64 | 65 | Rect _rect = Rect.fromLTWH(-4, -2, 8, 4); 66 | 67 | @override 68 | Sprite get bulletSprite => _sprite; 69 | 70 | @override 71 | Rect get bulletRect => _rect; 72 | 73 | @override 74 | Future loadSprite() async { 75 | _sprite = await Sprite.load('tank/bullet_blue.webp'); 76 | } 77 | 78 | @override 79 | PlayerBullet copyWith({int? tankId, Size? activeSize, Offset? position, double? angle, BulletStatus status = BulletStatus.none}) { 80 | final PlayerBullet pb = PlayerBullet(tankId: tankId ?? this.tankId, activeSize: activeSize ?? this.activeSize); 81 | pb.position = position ?? Offset.zero; 82 | pb.angle = angle ?? 0; 83 | pb.status = status; 84 | return pb; 85 | } 86 | 87 | } 88 | 89 | 90 | ///炮弹状态 91 | enum BulletStatus{ 92 | none, //初始状态 93 | standBy,// 准备状态: 可参与绘制 94 | hit, //击中状态 95 | outOfBorder, //飞出边界 96 | } 97 | 98 | 99 | ///炮弹基类 100 | abstract class BaseBullet extends WindowComponent{ 101 | 102 | BaseBullet({ 103 | required this.tankId, 104 | required this.activeSize, 105 | }) { 106 | init(); 107 | } 108 | 109 | BaseBullet copyWith({ 110 | int? tankId, 111 | Size? activeSize, 112 | Offset? position, 113 | double? angle, 114 | BulletStatus status = BulletStatus.none, 115 | }); 116 | 117 | ///隶属于的tank 118 | final int tankId; 119 | 120 | ///子弹尺寸 121 | /// * 后期可以加入特效等 122 | Rect get bulletRect; 123 | 124 | ///子弹皮肤 125 | Sprite get bulletSprite; 126 | 127 | ///可活动范围 128 | /// * 超出判定为失效子弹 129 | Size activeSize; 130 | 131 | ///位置 132 | Offset position = Offset.zero; 133 | 134 | ///速度 135 | double speed = 200; 136 | 137 | ///角度 138 | double angle = 0; 139 | 140 | ///子弹状态 141 | BulletStatus status = BulletStatus.none; 142 | 143 | ///可移除的子弹 144 | bool get dismissible => status.index > 1; 145 | 146 | void hit() { 147 | status = BulletStatus.hit; 148 | } 149 | 150 | ///加载炮弹纹理 151 | Future loadSprite(); 152 | 153 | ///初始化炮弹 154 | void init() async { 155 | await loadSprite(); 156 | status = BulletStatus.standBy; 157 | } 158 | 159 | @override 160 | void onGameResize(Vector2 canvasSize) { 161 | activeSize = canvasSize.toSize(); 162 | super.onGameResize(canvasSize); 163 | } 164 | 165 | 166 | @override 167 | void render(Canvas canvas) { 168 | if(dismissible) 169 | return; 170 | canvas.save(); 171 | canvas.translate(position.dx, position.dy); 172 | canvas.rotate(angle); 173 | bulletSprite.renderRect(canvas, bulletRect); 174 | canvas.restore(); 175 | } 176 | 177 | @override 178 | void update(double t) { 179 | if(dismissible) 180 | return; 181 | position += Offset.fromDirection(angle,speed * t); 182 | 183 | if(!activeSize.contains(position)) { 184 | status = BulletStatus.outOfBorder; 185 | } 186 | } 187 | 188 | } 189 | 190 | class BulletTrigger{ 191 | 192 | BulletTrigger() { 193 | trigger = async.Timer.periodic(const Duration(milliseconds: 100), _onTick); 194 | } 195 | 196 | final Queue _task = Queue(); 197 | 198 | late final async.Timer trigger; 199 | 200 | void _onTick(async.Timer timer) { 201 | if(_task.isEmpty) 202 | return; 203 | final Function t = _task.removeFirst(); 204 | t.call(); 205 | } 206 | 207 | void chargeLoading(Function b) { 208 | _task.add(b); 209 | } 210 | 211 | } 212 | -------------------------------------------------------------------------------- /lib/component/tank/tank_factory.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:tankcombat/component/tank/tank_model.dart'; 4 | import 'package:tankcombat/game/tank_game.dart'; 5 | 6 | /// 作者:李佳奇 7 | /// 日期:2022/3/28 8 | /// 备注:工厂、builder,tank-generator及tank模型 9 | 10 | ///用于生产绿色tank 11 | class GreenTankFlowLine extends ComputerTankFlowLine { 12 | GreenTankFlowLine(Offset depositPosition, Size activeSize) : super(depositPosition, activeSize); 13 | 14 | @override 15 | ComputerTank spawnTank() { 16 | final TankModelBuilder greenBuilder = TankModelBuilder( 17 | id: DateTime.now().millisecondsSinceEpoch, 18 | bodySpritePath: 'tank/t_body_green.webp', 19 | turretSpritePath: 'tank/t_turret_green.webp', 20 | activeSize: activeSize); 21 | return TankFactory.buildGreenTank(greenBuilder.build(), depositPosition); 22 | } 23 | 24 | } 25 | 26 | ///用于生产黄色tank 27 | class SandTankFlowLine extends ComputerTankFlowLine { 28 | SandTankFlowLine(Offset depositPosition, Size activeSize) : super(depositPosition, activeSize); 29 | 30 | @override 31 | ComputerTank spawnTank() { 32 | final TankModelBuilder sandBuilder = TankModelBuilder( 33 | id: DateTime.now().millisecondsSinceEpoch, 34 | bodySpritePath: 'tank/t_body_sand.webp', 35 | turretSpritePath: 'tank/t_turret_sand.webp', 36 | activeSize: activeSize); 37 | return TankFactory.buildSandTank(sandBuilder.build(), depositPosition); 38 | } 39 | } 40 | 41 | ///流水线基类 42 | /// * 用于生成电脑tank 43 | /// * 见[ComputerTankSpawner] 44 | abstract class ComputerTankFlowLine implements ComputerTankSpawnerTrigger { 45 | ComputerTankFlowLine(this.depositPosition, this.activeSize); 46 | 47 | ///活动范围 48 | final Size activeSize; 49 | 50 | ///部署位置 51 | final Offset depositPosition; 52 | } 53 | 54 | abstract class ComputerTankSpawnerTrigger { 55 | T spawnTank(); 56 | } 57 | 58 | ///电脑生成器 59 | /// * [TankTheater]下,tank生成的直接参与者,负责电脑的随机生成。 60 | /// 61 | /// * [spawners]为具体[ComputerTank]的生成流水线,见[GreenTankFlowLine]和[SandTankFlowLine] 62 | /// 流水线内部的[ComputerTank]产出由[TankFactory]负责。 63 | class ComputerTankSpawner { 64 | 65 | ///流水线 66 | List spawners = []; 67 | 68 | ///生成器初始化完成 69 | bool standby = false; 70 | 71 | ///构建中 72 | /// * 将会影响是否相应tank生成 73 | bool building = false; 74 | 75 | ///初始化调用 76 | /// * 用于配置流水线 77 | void warmUp(Size bgSize) { 78 | if (standby) { 79 | return; 80 | } 81 | standby = true; 82 | 83 | spawners.addAll([ 84 | GreenTankFlowLine(const Offset(100, 100), bgSize), 85 | GreenTankFlowLine(Offset(100, bgSize.height * 0.8), bgSize), 86 | SandTankFlowLine(Offset(bgSize.width - 100, 100), bgSize), 87 | SandTankFlowLine(Offset(bgSize.width - 100, bgSize.height * 0.8), bgSize) 88 | ]); 89 | } 90 | 91 | ///快速生成tank 92 | /// * 各生产线生成一辆tank 93 | /// * [plaza]为接收tank对象 94 | void fastSpawn(List plaza) { 95 | plaza.addAll(spawners.map((e) => e.spawnTank()..deposit()).toList()); 96 | } 97 | 98 | ///随机生成一辆tank 99 | /// * [plaza]为接收tank对象 100 | void randomSpan(List plaza) { 101 | if(building) { 102 | return; 103 | } 104 | building = true; 105 | _startSpawn(() { 106 | spawners.shuffle(); 107 | plaza.add(spawners.first.spawnTank()..deposit()); 108 | building = false; 109 | }); 110 | } 111 | 112 | ///用于约束生产速度 113 | void _startSpawn(Function task) { 114 | Future.delayed(const Duration(milliseconds: 1500)).then((value) { 115 | task(); 116 | }); 117 | } 118 | 119 | } 120 | 121 | ///用于构建tank 122 | class TankFactory { 123 | static PlayerTank buildPlayerTank(TankModel model, Offset birthPosition) { 124 | return PlayerTank(id: model.id, birthPosition: birthPosition, config: model); 125 | } 126 | 127 | static ComputerTank buildGreenTank(TankModel model, Offset birthPosition) { 128 | return ComputerTank.green(id: model.id, birthPosition: birthPosition, config: model); 129 | } 130 | 131 | static ComputerTank buildSandTank(TankModel model, Offset birthPosition) { 132 | return ComputerTank.sand(id: model.id, birthPosition: birthPosition, config: model); 133 | } 134 | } 135 | 136 | ///[TankModel]构建器 137 | class TankModelBuilder { 138 | TankModelBuilder({ 139 | required this.id, 140 | required this.bodySpritePath, 141 | required this.turretSpritePath, 142 | required this.activeSize, 143 | }); 144 | 145 | final int id; 146 | 147 | ///车体纹理 148 | final String bodySpritePath; 149 | 150 | ///炮塔纹理 151 | final String turretSpritePath; 152 | 153 | ///活动范围 154 | /// * 一般是地图尺寸 155 | Size activeSize; 156 | 157 | ///车体宽度 158 | double bodyWidth = 38; 159 | 160 | ///车体高度 161 | double bodyHeight = 32; 162 | 163 | ///炮塔宽度(长) 164 | double turretWidth = 22; 165 | 166 | ///炮塔高度(直径) 167 | double turretHeight = 6; 168 | 169 | ///坦克尺寸比例 170 | double ratio = 0.7; 171 | 172 | ///直线速度 173 | double speed = 80; 174 | 175 | ///转弯速度 176 | double turnSpeed = 40; 177 | 178 | ///设置活动范围 179 | void setActiveSize(Size size) { 180 | activeSize = size; 181 | } 182 | 183 | ///设置车身尺寸 184 | void setBodySize(double width, double height) { 185 | bodyWidth = width; 186 | bodyHeight = height; 187 | } 188 | 189 | ///设置炮塔尺寸 190 | void setTurretSize(double width, double height) { 191 | turretWidth = width; 192 | turretHeight = height; 193 | } 194 | 195 | ///设置tank尺寸比例 196 | void setTankRatio(double r) { 197 | ratio = r; 198 | } 199 | 200 | ///设置直线速度 201 | void setDirectSpeed(double s) { 202 | speed = s; 203 | } 204 | 205 | ///设置转弯速度 206 | void setTurnSpeed(double s) { 207 | turnSpeed = s; 208 | } 209 | 210 | TankModel build() { 211 | return TankModel( 212 | id: id, 213 | bodySpritePath: bodySpritePath, 214 | turretSpritePath: turretSpritePath, 215 | ratio: ratio, 216 | speed: speed, 217 | turnSpeed: turnSpeed, 218 | bodyWidth: bodyWidth, 219 | bodyHeight: bodyHeight, 220 | turretWidth: turretWidth, 221 | turretHeight: turretHeight, 222 | activeSize: activeSize, 223 | ); 224 | } 225 | } 226 | 227 | ///坦克基础配置模型 228 | /// * 由[TankModelBuilder]负责构建 229 | class TankModel { 230 | TankModel( 231 | {required this.id, 232 | required this.bodySpritePath, 233 | required this.turretSpritePath, 234 | required this.ratio, 235 | required this.speed, 236 | required this.turnSpeed, 237 | required this.bodyWidth, 238 | required this.bodyHeight, 239 | required this.turretWidth, 240 | required this.turretHeight, 241 | required this.activeSize}); 242 | 243 | final int id; 244 | 245 | ///车体宽度 246 | final double bodyWidth; 247 | 248 | ///车体高度 249 | final double bodyHeight; 250 | 251 | ///炮塔宽度(长) 252 | final double turretWidth; 253 | 254 | ///炮塔高度(直径) 255 | final double turretHeight; 256 | 257 | ///坦克尺寸比例 258 | final double ratio; 259 | 260 | ///直线速度 261 | final double speed; 262 | 263 | ///转弯速度 264 | final double turnSpeed; 265 | 266 | ///车体纹理 267 | final String bodySpritePath; 268 | 269 | ///炮塔纹理 270 | final String turretSpritePath; 271 | 272 | ///活动范围 273 | /// * 一般是地图尺寸 274 | Size activeSize; 275 | } 276 | -------------------------------------------------------------------------------- /lib/component/tank/tank_model.dart: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Author : LiJiqqi 4 | * Date : 2020/7/31 5 | */ 6 | 7 | import 'dart:math'; 8 | 9 | import 'package:flame/components.dart'; 10 | import 'package:flame/sprite.dart'; 11 | import 'package:flutter/material.dart'; 12 | import 'package:tankcombat/component/tank/bullet.dart'; 13 | 14 | import '../base_component.dart'; 15 | import 'tank_factory.dart'; 16 | 17 | ///电脑 18 | class ComputerTank extends DefaultTank { 19 | factory ComputerTank.green({ 20 | required int id, 21 | required Offset birthPosition, 22 | required TankModel config, 23 | }) { 24 | return ComputerTank( 25 | id: id, birthPosition: birthPosition, config: config, bullet: ComputerBullet.green(tankId: id, activeSize: config.activeSize)); 26 | } 27 | 28 | factory ComputerTank.sand({ 29 | required int id, 30 | required Offset birthPosition, 31 | required TankModel config, 32 | }) { 33 | return ComputerTank(id: id, birthPosition: birthPosition, config: config, bullet: ComputerBullet.sand(tankId: id, activeSize: config.activeSize)); 34 | } 35 | 36 | ComputerTank({ 37 | required int id, 38 | required Offset birthPosition, 39 | required TankModel config, 40 | required this.bullet, 41 | }) : super(id: id, birthPosition: birthPosition, config: config); 42 | 43 | ///用于生成随机路线 44 | static final Random random = Random(); 45 | 46 | ///活动边界 47 | static final double activeBorderLow = 0.01, activeBorderUp = 1 - activeBorderLow; 48 | 49 | ///最大单向移动距离 50 | static final double maxMovedDistance = 100; 51 | 52 | BaseBullet bullet; 53 | 54 | ///移动的距离 55 | double movedDis = 0; 56 | 57 | void generateNewTarget() { 58 | final double x = random.nextDouble().clamp(activeBorderLow, activeBorderUp) * config.activeSize.width; 59 | final double y = random.nextDouble().clamp(activeBorderLow, activeBorderUp) * config.activeSize.height; 60 | 61 | targetOffset = Offset(x, y); 62 | 63 | final Offset vector = targetOffset - position; 64 | targetBodyAngle = vector.direction; 65 | targetTurretAngle = vector.direction; 66 | } 67 | 68 | @override 69 | void deposit() { 70 | super.deposit(); 71 | generateNewTarget(); 72 | } 73 | 74 | @override 75 | void move(double t) { 76 | if (targetBodyAngle != null) { 77 | movedDis += speed * t; 78 | if (movedDis < maxMovedDistance) { 79 | super.move(t); 80 | } else { 81 | movedDis = 0; 82 | generateNewTarget(); 83 | } 84 | } 85 | } 86 | 87 | @override 88 | BaseBullet getBullet() => bullet.copyWith(position: getBulletFirePosition(), angle: getBulletFireAngle()); 89 | } 90 | 91 | ///玩家 92 | class PlayerTank extends DefaultTank { 93 | PlayerTank({required int id, required Offset birthPosition, required TankModel config}) 94 | : bullet = PlayerBullet(tankId: id, activeSize: config.activeSize), 95 | super(id: id, birthPosition: birthPosition, config: config); 96 | 97 | final PlayerBullet bullet; 98 | 99 | @override 100 | BaseBullet getBullet() => bullet.copyWith(position: getBulletFirePosition(), angle: getBulletFireAngle()); 101 | } 102 | 103 | 104 | ///可实例化的tank模型 105 | /// 106 | /// * [BaseTank]实例化的基准模型,不具备业务区分能力。见[PlayerTank]和[ComputerTank] 107 | abstract class DefaultTank extends BaseTank { 108 | DefaultTank({ 109 | required int id, 110 | required Offset birthPosition, 111 | required TankModel config, 112 | }) : super(id: id, birthPosition: birthPosition, config: config); 113 | 114 | @override 115 | void deposit() { 116 | isDead = false; 117 | } 118 | 119 | @override 120 | void onGameResize(Vector2 canvasSize) { 121 | config.activeSize = canvasSize.toSize(); 122 | super.onGameResize(canvasSize); 123 | } 124 | 125 | @override 126 | void render(Canvas canvas) { 127 | if (!isStandBy || isDead) { 128 | return; 129 | } 130 | //将canvas 原点设置在tank上 131 | canvas.save(); 132 | canvas.translate(position.dx, position.dy); 133 | drawBody(canvas); 134 | drawTurret(canvas); 135 | canvas.restore(); 136 | } 137 | 138 | @override 139 | void update(double t) { 140 | if (!isStandBy || isDead) { 141 | return; 142 | } 143 | rotateBody(t); 144 | rotateTurret(t); 145 | move(t); 146 | } 147 | 148 | @override 149 | void drawBody(Canvas canvas) { 150 | canvas.rotate(bodyAngle); 151 | bodySprite?.renderRect(canvas, bodyRect); 152 | } 153 | 154 | @override 155 | void drawTurret(Canvas canvas) { 156 | //旋转炮台 157 | canvas.rotate(turretAngle); 158 | // 绘制炮塔 159 | turretSprite?.renderRect(canvas, turretRect); 160 | } 161 | 162 | @override 163 | void move(double t) { 164 | if (targetBodyAngle == null) return; 165 | if (bodyAngle == targetBodyAngle) { 166 | //tank 直线时 移动速度快 167 | position += Offset.fromDirection(bodyAngle, speed * t); //100 是像素 168 | } else { 169 | //tank旋转时 移动速度要慢 170 | position += Offset.fromDirection(bodyAngle, turnSpeed * t); 171 | } 172 | } 173 | 174 | @override 175 | void rotateBody(double t) { 176 | if (targetBodyAngle != null) { 177 | final double rotationRate = pi * t; 178 | if (bodyAngle < targetBodyAngle!) { 179 | //车体角度和目标角度差额 180 | if ((targetBodyAngle! - bodyAngle).abs() > pi) { 181 | bodyAngle -= rotationRate; 182 | if (bodyAngle < -pi) { 183 | bodyAngle += pi * 2; 184 | } 185 | } else { 186 | bodyAngle += rotationRate; 187 | if (bodyAngle > targetBodyAngle!) { 188 | bodyAngle = targetBodyAngle!; 189 | } 190 | } 191 | } else if (bodyAngle > targetBodyAngle!) { 192 | if ((targetBodyAngle! - bodyAngle).abs() > pi) { 193 | bodyAngle += rotationRate; 194 | if (bodyAngle > pi) { 195 | bodyAngle -= pi * 2; 196 | } 197 | } else { 198 | bodyAngle -= rotationRate; 199 | if (bodyAngle < targetBodyAngle!) { 200 | bodyAngle = targetBodyAngle!; 201 | } 202 | } 203 | } 204 | } 205 | } 206 | 207 | @override 208 | void rotateTurret(double t) { 209 | if (targetTurretAngle != null) { 210 | final double rotationRate = pi * t; 211 | //炮塔和车身夹角 212 | final double localTargetTurretAngle = targetTurretAngle! - bodyAngle; 213 | if (turretAngle < localTargetTurretAngle) { 214 | if ((localTargetTurretAngle - turretAngle).abs() > pi) { 215 | turretAngle -= rotationRate; 216 | //超出临界值,进行转换 即:小于-pi时,转换成pi之后继续累加,具体参考 笛卡尔坐标,范围是(-pi,pi) 217 | if (turretAngle < -pi) { 218 | turretAngle += pi * 2; 219 | } 220 | } else { 221 | turretAngle += rotationRate; 222 | if (turretAngle > localTargetTurretAngle) { 223 | turretAngle = localTargetTurretAngle; 224 | } 225 | } 226 | } 227 | if (turretAngle > localTargetTurretAngle) { 228 | if ((localTargetTurretAngle - turretAngle).abs() > pi) { 229 | turretAngle += rotationRate; 230 | if (turretAngle > pi) { 231 | turretAngle -= pi * 2; 232 | } 233 | } else { 234 | turretAngle -= rotationRate; 235 | if (turretAngle < localTargetTurretAngle) { 236 | turretAngle = localTargetTurretAngle; 237 | } 238 | } 239 | } 240 | } 241 | } 242 | 243 | @override 244 | int getTankId() => id; 245 | 246 | @override 247 | double getBulletFireAngle() { 248 | double bulletAngle = bodyAngle + turretAngle; 249 | while (bulletAngle > pi) { 250 | bulletAngle -= pi * 2; 251 | } 252 | while (bulletAngle < -pi) { 253 | bulletAngle += pi * 2; 254 | } 255 | return bulletAngle; 256 | } 257 | 258 | @override 259 | Offset getBulletFirePosition() => 260 | position + 261 | Offset.fromDirection( 262 | getBulletFireAngle(), 263 | bulletBornLoc, 264 | ); 265 | } 266 | 267 | ///tank 开火辅助接口 268 | abstract class TankFireHelper { 269 | ///隶属于的坦克 270 | int getTankId(); 271 | 272 | ///获取炮弹发射位置 273 | Offset getBulletFirePosition(); 274 | 275 | ///获取炮弹发射角度 276 | double getBulletFireAngle(); 277 | 278 | ///获取tank所装配的炮弹 279 | BaseBullet getBullet(); 280 | } 281 | 282 | 283 | ///tank基础模型 284 | /// * 定义基础行为属性,外观属性依赖于[TankModel] 285 | /// * @see [TankModelBuilder] 286 | abstract class BaseTank extends WindowComponent implements TankFireHelper { 287 | BaseTank({ 288 | required int id, 289 | required this.config, 290 | required Offset birthPosition, 291 | }) : position = birthPosition { 292 | bodyRect = Rect.fromCenter(center: Offset.zero, width: bodyWidth * ratio, height: bodyHeight * ratio); 293 | turretRect = Rect.fromCenter(center: Offset.zero, width: turretWidth * ratio, height: turretHeight * ratio); 294 | init(); 295 | } 296 | 297 | final TankModel config; 298 | 299 | ///坦克位置 300 | Offset position; 301 | 302 | ///移动到目标位置 303 | late Offset targetOffset; 304 | 305 | ///车体角度 306 | double bodyAngle = 0; 307 | 308 | ///炮塔角度 309 | double turretAngle = 0; 310 | 311 | ///车体目标角度 312 | /// * 为空时,说明没有角度变动 313 | double? targetBodyAngle; 314 | 315 | ///炮塔目标角度 316 | /// * 为空时,说明没有角度变动 317 | double? targetTurretAngle; 318 | 319 | ///炮弹出炮口位置 320 | double get bulletBornLoc => 18; 321 | 322 | ///车体尺寸 323 | late Rect bodyRect; 324 | 325 | ///炮塔尺寸 326 | late Rect turretRect; 327 | 328 | ///tank是否存活 329 | bool isDead = true; 330 | 331 | ///车体 332 | Sprite? bodySprite; 333 | 334 | ///炮塔 335 | Sprite? turretSprite; 336 | 337 | ///配置完成 338 | bool isStandBy = false; 339 | 340 | int get id => config.id; 341 | 342 | ///车体宽度 343 | double get bodyWidth => config.bodyWidth; 344 | 345 | ///车体高度 346 | double get bodyHeight => config.bodyHeight; 347 | 348 | ///炮塔宽度(长) 349 | double get turretWidth => config.turretWidth; 350 | 351 | ///炮塔高度(直径) 352 | double get turretHeight => config.turretHeight; 353 | 354 | ///坦克尺寸比例 355 | double get ratio => config.ratio; 356 | 357 | ///直线速度 358 | double get speed => config.speed; 359 | 360 | ///转弯速度 361 | double get turnSpeed => config.turnSpeed; 362 | 363 | ///车体纹理 364 | String get bodySpritePath => config.bodySpritePath; 365 | 366 | ///炮塔纹理 367 | String get turretSpritePath => config.turretSpritePath; 368 | 369 | Future init() async { 370 | bodySprite = await Sprite.load(bodySpritePath); 371 | turretSprite = await Sprite.load(turretSpritePath); 372 | isStandBy = true; 373 | return isStandBy; 374 | } 375 | 376 | ///部署 377 | void deposit(); 378 | 379 | ///移动 380 | /// [t] 过渡时间-> 理论值16.66ms 381 | void move(double t); 382 | 383 | ///绘制车体 384 | void drawBody(Canvas canvas); 385 | 386 | ///绘制炮塔 387 | void drawTurret(Canvas canvas); 388 | 389 | ///旋转车体 390 | /// [t] 过渡时间-> 理论值16.66ms 391 | void rotateBody(double t); 392 | 393 | ///旋转炮塔 394 | /// [t] 过渡时间-> 理论值16.66ms 395 | void rotateTurret(double t); 396 | } 397 | 398 | -------------------------------------------------------------------------------- /lib/controller/control_panel_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../widgets/fire_button.dart'; 4 | import '../widgets/joy_stick.dart'; 5 | import 'controller_listener.dart'; 6 | 7 | /// 作者:李佳奇 8 | /// 日期:2022/3/24 9 | /// 备注:控制面板 10 | 11 | class ControlPanelWidget extends StatelessWidget{ 12 | 13 | const ControlPanelWidget({Key? key, 14 | required this.tankController}) 15 | : super(key: key); 16 | 17 | final TankController tankController; 18 | 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return Column( 23 | children: [ 24 | Spacer(), 25 | //发射按钮 26 | Row( 27 | children: [ 28 | SizedBox(width: 48), 29 | FireButton( 30 | buttonControllerListener: tankController, 31 | ), 32 | Spacer(), 33 | FireButton( 34 | buttonControllerListener: tankController, 35 | ), 36 | SizedBox(width: 48), 37 | ], 38 | ), 39 | SizedBox(height: 20), 40 | //摇杆 41 | Row( 42 | children: [ 43 | SizedBox(width: 48), 44 | JoyStick( 45 | onChange: tankController.bodyAngleChanged, 46 | ), 47 | Spacer(), 48 | JoyStick( 49 | onChange: tankController.turretAngleChanged, 50 | ), 51 | SizedBox(width: 48) 52 | ], 53 | ), 54 | SizedBox(height: 24) 55 | ], 56 | ); 57 | } 58 | 59 | 60 | } 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /lib/controller/controller_listener.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | /// 作者:李佳奇 4 | /// 日期:2022/3/23 5 | /// 备注:控制器监听器 6 | 7 | ///控制接口 8 | abstract class DirectionControllerListener{ 9 | 10 | ///车身角度变化 11 | void bodyAngleChanged(Offset newAngle); 12 | 13 | ///炮塔角度变化 14 | void turretAngleChanged(Offset newAngle); 15 | 16 | } 17 | 18 | 19 | ///开火接口 20 | abstract class ButtonControllerListener{ 21 | 22 | ///开火按钮触发 23 | void fireButtonTriggered(); 24 | 25 | } 26 | 27 | 28 | ///[DirectionControllerListener]和[ButtonControllerListener]的连接器 29 | abstract class TankController implements DirectionControllerListener, ButtonControllerListener {} 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /lib/game/game_action.dart: -------------------------------------------------------------------------------- 1 | 2 | import '../component/tank/tank_model.dart'; 3 | 4 | /// 作者:李佳奇 5 | /// 日期:2022/3/29 6 | /// 备注:一些游戏接口 7 | 8 | abstract class ComputerTankAction{ 9 | void computerTankFire(TankFireHelper helper); 10 | } 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /lib/game/tank_game.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'dart:ui'; 3 | 4 | import 'package:flame/components.dart'; 5 | import 'package:flame/game.dart'; 6 | import 'package:flutter/cupertino.dart'; 7 | import 'package:tankcombat/component/explosion/decoration_theater.dart'; 8 | import 'package:tankcombat/component/tank/tank_model.dart'; 9 | import 'package:tankcombat/observer/game_observer.dart'; 10 | import 'package:tankcombat/utils/computer_timer.dart'; 11 | import '../utils/extension.dart'; 12 | 13 | import '../component/tank/bullet.dart'; 14 | import '../component/tank/tank_factory.dart'; 15 | import '../controller/controller_listener.dart'; 16 | import 'game_action.dart'; 17 | 18 | 19 | ///游戏入口 20 | /// * 继承于[FlameGame] 21 | /// * 所混入的类 : [BulletTheater]、[TankTheater]、[ComputerTimer]、[DecorationTheater]、[GameObserver] 22 | /// * 用于拓展[TankGame]的场景内容和[Sprite]交互行为,具体见各自的注释。 23 | class TankGame extends FlameGame with BulletTheater, TankTheater, ComputerTimer, DecorationTheater, GameObserver{ 24 | 25 | TankGame() { 26 | setTimerListener(this); 27 | } 28 | 29 | @override 30 | void onGameResize(Vector2 canvasSize) { 31 | super.onGameResize(canvasSize); 32 | } 33 | 34 | @override 35 | void render(Canvas canvas) { 36 | super.render(canvas); 37 | } 38 | 39 | @override 40 | void update(double t) { 41 | super.update(t); 42 | } 43 | 44 | } 45 | 46 | ///负责管理玩家和电脑tank 47 | mixin TankTheater on FlameGame, BulletTheater implements TankController, ComputerTimerListener{ 48 | 49 | ComputerTankSpawner _computerSpawner = ComputerTankSpawner(); 50 | 51 | PlayerTank? player; 52 | 53 | final List computers = []; 54 | 55 | void initPlayer(Vector2 canvasSize) { 56 | final Size bgSize = canvasSize.toSize(); 57 | 58 | final TankModelBuilder playerBuilder = TankModelBuilder( 59 | id: DateTime.now().millisecondsSinceEpoch, 60 | bodySpritePath: 'tank/t_body_blue.webp', 61 | turretSpritePath: 'tank/t_turret_blue.webp', 62 | activeSize: bgSize); 63 | 64 | player ??= TankFactory.buildPlayerTank(playerBuilder.build() 65 | , Offset(bgSize.width/2,bgSize.height/2)); 66 | player!.deposit(); 67 | } 68 | 69 | ///初始化敌军 70 | /// * 一般情况下是在游戏伊始时执行。 71 | void initEnemyTank() { 72 | _computerSpawner.fastSpawn(computers); 73 | } 74 | 75 | void randomSpanTank() { 76 | _computerSpawner.randomSpan(computers); 77 | } 78 | 79 | 80 | @override 81 | void onFireTimerTrigger() { 82 | computers.shuffle(); 83 | computers.forEach(computerTankFire); 84 | } 85 | 86 | @override 87 | void onGameResize(Vector2 canvasSize) { 88 | if(player == null) { 89 | initPlayer(canvasSize); 90 | } 91 | if(computers.isEmpty) { 92 | _computerSpawner.warmUp(canvasSize.toSize()); 93 | initEnemyTank(); 94 | computers.forEach((element) => element.deposit()); 95 | } 96 | player?.onGameResize(canvasSize); 97 | computers.onGameResize(canvasSize); 98 | super.onGameResize(canvasSize); 99 | } 100 | 101 | @override 102 | void render(Canvas canvas) { 103 | player?.render(canvas); 104 | computers.render(canvas); 105 | super.render(canvas); 106 | } 107 | 108 | @override 109 | void update(double dt) { 110 | player?.update(dt); 111 | computers.update(dt); 112 | super.update(dt); 113 | computers.removeWhere((element) => element.isDead); 114 | } 115 | 116 | @override 117 | void fireButtonTriggered() { 118 | if(player != null){ 119 | playerTankFire(player!); 120 | } 121 | } 122 | 123 | @override 124 | void bodyAngleChanged(Offset newAngle) { 125 | if(newAngle == Offset.zero){ 126 | player?.targetBodyAngle = null; 127 | }else{ 128 | player?.targetBodyAngle = newAngle.direction;//范围(pi,-pi) 129 | } 130 | } 131 | 132 | @override 133 | void turretAngleChanged(Offset newAngle) { 134 | if (newAngle == Offset.zero) { 135 | player?.targetTurretAngle = null; 136 | } else { 137 | player?.targetTurretAngle = newAngle.direction; 138 | } 139 | } 140 | 141 | } 142 | 143 | 144 | ///负责坦克的开火系统 145 | mixin BulletTheater on FlameGame implements ComputerTankAction{ 146 | 147 | ///电脑tank的开火器 148 | final BulletTrigger trigger = BulletTrigger(); 149 | 150 | ///玩家炮弹最大数量 151 | final int maxPlayerBulletNum = 20; 152 | 153 | 154 | List computerBullets = []; 155 | 156 | List playerBullets = []; 157 | 158 | void playerTankFire(TankFireHelper helper) { 159 | if(playerBullets.length < maxPlayerBulletNum) { 160 | playerBullets.add(helper.getBullet()); 161 | } 162 | } 163 | 164 | @override 165 | void computerTankFire(TankFireHelper helper) { 166 | trigger.chargeLoading(() { 167 | computerBullets.add(helper.getBullet()); 168 | }); 169 | } 170 | 171 | @override 172 | void onGameResize(Vector2 canvasSize) { 173 | computerBullets.onGameResize(canvasSize); 174 | playerBullets.onGameResize(canvasSize); 175 | super.onGameResize(canvasSize); 176 | } 177 | 178 | @override 179 | void render(Canvas canvas) { 180 | computerBullets.render(canvas); 181 | playerBullets.render(canvas); 182 | super.render(canvas); 183 | } 184 | 185 | 186 | @override 187 | void update(double dt) { 188 | computerBullets.update(dt); 189 | playerBullets.update(dt); 190 | super.update(dt); 191 | computerBullets.removeWhere((element) => element.dismissible); 192 | playerBullets.removeWhere((element) => element.dismissible); 193 | } 194 | 195 | 196 | } 197 | 198 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'dart:ui' as ui; 3 | 4 | import 'package:flame/flame.dart'; 5 | import 'package:flame/game.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:flutter/services.dart'; 8 | import 'package:tankcombat/game/tank_game.dart'; 9 | 10 | import 'controller/control_panel_widget.dart'; 11 | 12 | void main() async { 13 | WidgetsFlutterBinding.ensureInitialized(); 14 | 15 | bool isMobile = Platform.isAndroid || Platform.isIOS; 16 | 17 | if (isMobile) { 18 | ///设置横屏 19 | await SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeRight, DeviceOrientation.landscapeLeft]); 20 | 21 | ///全面屏 22 | await SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []); 23 | } 24 | 25 | final TankGame tankGame = TankGame(); 26 | 27 | runApp(Directionality( 28 | textDirection: TextDirection.ltr, 29 | child: Stack( 30 | children: [ 31 | FutureBuilder>( 32 | future: loadAssets(), 33 | initialData: [], 34 | builder: (ctx, snapShot) { 35 | if(snapShot.data?.isEmpty ?? true) { 36 | return Center( 37 | child: LinearProgressIndicator( 38 | color: Colors.blue, 39 | ), 40 | ); 41 | } 42 | return GameWidget(game: tankGame); 43 | }, 44 | ), 45 | ControlPanelWidget(tankController: tankGame,), 46 | ], 47 | ))); 48 | } 49 | 50 | Future> loadAssets() { 51 | return Flame.images.loadAll([ 52 | 'new_map.webp', 53 | 'tank/t_body_blue.webp', 54 | 'tank/t_turret_blue.webp', 55 | 'tank/t_body_green.webp', 56 | 'tank/t_turret_green.webp', 57 | 'tank/t_body_sand.webp', 58 | 'tank/t_turret_sand.webp', 59 | 'tank/bullet_blue.webp', 60 | 'tank/bullet_green.webp', 61 | 'tank/bullet_sand.webp', 62 | 'explosion/explosion1.webp', 63 | 'explosion/explosion2.webp', 64 | 'explosion/explosion3.webp', 65 | 'explosion/explosion4.webp', 66 | 'explosion/explosion5.webp', 67 | ]); 68 | } 69 | -------------------------------------------------------------------------------- /lib/observer/game_observer.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Author : LiJiqqi 3 | * Date : 2020/7/31 4 | */ 5 | 6 | import 'package:flame/components.dart'; 7 | import 'package:flame/game.dart'; 8 | 9 | import 'package:flutter/cupertino.dart'; 10 | import 'package:tankcombat/component/explosion/decoration_theater.dart'; 11 | import 'package:tankcombat/game/tank_game.dart'; 12 | 13 | ///游戏裁判 14 | /// * 用于观测[Sprite]之间的交互,并触发衍生交互, 15 | /// * 如:是否击中、[OrangeExplosion]的触发等. 16 | mixin GameObserver on FlameGame, TankTheater, DecorationTheater{ 17 | 18 | @override 19 | void update(double dt) { 20 | super.update(dt); 21 | watching(dt); 22 | } 23 | 24 | void watching(double t) async { 25 | if(computers.length < 4) { 26 | randomSpanTank(); 27 | } 28 | ///check hit 29 | checkHit(); 30 | } 31 | 32 | ///命中距离 33 | /// * 车身位置和炮弹位置小于10 算命中 34 | final double hitDistance = 10; 35 | 36 | ///检查是否有tank被击中 37 | void checkHit() { 38 | playerBullets.forEach((bullet) { 39 | computers.forEach((c) { 40 | final Offset hitZone = c.position - bullet.position; 41 | if(hitZone.distance < hitDistance) { 42 | c.isDead = true; 43 | bullet.hit(); 44 | addExplosions(c.position); 45 | } 46 | }); 47 | }); 48 | //todo 玩家无敌 49 | //computerBullets.forEach((element) { }); 50 | } 51 | 52 | } 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /lib/utils/computer_timer.dart: -------------------------------------------------------------------------------- 1 | import 'package:flame/game.dart'; 2 | import 'package:flame/timer.dart'; 3 | import 'package:flutter/foundation.dart'; 4 | 5 | /// 作者:李佳奇 6 | /// 日期:2022/4/1 7 | /// 备注:电脑计时器,用于执行一些定时性操作 8 | 9 | ///电脑自动开火接口 10 | abstract class ComputerTimerListener{ 11 | void onFireTimerTrigger(); 12 | } 13 | 14 | ///电脑计时器 15 | /// * 主要用于触发一些自动行为,如[ComputerTimerListener]自动开火。 16 | mixin ComputerTimer on FlameGame{ 17 | 18 | Timer? timer; 19 | 20 | void onTick() { 21 | _listener?.onFireTimerTrigger(); 22 | } 23 | 24 | ComputerTimerListener? _listener; 25 | 26 | void setTimerListener(ComputerTimerListener listener) { 27 | _listener = listener; 28 | } 29 | 30 | 31 | @override 32 | void onGameResize(Vector2 canvasSize) { 33 | super.onGameResize(canvasSize); 34 | //limit's unit : second 35 | timer ??= Timer(1, repeat: true, onTick: onTick); 36 | } 37 | 38 | @override 39 | void update(double dt) { 40 | super.update(dt); 41 | timer!.update(dt); 42 | } 43 | 44 | } 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /lib/utils/extension.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:flame/components.dart'; 4 | 5 | import '../component/base_component.dart'; 6 | 7 | /// 作者:李佳奇 8 | /// 日期:2022/3/31 9 | /// 备注:拓展类 10 | 11 | 12 | ///[WindowComponent]相关list的拓展类。 13 | extension GameExtension on List{ 14 | 15 | void onGameResize(Vector2 canvasSize) { 16 | forEach((element) => element.onGameResize(canvasSize)); 17 | } 18 | 19 | void render(Canvas canvas) { 20 | forEach((element) => element.render(canvas)); 21 | } 22 | 23 | void update(double dt) { 24 | forEach((element) => element.update(dt)); 25 | } 26 | 27 | 28 | } 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /lib/widgets/fire_button.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Author : LiJiqqi 3 | * Date : 2020/7/30 4 | */ 5 | import 'package:flutter/material.dart'; 6 | 7 | import '../controller/controller_listener.dart'; 8 | 9 | ///开火按钮 10 | class FireButton extends StatelessWidget { 11 | const FireButton({Key? key, required this.buttonControllerListener}) : super(key: key); 12 | 13 | final ButtonControllerListener buttonControllerListener; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return GestureDetector( 18 | child: Container( 19 | height: 64, 20 | width: 64, 21 | decoration: BoxDecoration( 22 | color: const Color(0x88ffffff), 23 | borderRadius: BorderRadius.circular(32), 24 | ), 25 | ), 26 | onTap: buttonControllerListener.fireButtonTriggered, 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/widgets/joy_stick.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Author : LiJiqqi 3 | * Date : 2020/7/30 4 | */ 5 | 6 | import 'dart:math'; 7 | 8 | import 'package:flutter/material.dart'; 9 | 10 | 11 | ///摇杆 12 | class JoyStick extends StatefulWidget { 13 | final void Function(Offset) onChange; 14 | 15 | const JoyStick({Key? key, required this.onChange}) : super(key: key); 16 | 17 | @override 18 | State createState() { 19 | return JoyStickState(); 20 | } 21 | } 22 | 23 | class JoyStickState extends State { 24 | ///偏移量 25 | Offset delta = Offset.zero; 26 | 27 | ///更新位置 28 | void updateDelta(Offset newD) { 29 | widget.onChange(newD); 30 | setState(() { 31 | delta = newD; 32 | }); 33 | } 34 | 35 | Offset calculateDelta(Offset offset) { 36 | Offset newD = offset - Offset(stickSize / 2, stickSize / 2); 37 | //活动范围控制在stickSize之内 38 | return Offset.fromDirection(newD.direction, min(stickSize / 4, newD.distance)); 39 | } 40 | 41 | ///遥感尺寸 42 | /// * 外层大圆的直径,上层圆为1/2直径 43 | final double stickSize = 120; 44 | 45 | @override 46 | Widget build(BuildContext context) { 47 | return Container( 48 | width: stickSize, 49 | height: stickSize, 50 | decoration: BoxDecoration( 51 | borderRadius: BorderRadius.circular(stickSize / 2), 52 | color: const Color(0x88ffffff), 53 | ), 54 | child: GestureDetector( 55 | //摇杆背景 56 | child: Center( 57 | child: Transform.translate( 58 | offset: delta, 59 | //摇杆 60 | child: SizedBox( 61 | width: stickSize / 2, 62 | height: stickSize / 2, 63 | child: Container( 64 | decoration: BoxDecoration( 65 | color: const Color(0xccffffff), 66 | borderRadius: BorderRadius.circular(30), 67 | ), 68 | ), 69 | ), 70 | ), 71 | ), 72 | onPanDown: onDragDown, 73 | onPanUpdate: onDragUpdate, 74 | onPanEnd: onDragEnd, 75 | ), 76 | ); 77 | } 78 | 79 | void onDragDown(DragDownDetails d) { 80 | updateDelta(calculateDelta(d.localPosition)); 81 | } 82 | 83 | void onDragUpdate(DragUpdateDetails d) { 84 | updateDelta(calculateDelta(d.localPosition)); 85 | } 86 | 87 | void onDragEnd(DragEndDetails d) { 88 | updateDelta(Offset.zero); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | <<<<<<< HEAD 2 | # Generated by pub 3 | # See https://dart.dev/tools/pub/glossary#lockfile 4 | packages: 5 | async: 6 | dependency: transitive 7 | description: 8 | name: async 9 | url: "https://pub.flutter-io.cn" 10 | source: hosted 11 | version: "2.8.2" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | url: "https://pub.flutter-io.cn" 17 | source: hosted 18 | version: "2.1.0" 19 | characters: 20 | dependency: transitive 21 | description: 22 | name: characters 23 | url: "https://pub.flutter-io.cn" 24 | source: hosted 25 | version: "1.2.0" 26 | charcode: 27 | dependency: transitive 28 | description: 29 | name: charcode 30 | url: "https://pub.flutter-io.cn" 31 | source: hosted 32 | version: "1.3.1" 33 | clock: 34 | dependency: transitive 35 | description: 36 | name: clock 37 | url: "https://pub.flutter-io.cn" 38 | source: hosted 39 | version: "1.1.0" 40 | collection: 41 | dependency: transitive 42 | description: 43 | name: collection 44 | url: "https://pub.flutter-io.cn" 45 | source: hosted 46 | version: "1.15.0" 47 | cupertino_icons: 48 | dependency: "direct main" 49 | description: 50 | name: cupertino_icons 51 | url: "https://pub.flutter-io.cn" 52 | source: hosted 53 | version: "0.1.3" 54 | fake_async: 55 | dependency: transitive 56 | description: 57 | name: fake_async 58 | url: "https://pub.flutter-io.cn" 59 | source: hosted 60 | version: "1.2.0" 61 | flame: 62 | dependency: "direct main" 63 | description: 64 | name: flame 65 | url: "https://pub.flutter-io.cn" 66 | source: hosted 67 | version: "1.0.0" 68 | flutter: 69 | dependency: "direct main" 70 | description: flutter 71 | source: sdk 72 | version: "0.0.0" 73 | flutter_test: 74 | dependency: "direct dev" 75 | description: flutter 76 | source: sdk 77 | version: "0.0.0" 78 | matcher: 79 | dependency: transitive 80 | description: 81 | name: matcher 82 | url: "https://pub.flutter-io.cn" 83 | source: hosted 84 | version: "0.12.11" 85 | material_color_utilities: 86 | dependency: transitive 87 | description: 88 | name: material_color_utilities 89 | url: "https://pub.flutter-io.cn" 90 | source: hosted 91 | version: "0.1.3" 92 | meta: 93 | dependency: transitive 94 | description: 95 | name: meta 96 | url: "https://pub.flutter-io.cn" 97 | source: hosted 98 | version: "1.7.0" 99 | ordered_set: 100 | dependency: transitive 101 | description: 102 | name: ordered_set 103 | url: "https://pub.flutter-io.cn" 104 | source: hosted 105 | version: "5.0.0" 106 | path: 107 | dependency: transitive 108 | description: 109 | name: path 110 | url: "https://pub.flutter-io.cn" 111 | source: hosted 112 | version: "1.8.0" 113 | sky_engine: 114 | dependency: transitive 115 | description: flutter 116 | source: sdk 117 | version: "0.0.99" 118 | source_span: 119 | dependency: transitive 120 | description: 121 | name: source_span 122 | url: "https://pub.flutter-io.cn" 123 | source: hosted 124 | version: "1.8.1" 125 | stack_trace: 126 | dependency: transitive 127 | description: 128 | name: stack_trace 129 | url: "https://pub.flutter-io.cn" 130 | source: hosted 131 | version: "1.10.0" 132 | stream_channel: 133 | dependency: transitive 134 | description: 135 | name: stream_channel 136 | url: "https://pub.flutter-io.cn" 137 | source: hosted 138 | version: "2.1.0" 139 | string_scanner: 140 | dependency: transitive 141 | description: 142 | name: string_scanner 143 | url: "https://pub.flutter-io.cn" 144 | source: hosted 145 | version: "1.1.0" 146 | term_glyph: 147 | dependency: transitive 148 | description: 149 | name: term_glyph 150 | url: "https://pub.flutter-io.cn" 151 | source: hosted 152 | version: "1.2.0" 153 | test_api: 154 | dependency: transitive 155 | description: 156 | name: test_api 157 | url: "https://pub.flutter-io.cn" 158 | source: hosted 159 | version: "0.4.8" 160 | typed_data: 161 | dependency: transitive 162 | description: 163 | name: typed_data 164 | url: "https://pub.flutter-io.cn" 165 | source: hosted 166 | version: "1.3.0" 167 | vector_math: 168 | dependency: transitive 169 | description: 170 | name: vector_math 171 | url: "https://pub.flutter-io.cn" 172 | source: hosted 173 | version: "2.1.1" 174 | sdks: 175 | dart: ">=2.14.0 <3.0.0" 176 | flutter: ">=2.10.0" 177 | ======= 178 | # Generated by pub 179 | # See https://dart.dev/tools/pub/glossary#lockfile 180 | packages: 181 | async: 182 | dependency: transitive 183 | description: 184 | name: async 185 | url: "https://pub.flutter-io.cn" 186 | source: hosted 187 | version: "2.8.2" 188 | boolean_selector: 189 | dependency: transitive 190 | description: 191 | name: boolean_selector 192 | url: "https://pub.flutter-io.cn" 193 | source: hosted 194 | version: "2.1.0" 195 | characters: 196 | dependency: transitive 197 | description: 198 | name: characters 199 | url: "https://pub.flutter-io.cn" 200 | source: hosted 201 | version: "1.2.0" 202 | charcode: 203 | dependency: transitive 204 | description: 205 | name: charcode 206 | url: "https://pub.flutter-io.cn" 207 | source: hosted 208 | version: "1.3.1" 209 | clock: 210 | dependency: transitive 211 | description: 212 | name: clock 213 | url: "https://pub.flutter-io.cn" 214 | source: hosted 215 | version: "1.1.0" 216 | collection: 217 | dependency: transitive 218 | description: 219 | name: collection 220 | url: "https://pub.flutter-io.cn" 221 | source: hosted 222 | version: "1.15.0" 223 | cupertino_icons: 224 | dependency: "direct main" 225 | description: 226 | name: cupertino_icons 227 | url: "https://pub.flutter-io.cn" 228 | source: hosted 229 | version: "0.1.3" 230 | fake_async: 231 | dependency: transitive 232 | description: 233 | name: fake_async 234 | url: "https://pub.flutter-io.cn" 235 | source: hosted 236 | version: "1.2.0" 237 | flame: 238 | dependency: "direct main" 239 | description: 240 | name: flame 241 | url: "https://pub.flutter-io.cn" 242 | source: hosted 243 | version: "1.0.0" 244 | flutter: 245 | dependency: "direct main" 246 | description: flutter 247 | source: sdk 248 | version: "0.0.0" 249 | flutter_test: 250 | dependency: "direct dev" 251 | description: flutter 252 | source: sdk 253 | version: "0.0.0" 254 | matcher: 255 | dependency: transitive 256 | description: 257 | name: matcher 258 | url: "https://pub.flutter-io.cn" 259 | source: hosted 260 | version: "0.12.11" 261 | material_color_utilities: 262 | dependency: transitive 263 | description: 264 | name: material_color_utilities 265 | url: "https://pub.flutter-io.cn" 266 | source: hosted 267 | version: "0.1.3" 268 | meta: 269 | dependency: transitive 270 | description: 271 | name: meta 272 | url: "https://pub.flutter-io.cn" 273 | source: hosted 274 | version: "1.7.0" 275 | ordered_set: 276 | dependency: transitive 277 | description: 278 | name: ordered_set 279 | url: "https://pub.flutter-io.cn" 280 | source: hosted 281 | version: "5.0.0" 282 | path: 283 | dependency: transitive 284 | description: 285 | name: path 286 | url: "https://pub.flutter-io.cn" 287 | source: hosted 288 | version: "1.8.0" 289 | sky_engine: 290 | dependency: transitive 291 | description: flutter 292 | source: sdk 293 | version: "0.0.99" 294 | source_span: 295 | dependency: transitive 296 | description: 297 | name: source_span 298 | url: "https://pub.flutter-io.cn" 299 | source: hosted 300 | version: "1.8.1" 301 | stack_trace: 302 | dependency: transitive 303 | description: 304 | name: stack_trace 305 | url: "https://pub.flutter-io.cn" 306 | source: hosted 307 | version: "1.10.0" 308 | stream_channel: 309 | dependency: transitive 310 | description: 311 | name: stream_channel 312 | url: "https://pub.flutter-io.cn" 313 | source: hosted 314 | version: "2.1.0" 315 | string_scanner: 316 | dependency: transitive 317 | description: 318 | name: string_scanner 319 | url: "https://pub.flutter-io.cn" 320 | source: hosted 321 | version: "1.1.0" 322 | term_glyph: 323 | dependency: transitive 324 | description: 325 | name: term_glyph 326 | url: "https://pub.flutter-io.cn" 327 | source: hosted 328 | version: "1.2.0" 329 | test_api: 330 | dependency: transitive 331 | description: 332 | name: test_api 333 | url: "https://pub.flutter-io.cn" 334 | source: hosted 335 | version: "0.4.8" 336 | typed_data: 337 | dependency: transitive 338 | description: 339 | name: typed_data 340 | url: "https://pub.flutter-io.cn" 341 | source: hosted 342 | version: "1.3.0" 343 | vector_math: 344 | dependency: transitive 345 | description: 346 | name: vector_math 347 | url: "https://pub.flutter-io.cn" 348 | source: hosted 349 | version: "2.1.1" 350 | sdks: 351 | dart: ">=2.14.0 <3.0.0" 352 | flutter: ">=2.10.0" 353 | >>>>>>> origin/master 354 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: tankcombat 2 | description: A new Flutter application. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 1.0.0+1 19 | 20 | environment: 21 | sdk: ">=2.12.0 <3.0.0" 22 | flutter: ">=2.10.0" 23 | 24 | dependencies: 25 | flutter: 26 | sdk: flutter 27 | 28 | 29 | # The following adds the Cupertino Icons font to your application. 30 | # Use with the CupertinoIcons class for iOS style icons. 31 | cupertino_icons: ^0.1.3 32 | 33 | flame: 1.0.0 34 | 35 | dev_dependencies: 36 | flutter_test: 37 | sdk: flutter 38 | 39 | # For information on the generic Dart part of this file, see the 40 | # following page: https://dart.dev/tools/pub/pubspec 41 | 42 | # The following section is specific to Flutter. 43 | flutter: 44 | 45 | # The following line ensures that the Material Icons font is 46 | # included with your application, so that you can use the icons in 47 | # the material Icons class. 48 | uses-material-design: true 49 | 50 | # To add assets to your application, add an assets section, like this: 51 | # assets: 52 | # - images/a_dot_burr.jpeg 53 | # - images/a_dot_ham.jpeg 54 | assets: 55 | - assets/images/ 56 | - assets/images/tank/ 57 | - assets/images/explosion/ 58 | 59 | # An image asset can refer to one or more resolution-specific "variants", see 60 | # https://flutter.dev/assets-and-images/#resolution-aware. 61 | 62 | # For details regarding adding assets from package dependencies, see 63 | # https://flutter.dev/assets-and-images/#from-packages 64 | 65 | # To add custom fonts to your application, add a fonts section here, 66 | # in this "flutter" section. Each entry in this list should have a 67 | # "family" key with the font family name, and a "fonts" key with a 68 | # list giving the asset and other descriptors for the font. For 69 | # example: 70 | # fonts: 71 | # - family: Schyler 72 | # fonts: 73 | # - asset: fonts/Schyler-Regular.ttf 74 | # - asset: fonts/Schyler-Italic.ttf 75 | # style: italic 76 | # - family: Trajan Pro 77 | # fonts: 78 | # - asset: fonts/TrajanPro.ttf 79 | # - asset: fonts/TrajanPro_Bold.ttf 80 | # weight: 700 81 | # 82 | # For details regarding fonts from package dependencies, 83 | # see https://flutter.dev/custom-fonts/#from-packages 84 | -------------------------------------------------------------------------------- /tank-combat.xmind: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/tank-combat.xmind -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:tankcombat/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladeofgod/tank_combat/e8e4dbcb93d2afd991bfe9dae40c30f71bda1d57/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | tankcombat 18 | 19 | 20 | 21 | 24 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tankcombat", 3 | "short_name": "tankcombat", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter application.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | --------------------------------------------------------------------------------