Skip to content

Commit

Permalink
fix: directions on random_movement
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessoal Dev authored and Pessoal Dev committed Nov 22, 2024
1 parent d888a97 commit 5430e6e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 3.12.2
# 3.12.3
- `RandomMovement` improvements

# 3.12.1
Expand Down
4 changes: 3 additions & 1 deletion lib/mixins/random_movement.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ mixin RandomMovement on Movement {
minDistance,
maxDistance,
checkDirectionWithRayCast,
directions,
);
if (target == null) {
_stop();
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 5430e6e

Please sign in to comment.