Skip to content

Commit

Permalink
Fix Walkers walking backwards
Browse files Browse the repository at this point in the history
The direction flags LEFT and RIGHT are 0x0001 and 0x0010, not 0 and 1. This causes the Walkers to walk backwards and smoke to originate in the wrong place.
  • Loading branch information
dasi authored Jul 11, 2024
1 parent c6fe131 commit d6ce9b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/Walker.hx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Walker extends FlxSprite
velocity.x = 0;
if (++_s >= _smoke.length)
_s = 0;
_smoke.members[_s].x = x + ((facing == LEFT) ? (width - 22) : 10);
_smoke.members[_s].x = x + ((facing == LEFT) ? 10 : (width - 22));
_smoke.members[_s].y = y + height;
_smoke.members[_s].start(false, _smoke.members[_s].frequency);
}
Expand All @@ -66,7 +66,7 @@ class Walker extends FlxSprite
{
_walkTimer = FlxG.random.float(2, 6);
animation.play("walk");
velocity.x = (facing == LEFT) ? 40 : -40;
velocity.x = (facing == LEFT) ? -40 : 40;
}
else
{
Expand All @@ -75,7 +75,7 @@ class Walker extends FlxSprite

if (++_s >= _smoke.length)
_s = 0;
_smoke.members[_s].x = x + ((facing == LEFT) ? (width - 22) : 10);
_smoke.members[_s].x = x + ((facing == LEFT) ? 10 : (width - 22));
_smoke.members[_s].y = y + height;
_smoke.members[_s].start(false, _smoke.members[_s].frequency);
}
Expand Down

0 comments on commit d6ce9b4

Please sign in to comment.