diff --git a/README.md b/README.md index e98554d..b88bb7d 100644 --- a/README.md +++ b/README.md @@ -103,9 +103,9 @@ Windows: [√] Flutter (Channel stable, 3.19.6, on Microsoft Windows [版本 10.0.22621.3007], locale zh-CN) [√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.6) -[√] Android Studio (version 2023.2) +[√] Android Studio (version 2023.3) [√] IntelliJ IDEA Ultimate Edition (version 2024.1) -[√] VS Code (version 1.88.1) +[√] VS Code (version 1.89.0) ``` macOS: diff --git a/android/app/build.gradle b/android/app/build.gradle index 8098d2f..467ef6e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -23,7 +23,9 @@ if (flutterVersionName == null) { } android { - compileSdkVersion 34 + namespace "com.example.moodexample" + compileSdk flutter.compileSdkVersion + ndkVersion flutter.ndkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -41,6 +43,8 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.moodexample" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion 21 targetSdkVersion 33 versionCode flutterVersionCode.toInteger() diff --git a/lib/views/settings/laboratory/game/mini_fantasy/components/human_player.dart b/lib/views/settings/laboratory/game/mini_fantasy/components/human_player.dart index 6a854be..fc7aa28 100644 --- a/lib/views/settings/laboratory/game/mini_fantasy/components/human_player.dart +++ b/lib/views/settings/laboratory/game/mini_fantasy/components/human_player.dart @@ -118,7 +118,7 @@ class HumanPlayer extends SimplePlayer /// 受伤触发 @override - void receiveDamage(AttackFromEnum attacker, double damage, dynamic from) { + bool receiveDamage(AttackOriginEnum attacker, double damage, dynamic from) { if (!isDead) { showDamage( damage, @@ -136,11 +136,11 @@ class HumanPlayer extends SimplePlayer // gameRef.lighting?.animateToColor(Colors.black.withOpacity(0.7)); // }); } - super.receiveDamage(attacker, damage, from); + return super.receiveDamage(attacker, damage, from); } @override - void die() { + void onDie() { animation?.playOnce( SpriteSheetPlayer.getDie(), onFinish: () { @@ -148,7 +148,7 @@ class HumanPlayer extends SimplePlayer }, runToTheEnd: true, ); - super.die(); + super.onDie(); } /// 攻击动画 diff --git a/lib/views/settings/laboratory/game/mini_fantasy/components/orc.dart b/lib/views/settings/laboratory/game/mini_fantasy/components/orc.dart index 6beb4ff..46b6441 100644 --- a/lib/views/settings/laboratory/game/mini_fantasy/components/orc.dart +++ b/lib/views/settings/laboratory/game/mini_fantasy/components/orc.dart @@ -100,7 +100,7 @@ class Orc extends SimpleEnemy /// 死亡 @override - void die() { + void onDie() { _canMove = false; gameRef.lighting?.animateToColor(Colors.black.withOpacity(0.7)); @@ -113,12 +113,12 @@ class Orc extends SimpleEnemy }, runToTheEnd: true, ); - super.die(); + super.onDie(); } /// 受伤触发 @override - void receiveDamage(AttackFromEnum attacker, double damage, identify) { + bool receiveDamage(AttackOriginEnum attacker, double damage, identify) { if (!isDead) { /// 伤害显示 showDamage( @@ -130,7 +130,7 @@ class Orc extends SimpleEnemy /// 受伤动画 // _addDamageAnimation(); } - super.receiveDamage(attacker, damage, identify); + return super.receiveDamage(attacker, damage, identify); } /// 攻击动画 diff --git a/lib/views/settings/laboratory/game/mini_fantasy/index.dart b/lib/views/settings/laboratory/game/mini_fantasy/index.dart index 192b3d4..16c2bf9 100644 --- a/lib/views/settings/laboratory/game/mini_fantasy/index.dart +++ b/lib/views/settings/laboratory/game/mini_fantasy/index.dart @@ -87,7 +87,7 @@ class Game extends StatelessWidget { ], ), map: WorldMapByTiled( - TiledReader.asset('$assetsPath/tiles/map.json'), + WorldMapReader.fromAsset('$assetsPath/tiles/map.json'), forceTileSize: Vector2(tileSize, tileSize), objectsBuilder: { 'light': (properties) => Light( diff --git a/lib/views/settings/laboratory/game/mini_game/components/boss.dart b/lib/views/settings/laboratory/game/mini_game/components/boss.dart index ce29c6c..a87a65d 100644 --- a/lib/views/settings/laboratory/game/mini_game/components/boss.dart +++ b/lib/views/settings/laboratory/game/mini_game/components/boss.dart @@ -87,15 +87,15 @@ class Boss extends SimpleEnemy /// 死亡 @override - void die() { + void onDie() { _canMove = false; removeFromParent(); - super.die(); + super.onDie(); } /// 受伤触发 @override - void receiveDamage(AttackFromEnum attacker, double damage, identify) { + bool receiveDamage(AttackOriginEnum attacker, double damage, identify) { if (!isDead) { /// 伤害显示 showDamage( @@ -104,7 +104,7 @@ class Boss extends SimpleEnemy config: TextStyle(color: Colors.amberAccent, fontSize: tileSize / 2), ); } - super.receiveDamage(attacker, damage, identify); + return super.receiveDamage(attacker, damage, identify); } /// 攻击 diff --git a/lib/views/settings/laboratory/game/mini_game/components/human_player.dart b/lib/views/settings/laboratory/game/mini_game/components/human_player.dart index 2c86791..d777ca4 100644 --- a/lib/views/settings/laboratory/game/mini_game/components/human_player.dart +++ b/lib/views/settings/laboratory/game/mini_game/components/human_player.dart @@ -190,16 +190,16 @@ class HumanPlayer extends SimplePlayer /// 受伤触发 @override - void receiveDamage(AttackFromEnum attacker, double damage, dynamic from) { + bool receiveDamage(AttackOriginEnum attacker, double damage, dynamic from) { handleReceiveDamage(damage); - super.receiveDamage(attacker, damage, from); + return super.receiveDamage(attacker, damage, from); } /// 死亡 @override - void die() { + void onDie() { handleDie(); - super.die(); + super.onDie(); } /// 受伤触发 @@ -371,7 +371,7 @@ class HumanPlayer extends SimplePlayer withDecorationCollision: false, speed: maxSpeed * (tileSize / 10), damage: 50.0 + Random().nextInt(10), - attackFrom: AttackFromEnum.PLAYER_OR_ALLY, + attackFrom: AttackOriginEnum.PLAYER_OR_ALLY, marginFromOrigin: 30, collision: RectangleHitbox( size: Vector2(tileSize, tileSize), @@ -395,7 +395,7 @@ class HumanPlayer extends SimplePlayer withDecorationCollision: false, speed: maxSpeed * (tileSize / 10), damage: 50.0 + Random().nextInt(20), - attackFrom: AttackFromEnum.PLAYER_OR_ALLY, + attackFrom: AttackOriginEnum.PLAYER_OR_ALLY, marginFromOrigin: 35, collision: RectangleHitbox( size: Vector2(tileSize, tileSize), diff --git a/lib/views/settings/laboratory/game/mini_game/components/orc.dart b/lib/views/settings/laboratory/game/mini_game/components/orc.dart index e2698dd..ad803f5 100644 --- a/lib/views/settings/laboratory/game/mini_game/components/orc.dart +++ b/lib/views/settings/laboratory/game/mini_game/components/orc.dart @@ -101,7 +101,7 @@ class Orc extends SimpleEnemy /// 死亡 @override - void die() { + void onDie() { _canMove = false; /// 死亡动画 @@ -113,12 +113,12 @@ class Orc extends SimpleEnemy }, runToTheEnd: true, ); - super.die(); + super.onDie(); } /// 受伤触发 @override - void receiveDamage(AttackFromEnum attacker, double damage, identify) { + bool receiveDamage(AttackOriginEnum attacker, double damage, identify) { if (!isDead) { /// 伤害显示 showDamage( @@ -130,7 +130,7 @@ class Orc extends SimpleEnemy /// 受伤动画 // addDamageAnimation(); } - super.receiveDamage(attacker, damage, identify); + return super.receiveDamage(attacker, damage, identify); } /// 攻击动画 diff --git a/lib/views/settings/laboratory/game/mini_game/index.dart b/lib/views/settings/laboratory/game/mini_game/index.dart index ca63444..d7261d1 100644 --- a/lib/views/settings/laboratory/game/mini_game/index.dart +++ b/lib/views/settings/laboratory/game/mini_game/index.dart @@ -129,7 +129,7 @@ class _GameState extends State { ], ), // required map: WorldMapByTiled( - TiledReader.asset('$assetsPath/tiles/mini_game_map.json'), + WorldMapReader.fromAsset('$assetsPath/tiles/mini_game_map.json'), forceTileSize: Vector2(tileSize, tileSize), objectsBuilder: { 'light': (properties) => Light( diff --git a/pubspec.lock b/pubspec.lock index ec16804..d57e8cd 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -45,10 +45,10 @@ packages: dependency: "direct main" description: name: bonfire - sha256: a1267f69da645202449048290a84ad97b7f6468eb684bdf7bc3d42fc8a6cdf4f + sha256: "55b1506fd18b62239bfe96686ba15888b7bad500410b8368ebd07f5b16c71f8e" url: "https://pub.dev" source: hosted - version: "3.7.1" + version: "3.8.5" boolean_selector: dependency: transitive description: @@ -165,10 +165,10 @@ packages: dependency: "direct main" description: name: file_picker - sha256: b6283d7387310ad83bc4f3bc245b75d223a032ae6eba275afcd585de2b9a1476 + sha256: "29c90806ac5f5fb896547720b73b17ee9aed9bba540dc5d91fe29f8c5745b10a" url: "https://pub.dev" source: hosted - version: "8.0.1" + version: "8.0.3" fixnum: dependency: transitive description: @@ -552,10 +552,10 @@ packages: dependency: transitive description: name: pointycastle - sha256: "70fe966348fe08c34bf929582f1d8247d9d9408130723206472b4687227e4333" + sha256: "79fbafed02cfdbe85ef3fd06c7f4bc2cbcba0177e61b765264853d4253b21744" url: "https://pub.dev" source: hosted - version: "3.8.0" + version: "3.9.0" process: dependency: transitive description: @@ -600,18 +600,18 @@ packages: dependency: "direct main" description: name: share_plus - sha256: fb5319f3aab4c5dda5ebb92dca978179ba21f8c783ee4380910ef4c1c6824f51 + sha256: ef3489a969683c4f3d0239010cc8b7a2a46543a8d139e111c06c558875083544 url: "https://pub.dev" source: hosted - version: "8.0.3" + version: "9.0.0" share_plus_platform_interface: dependency: transitive description: name: share_plus_platform_interface - sha256: "251eb156a8b5fa9ce033747d73535bf53911071f8d3b6f4f0b578505ce0d4496" + sha256: "0f9e4418835d1b2c3ae78fdb918251959106cefdbc4dd43526e182f80e82f6d4" url: "https://pub.dev" source: hosted - version: "3.4.0" + version: "4.0.0" shared_preferences: dependency: "direct main" description: @@ -701,10 +701,10 @@ packages: dependency: "direct main" description: name: sqflite - sha256: "5ce2e1a15e822c3b4bfb5400455775e421da7098eed8adc8f26298ada7c9308c" + sha256: a43e5a27235518c03ca238e7b4732cf35eabe863a369ceba6cbefa537a66f16d url: "https://pub.dev" source: hosted - version: "2.3.3" + version: "2.3.3+1" sqflite_common: dependency: transitive description: @@ -885,10 +885,10 @@ packages: dependency: transitive description: name: webview_flutter_android - sha256: f038ee2fae73b509dde1bc9d2c5a50ca92054282de17631a9a3d515883740934 + sha256: dad3313c9ead95517bb1cae5e1c9d20ba83729d5a59e5e83c0a2d66203f27f91 url: "https://pub.dev" source: hosted - version: "3.16.0" + version: "3.16.1" webview_flutter_platform_interface: dependency: transitive description: @@ -909,10 +909,10 @@ packages: dependency: transitive description: name: win32 - sha256: "0a989dc7ca2bb51eac91e8fd00851297cfffd641aa7538b165c62637ca0eaa4a" + sha256: "0eaf06e3446824099858367950a813472af675116bf63f008a4c2a75ae13e9cb" url: "https://pub.dev" source: hosted - version: "5.4.0" + version: "5.5.0" xdg_directories: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 8d7ebb8..17a2865 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: moodexample description: 管理自己的情绪,记录当下所见所想。 publish_to: 'none' -version: 1.9.9+453 +version: 1.9.9+454 environment: sdk: ">=3.3.0 <4.0.0" @@ -16,7 +16,7 @@ dependencies: path_provider: ^2.1.3 # 路径 flutter_screenutil: ^5.9.0 # UI 自适应工具 provider: ^6.1.2 # 状态管理 - sqflite: ^2.3.3 # 数据库 + sqflite: ^2.3.3+1 # 数据库 shared_preferences: ^2.2.3 # 共享存储 fluro: ^2.0.5 # 路由管理 flutter_zoom_drawer: ^3.2.0 # 缩放抽屉 @@ -26,15 +26,15 @@ dependencies: card_swiper: ^3.0.1 # 轮播 fl_chart: ^0.67.0 # 图表 excel: ^4.0.3 # Excel - share_plus: ^8.0.3 # 分享 - file_picker: ^8.0.1 # 文件选择 + share_plus: ^9.0.0 # 分享 + file_picker: ^8.0.3 # 文件选择 webview_flutter: ^4.7.0 # WebView ditredi: ^2.0.2 # 3D 数据集显示 vector_math: ^2.1.4 awesome_notifications: ^0.9.3+1 # 本地通知 flutter_timezone: ^1.0.8 # 时区 animations: ^2.0.11 # 动画 - bonfire: 3.7.1 # 游戏引擎相关 + bonfire: 3.8.5 # 游戏引擎相关 flame: 1.17.0 # 游戏引擎相关 flutter_screen_lock: ^9.0.2 # 密码锁 local_auth: ^2.2.0 # 本地认证