flower.hpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // SuperTux
  2. // Copyright (C) 2006 Matthias Braun <matze@braunis.de>
  3. //
  4. // This program is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License
  15. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. #ifndef HEADER_SUPERTUX_OBJECT_FLOWER_HPP
  17. #define HEADER_SUPERTUX_OBJECT_FLOWER_HPP
  18. #include "supertux/moving_object.hpp"
  19. #include "sprite/sprite_ptr.hpp"
  20. #include "supertux/player_status.hpp"
  21. #include "video/flip.hpp"
  22. #include "video/layer.hpp"
  23. class Flower final : public MovingObject
  24. {
  25. friend class FlipLevelTransformer;
  26. public:
  27. Flower(BonusType type, const std::string& custom_sprite = "");
  28. virtual bool is_saveable() const override { return false; }
  29. virtual void update(float dt_sec) override;
  30. virtual void draw(DrawingContext& context) override;
  31. virtual HitResponse collision(GameObject& other, const CollisionHit& hit) override;
  32. virtual void on_flip(float height) override;
  33. virtual int get_layer() const override { return LAYER_OBJECTS; }
  34. private:
  35. BonusType type;
  36. SpritePtr sprite;
  37. Flip flip;
  38. SpritePtr lightsprite;
  39. private:
  40. Flower(const Flower&) = delete;
  41. Flower& operator=(const Flower&) = delete;
  42. };
  43. #endif
  44. /* EOF */