19 #ifndef HEADER_SUPERTUX_SUPERTUX_TILE_HPP 20 #define HEADER_SUPERTUX_SUPERTUX_TILE_HPP 25 #include "math/rectf.hpp" 26 #include "video/color.hpp" 27 #include "video/surface_ptr.hpp" 35 static bool draw_editor_images;
59 FIRST_INTERESTING_FLAG = 0x0100,
73 WORLDMAP_NORTH = 0x0001,
74 WORLDMAP_SOUTH = 0x0002,
75 WORLDMAP_EAST = 0x0004,
76 WORLDMAP_WEST = 0x0008,
77 WORLDMAP_DIR_MASK = 0x000f,
79 WORLDMAP_STOP = 0x0010,
82 WORLDMAP_CNSE = WORLDMAP_NORTH | WORLDMAP_SOUTH | WORLDMAP_EAST,
83 WORLDMAP_CNSW = WORLDMAP_NORTH | WORLDMAP_SOUTH | WORLDMAP_WEST,
84 WORLDMAP_CNEW = WORLDMAP_NORTH | WORLDMAP_EAST | WORLDMAP_WEST,
85 WORLDMAP_CSEW = WORLDMAP_SOUTH | WORLDMAP_EAST | WORLDMAP_WEST,
86 WORLDMAP_CNSEW = WORLDMAP_NORTH | WORLDMAP_SOUTH | WORLDMAP_EAST | WORLDMAP_WEST
100 Tile(
const std::vector<SurfacePtr>& images,
101 const std::vector<SurfacePtr>& editor_images,
102 uint32_t attributes, uint32_t data,
float fps,
103 const std::string& obj_name =
"",
const std::string& obj_data =
"",
104 bool deprecated =
false);
108 void draw_debug(
Canvas& canvas,
const Vector& pos,
int z_pos,
const Color& color =
Color(1.0f, 0.f, 1.0f, 0.5f))
const;
110 SurfacePtr get_current_surface()
const;
111 SurfacePtr get_current_editor_surface()
const;
113 uint32_t get_attributes()
const {
return m_attributes; }
114 int get_data()
const {
return m_data; }
141 bool is_deprecated()
const {
return m_deprecated; }
143 const std::string& get_object_name()
const {
return m_object_name; }
144 const std::string& get_object_data()
const {
return m_object_data; }
149 bool check_movement_unisolid (
const Vector& movement)
const;
153 bool check_position_unisolid (
const Rectf& obj_bbox,
154 const Rectf& tile_bbox)
const;
157 std::vector<SurfacePtr> m_images;
158 std::vector<SurfacePtr> m_editor_images;
161 uint32_t m_attributes;
168 std::string m_object_name;
169 std::string m_object_data;
176 Tile& operator=(
const Tile&) =
delete;
Bonusbox, content is stored in data.
Definition: tile.hpp:54
uni-directional solid tile
Definition: tile.hpp:43
bool is_slope() const
Checks the SLOPE attribute.
Definition: tile.hpp:117
a brick that can be destroyed by jumping under it
Definition: tile.hpp:45
bool is_unisolid() const
Checks the UNISOLID attribute.
Definition: tile.hpp:139
Simple two dimensional vector.
Definition: vector.hpp:24
for lava: WATER, HURTS, FIRE
Definition: tile.hpp:68
a water tile in which tux starts to swim
Definition: tile.hpp:64
slope tile
Definition: tile.hpp:52
void draw(Canvas &canvas, const Vector &pos, int z_pos, const Color &color=Color(1, 1, 1)) const
Draw a tile on the screen.
Definition: tile.cpp:77
bool is_collisionful(const Rectf &tile_bbox, const Rectf &position, const Vector &movement) const
Determines whether the tile's attributes are important to calculate the collisions.
Definition: tile.cpp:496
an ice brick that makes tux sliding more than usual
Definition: tile.hpp:62
the level should be finished when touching a goaltile.
Definition: tile.hpp:50
solid tile that is indestructible by Tux
Definition: tile.hpp:41
a tile that hurts Tux if he touches it
Definition: tile.hpp:66
Tile is a coin.
Definition: tile.hpp:56
bool is_solid() const
This version only checks the SOLID flag to determine the solidity of a tile.
Definition: tile.hpp:131
Definition: canvas.hpp:43
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42