Skip to content

Commit

Permalink
Upgrade: Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
AmosHuKe committed May 6, 2024
1 parent 44f5e6d commit 44966e9
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 48 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 5 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -136,19 +136,19 @@ 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: () {
removeFromParent();
},
runToTheEnd: true,
);
super.die();
super.onDie();
}

/// 攻击动画
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class Orc extends SimpleEnemy

/// 死亡
@override
void die() {
void onDie() {
_canMove = false;
gameRef.lighting?.animateToColor(Colors.black.withOpacity(0.7));

Expand All @@ -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(
Expand All @@ -130,7 +130,7 @@ class Orc extends SimpleEnemy
/// 受伤动画
// _addDamageAnimation();
}
super.receiveDamage(attacker, damage, identify);
return super.receiveDamage(attacker, damage, identify);
}

/// 攻击动画
Expand Down
2 changes: 1 addition & 1 deletion lib/views/settings/laboratory/game/mini_fantasy/index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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);
}

/// 攻击
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/// 受伤触发
Expand Down Expand Up @@ -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),
Expand All @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class Orc extends SimpleEnemy

/// 死亡
@override
void die() {
void onDie() {
_canMove = false;

/// 死亡动画
Expand All @@ -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(
Expand All @@ -130,7 +130,7 @@ class Orc extends SimpleEnemy
/// 受伤动画
// addDamageAnimation();
}
super.receiveDamage(attacker, damage, identify);
return super.receiveDamage(attacker, damage, identify);
}

/// 攻击动画
Expand Down
2 changes: 1 addition & 1 deletion lib/views/settings/laboratory/game/mini_game/index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class _GameState extends State<Game> {
],
), // 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(
Expand Down
32 changes: 16 additions & 16 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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 # 缩放抽屉
Expand All @@ -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 # 本地认证
Expand Down

0 comments on commit 44966e9

Please sign in to comment.