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,
75 WORLDMAP_NORTH = 0x0001,
76 WORLDMAP_SOUTH = 0x0002,
77 WORLDMAP_EAST = 0x0004,
78 WORLDMAP_WEST = 0x0008,
79 WORLDMAP_DIR_MASK = 0x000f,
81 WORLDMAP_STOP = 0x0010,
84 WORLDMAP_CNSE = WORLDMAP_NORTH | WORLDMAP_SOUTH | WORLDMAP_EAST,
85 WORLDMAP_CNSW = WORLDMAP_NORTH | WORLDMAP_SOUTH | WORLDMAP_WEST,
86 WORLDMAP_CNEW = WORLDMAP_NORTH | WORLDMAP_EAST | WORLDMAP_WEST,
87 WORLDMAP_CSEW = WORLDMAP_SOUTH | WORLDMAP_EAST | WORLDMAP_WEST,
88 WORLDMAP_CNSEW = WORLDMAP_NORTH | WORLDMAP_SOUTH | WORLDMAP_EAST | WORLDMAP_WEST
102 Tile(
const std::vector<SurfacePtr>& images,
103 const std::vector<SurfacePtr>& editor_images,
104 uint32_t attributes, uint32_t data,
float fps,
105 bool deprecated =
false,
106 const std::string& obj_name =
"",
const std::string& obj_data =
"");
109 void draw(
Canvas& canvas,
const Vector& pos,
int z_pos,
const Color& color =
Color(1, 1, 1))
const;
110 void draw_debug(
Canvas& canvas,
const Vector& pos,
int z_pos,
const Color& color =
Color(1.0f, 0.f, 1.0f, 0.5f))
const;
112 SurfacePtr get_current_surface()
const;
113 SurfacePtr get_current_editor_surface()
const;
115 uint32_t get_attributes()
const {
return m_attributes; }
116 int get_data()
const {
return m_data; }
126 bool is_solid (
const Rectf& tile_bbox,
const Rectf& position,
const Vector& movement)
const;
143 bool is_deprecated()
const {
return m_deprecated; }
145 const std::string& get_object_name()
const {
return m_object_name; }
146 const std::string& get_object_data()
const {
return m_object_data; }
151 bool check_movement_unisolid (
const Vector& movement)
const;
155 bool check_position_unisolid (
const Rectf& obj_bbox,
156 const Rectf& tile_bbox)
const;
159 std::vector<SurfacePtr> m_images;
160 std::vector<SurfacePtr> m_editor_images;
163 uint32_t m_attributes;
170 std::string m_object_name;
171 std::string m_object_data;
178 Tile& operator=(
const Tile&) =
delete;
solid tile that is indestructible by Tux
Definition: tile.hpp:41
bool is_slope() const
Checks the SLOPE attribute.
Definition: tile.hpp:119
bool is_unisolid() const
Checks the UNISOLID attribute.
Definition: tile.hpp:141
a water tile in which tux starts to swim
Definition: tile.hpp:64
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
for lava: WATER, HURTS, FIRE
Definition: tile.hpp:68
a brick that can be destroyed by jumping under it
Definition: tile.hpp:45
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
a walljumping trigger tile
Definition: tile.hpp:70
an ice brick that makes tux sliding more than usual
Definition: tile.hpp:62
uni-directional solid tile
Definition: tile.hpp:43
the level should be finished when touching a goaltile.
Definition: tile.hpp:50
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:133
Definition: canvas.hpp:43
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42
Bonusbox, content is stored in data.
Definition: tile.hpp:54
slope tile
Definition: tile.hpp:52
a tile that hurts Tux if he touches it
Definition: tile.hpp:66