Skip to content

Commit

Permalink
restore accidentally broken functionality, darts shot during levelfli…
Browse files Browse the repository at this point in the history
…p are now flipped properly
  • Loading branch information
Narre committed Jul 21, 2023
1 parent 024c6da commit bd693b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/badguy/dart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ Dart::Dart(const ReaderMapping& reader) :
SoundManager::current()->preload("sounds/stomp.wav");
}

Dart::Dart(const Vector& pos, Direction d, const BadGuy* parent_ = nullptr, const std::string& sprite) :
Dart::Dart(const Vector& pos, Direction d, const BadGuy* parent_ = nullptr, const std::string& sprite, Flip flip) :
BadGuy(pos, d, sprite),
parent(parent_),
sound_source()
{
m_physic.enable_gravity(false);
m_countMe = false;
m_flip = flip;
SoundManager::current()->preload(DART_SOUND);
SoundManager::current()->preload("sounds/darthit.wav");
SoundManager::current()->preload("sounds/stomp.wav");
Expand Down
2 changes: 1 addition & 1 deletion src/badguy/dart.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Dart final : public BadGuy
{
public:
Dart(const ReaderMapping& reader);
Dart(const Vector& pos, Direction d, const BadGuy* parent, const std::string& sprite = "images/creatures/dart/dart.sprite");
Dart(const Vector& pos, Direction d, const BadGuy* parent, const std::string& sprite = "images/creatures/dart/dart.sprite", Flip flip = NO_FLIP);

virtual void initialize() override;
virtual void activate() override;
Expand Down
2 changes: 1 addition & 1 deletion src/badguy/darttrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void
DartTrap::fire()
{
SoundManager::current()->play("sounds/dartfire.wav", get_pos());
Dart &dart = Sector::get().add<Dart>(Vector(0.f, 0.f), m_dir, this, m_dart_sprite);
Dart &dart = Sector::get().add<Dart>(Vector(0.f, 0.f), m_dir, this, m_dart_sprite, m_flip);

Vector pos;
switch (m_dir)
Expand Down

0 comments on commit bd693b6

Please sign in to comment.