17 #ifndef HEADER_SUPERTUX_OBJECT_BONUS_BLOCK_HPP 18 #define HEADER_SUPERTUX_OBJECT_BONUS_BLOCK_HPP 20 #include "object/block.hpp" 21 #include "supertux/direction.hpp" 22 #include "supertux/player_status.hpp" 50 virtual void hit(
Player& player)
override;
54 virtual std::string get_class()
const override {
return "bonusblock"; }
55 virtual std::string get_display_name()
const override {
return _(
"Bonus block"); }
59 Content get_contents()
const {
return m_contents; }
60 int get_hit_counter()
const {
return m_hit_counter; }
63 void try_open(
Player* player);
64 void try_drop(
Player* player);
66 void preload_contents(
int d);
67 void raise_growup_bonus(
Player* player,
const BonusType& bonus,
const Direction& dir);
68 void drop_growup_bonus(
const std::string& bonus_sprite_name,
bool& countdown);
70 BonusBlock::Content get_content_by_data(
int tile_data)
const;
71 BonusBlock::Content get_content_from_string(
const std::string& contentstring)
const;
72 std::string contents_to_string(
const BonusBlock::Content& content)
const;
76 std::unique_ptr<MovingObject> m_object;
79 SurfacePtr m_lightsprite;
80 sexp::Value m_custom_sx;
Simple two dimensional vector.
Definition: vector.hpp:24
Definition: object_settings.hpp:35
Definition: bonus_block.hpp:26
virtual void draw(DrawingContext &context) override
The GameObject should draw itself onto the provided DrawingContext if this function is called...
Definition: bonus_block.cpp:517
Base class for all the things that make up Levels' Sectors.
Definition: game_object.hpp:46
virtual HitResponse collision(GameObject &other, const CollisionHit &hit) override
this function is called when the object collided with any other object
Definition: bonus_block.cpp:225
Definition: reader_mapping.hpp:31
Definition: player.hpp:39
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42
This class collects data about a collision.
Definition: collision_hit.hpp:44