Skip to content

Commit

Permalink
Merge pull request #509 from RafaelBarbosatec/develop
Browse files Browse the repository at this point in the history
Version 3.8.5
  • Loading branch information
RafaelBarbosatec committed May 2, 2024
2 parents 58e09a7 + 1fcdf55 commit 78de669
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 3.8.5
- Fix bug in `JumperAnimation`

# 3.8.4
- `KeyboardConfig` improvements. Now `directionalKeys` expect list of `KeyboardDirectionalKeys`. Fix [#507](https://github.com/RafaelBarbosatec/bonfire/issues/507)
- `PlatformEnemy` improvements.
Expand Down
2 changes: 1 addition & 1 deletion lib/mixins/interval_checker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mixin InternalChecker on Component {
}

void resetInterval(String key) {
_timers?[key]?.reset();
_timers?.remove(key);
}

void tickInterval(String key) {
Expand Down
4 changes: 1 addition & 3 deletions lib/mixins/jumper_animation.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'package:bonfire/bonfire.dart';
import 'package:bonfire/mixins/direction_animation.dart';
import 'package:bonfire/mixins/jumper.dart';
import 'package:bonfire/util/direction.dart';
import 'package:bonfire/util/direction_animations/simple_animation_enum.dart';

enum JumpAnimationsEnum {
jumpUpRight,
Expand Down
15 changes: 14 additions & 1 deletion lib/npc/enemy/platform_enemy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:bonfire/bonfire.dart';

class PlatformEnemy extends SimpleEnemy
with BlockMovementCollision, Jumper, JumperAnimation {
bool _canIdle = true;
PlatformEnemy({
required super.position,
required super.size,
Expand Down Expand Up @@ -30,14 +31,26 @@ class PlatformEnemy extends SimpleEnemy
JumpAnimationsEnum.jumpDownLeft: animation.jump!.jumpDownLeft!,
...animation.others ?? {},
},
centerAnchor: animation.centerAnchor,
),
) {
setupJumper(maxJump: countJumps);
}

@override
void onMove(
double speed,
Vector2 displacement,
Direction direction,
double angle,
) {
_canIdle = direction.isVertical;
super.onMove(speed, displacement, direction, angle);
}

@override
void idle() {
if (lastDirection.isHorizontal) {
if (_canIdle) {
super.idle();
}
}
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.8.4
version: 3.8.5
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 78de669

Please sign in to comment.