Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelBarbosatec committed May 2, 2024
1 parent 6628cf8 commit c54a32b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 4 additions & 2 deletions lib/input/player_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ enum JoystickMoveDirectional {
MOVE_LEFT,
IDLE;

bool get isLeft => this == MOVE_LEFT || this == MOVE_DOWN_LEFT || this == MOVE_UP_LEFT;
bool get isRight => this == MOVE_RIGHT || this == MOVE_DOWN_RIGHT || this == MOVE_UP_RIGHT;
bool get isLeft =>
this == MOVE_LEFT || this == MOVE_DOWN_LEFT || this == MOVE_UP_LEFT;
bool get isRight =>
this == MOVE_RIGHT || this == MOVE_DOWN_RIGHT || this == MOVE_UP_RIGHT;
}

class JoystickDirectionalEvent {
Expand Down
6 changes: 2 additions & 4 deletions lib/map/spritefusion/world_map_by_spritefusion.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ class WorldMapBySpritefusion extends WorldMap {
WorldMapReader<SpritefusionMap> reader, {
ValueChanged<Object>? onError,
double sizeToUpdate = 0,
Map<String, SpritefusionObjectBuilder>? objectsBuilder
Map<String, SpritefusionObjectBuilder>? objectsBuilder,
}) : super(const []) {
this.sizeToUpdate = sizeToUpdate;
_builder = SpritefusionWorldBuilder(
reader,
onError: onError,
sizeToUpdate: sizeToUpdate,
objectsBuilder:objectsBuilder,
objectsBuilder: objectsBuilder,
);
}

Expand All @@ -28,5 +28,3 @@ class WorldMapBySpritefusion extends WorldMap {
return super.onLoad();
}
}


2 changes: 1 addition & 1 deletion lib/mixins/attackable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ mixin Attackable on GameComponent {

/// This method is used to check if this component can receive damage from any attacker.
bool checkCanReceiveDamage(AttackOriginEnum attacker) {
if (isDead) return false;
if (isDead || isRemoving) return false;
switch (receivesAttackFrom) {
case AcceptableAttackOriginEnum.ALL:
return true;
Expand Down
2 changes: 1 addition & 1 deletion lib/objects/flying_attack_game_object.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class FlyingAttackGameObject extends AnimatedGameObject

@override
void onCollision(Set<Vector2> intersectionPoints, PositionComponent other) {
if (other is Attackable && !other.isRemoving && animationDestroy == null) {
if (other is Attackable && animationDestroy == null) {
other.receiveDamage(attackFrom, damage, id);
}
if (other is GameComponent) {
Expand Down

0 comments on commit c54a32b

Please sign in to comment.