From 5430e6ee93255e09bbcbf64ddad4456f03c25a17 Mon Sep 17 00:00:00 2001 From: Pessoal Dev Date: Fri, 22 Nov 2024 07:49:57 -0300 Subject: [PATCH] fix: directions on random_movement --- CHANGELOG.md | 2 +- lib/mixins/random_movement.dart | 4 +++- pubspec.yaml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02874ce2..6f36b73c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 3.12.2 +# 3.12.3 - `RandomMovement` improvements # 3.12.1 diff --git a/lib/mixins/random_movement.dart b/lib/mixins/random_movement.dart index 0dadc85c..bd0657bb 100644 --- a/lib/mixins/random_movement.dart +++ b/lib/mixins/random_movement.dart @@ -75,6 +75,7 @@ mixin RandomMovement on Movement { minDistance, maxDistance, checkDirectionWithRayCast, + directions, ); if (target == null) { _stop(); @@ -154,11 +155,12 @@ mixin RandomMovement on Movement { double minDistance, double maxDistance, bool checkDirectionWithRayCast, + RandomMovementDirections directions, ) { int index = 0; while (index < 100) { final distance = _getDistance(minDistance, maxDistance); - final direction = _getDirection(RandomMovementDirections.all); + final direction = _getDirection(directions); final targetPosition = _getTargetPosition(direction, distance); bool isRaycastOk = true; diff --git a/pubspec.yaml b/pubspec.yaml index 0588e1da..56c768f0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: bonfire description: (RPG maker) Create RPG-style or similar games more simply with Flame. -version: 3.12.2 +version: 3.12.3 homepage: https://bonfire-engine.github.io repository: https://github.com/RafaelBarbosatec/bonfire issue_tracker: https://github.com/RafaelBarbosatec/bonfire/issues